~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to grub-core/gmodule.pl.in

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}