]>
Commit | Line | Data |
---|---|---|
2536cf64 LK |
1 | ### |
2 | ### Generate GDB commands, that load symbols for specified module, | |
3 | ### with proper section relocations. See .gdbinit | |
4 | ### | |
5 | ### $Id: gmodule.pl,v 1.2 2006/05/14 11:38:42 lkundrak Exp lkundrak $ | |
6 | ### Lubomir Kundrak <lkudrak@skosi.org> | |
7 | ### | |
8 | ||
9 | use strict; | |
10 | ||
11 | while (<>) { | |
12 | my ($name, %sections) = split; | |
13 | ||
14 | print "add-symbol-file $name.module"; | |
15 | ||
16 | open (READELF, "readelf -S $name.mod |") or die; | |
17 | while (<READELF>) { | |
18 | /\[\s*(\d+)\]\s+(\.\S+)/ or next; | |
19 | ||
20 | if ($2 eq '.text') { | |
21 | print " $sections{$1}"; | |
22 | next; | |
23 | } | |
24 | ||
25 | print " -s $2 $sections{$1}" | |
26 | if ($sections{$1} ne '0x0'); | |
27 | }; | |
28 | close (READELF); | |
29 | print "\n"; | |
30 | } |