public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/12663] New: statement probes on inlined-function-call sites: search .debug_line PLUS .debug_info
@ 2011-04-11 17:38 fche at redhat dot com
  2011-10-05 21:05 ` [Bug translator/12663] " scox at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: fche at redhat dot com @ 2011-04-11 17:38 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12663

           Summary: statement probes on inlined-function-call sites:
                    search .debug_line PLUS .debug_info
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: fche@redhat.com


By searching only .debug_line data, we miss some statement-probing 
opportunities.  For example, on current rawhide, the lines corresponding
to the function foo() cannot be selected for statement probing:


      1 inline void foo () {
      2  __asm__ __volatile__ ("nop");
      3 }
      4 
      5 int main () {
      6    int i = 0;
      7    foo ();
      8    i = 1; 
      9    foo ();
     10    return i;
     11 }

% stap -L 'process("a.out").statement("*@foo.c:*")' 
process("/tmp/a.out").statement("foo@/tmp/foo.c:1")
process("/tmp/a.out").statement("foo@/tmp/foo.c:2")
process("/tmp/a.out").statement("foo@/tmp/foo.c:3")
process("/tmp/a.out").statement("main@/tmp/foo.c:11") $i:int
process("/tmp/a.out").statement("main@/tmp/foo.c:5") $i:int

Note how foo.c:7 and foo.c:9 are missing.

% objdump --dwarf=decodedline a.out
foo.c                                          1           0x80483a0

foo.c                                          2           0x80483a3
foo.c                                          3           0x80483a4
foo.c                                          5           0x80483b0
foo.c                                          2           0x80483b3
foo.c                                         11           0x80483b5

whereas in the main .debug_info section:
....
 <2><64>: Abbrev Number: 6 (DW_TAG_inlined_subroutine)
    <65>   DW_AT_abstract_origin: <0x25>        
    <69>   DW_AT_low_pc      : 0x80483b3        
    <6d>   DW_AT_high_pc     : 0x80483b4        
    <71>   DW_AT_call_file   : 1        
    <72>   DW_AT_call_line   : 7        
 <2><73>: Abbrev Number: 6 (DW_TAG_inlined_subroutine)
    <74>   DW_AT_abstract_origin: <0x25>        
    <78>   DW_AT_low_pc      : 0x80483b4        
    <7c>   DW_AT_high_pc     : 0x80483b5        
    <80>   DW_AT_call_file   : 1        
    <81>   DW_AT_call_line   : 9        
....

so we have line :9 info right there, along with DW_AT_low_pc values we
could use to probe.  Systemtap (in guru mode) is even willing to place
a statement probe at those addresses.  Let's let stap resolve such
inlined-subroutine-calls for statement probes.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug translator/12663] statement probes on inlined-function-call sites: search .debug_line PLUS .debug_info
  2011-04-11 17:38 [Bug translator/12663] New: statement probes on inlined-function-call sites: search .debug_line PLUS .debug_info fche at redhat dot com
@ 2011-10-05 21:05 ` scox at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: scox at redhat dot com @ 2011-10-05 21:05 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12663

Stan Cox <scox at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |scox at redhat dot com
         AssignedTo|systemtap at sourceware dot |scox at redhat dot com
                   |org                         |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-05 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-11 17:38 [Bug translator/12663] New: statement probes on inlined-function-call sites: search .debug_line PLUS .debug_info fche at redhat dot com
2011-10-05 21:05 ` [Bug translator/12663] " scox at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).