public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/13420] New: prologue detection fails for unoptimized 64bit cast-scope.exp testcase
@ 2011-11-21 12:22 mjw at redhat dot com
  2011-11-21 12:44 ` [Bug translator/13420] " mjw at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mjw at redhat dot com @ 2011-11-21 12:22 UTC (permalink / raw)
  To: systemtap

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

             Bug #: 13420
           Summary: prologue detection fails for unoptimized 64bit
                    cast-scope.exp testcase
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: mjw@redhat.com
    Classification: Unclassified


cast-scope-m64 fails because prologue detection didn't pinpoint the right
location to pick up the arguments. Note that this only happens for 64-bit
builds without any optimization m64-O? and m32 are just fine.

The issue is that without optimization gcc will just put the incoming arguments
on the stack and then tell us through dwarf that they can be found on the stack
relative to the frame pointer:

 [  283b]    subprogram
             external             (flag) Yes
             name                 (strp) "length"
             decl_file            (data1) 1
             decl_line            (data1) 6
             MIPS_linkage_name    (strp) "_Z6lengthRKSs"
             type                 (ref4) [    70]
             low_pc               (addr) 0x00000000004007a4 <_Z6lengthRKSs>
             high_pc              (addr) 0x00000000004007bf <main>
             frame_base           (block1)               [   0] call_frame_cfa
             sibling              (ref4) [  2870]

 [  2861]      formal_parameter
               name                 (string) "str"
               decl_file            (data1) 1
               decl_line            (data1) 6
               type                 (ref4) [  2870]
               location             (block1)                 [   0] fbreg -24

But at the address where we probe the argument has not yet been moved on the
stack.

  4007a4:    55                       push    %rbp
  4007a5:    48 89 e5                 mov     %rsp,%rbp
  4007a8:    48 83 ec 10              sub     $0x10,%rsp
  4007ac:    48 89 7d f8              mov     %rdi,-0x8(%rbp)
  4007b0:    90                       nop
  4007b1:    48 8b 45 f8              mov     -0x8(%rbp),%rax
  4007b5:    48 89 c7                 mov     %rax,%rdi
  4007b8:    e8 93 fe ff ff           callq   0x400650
  4007bd:    c9                       leaveq
  4007be:    c3                       retq

searching for prologue of function 'length'
0x4007a4-0x4007bf@/home/mark/src/systemtap/testsuite/systemtap.base/cast-scope.cxx:6
checking line record
0x4007a4@/home/mark/src/systemtap/testsuite/systemtap.base/cast-scope.cxx:7
prologue found function 'length' (naked) = 0x4007a4
probe length@/home/mark/src/systemtap/testsuite/systemtap.base/cast-scope.cxx:6
process=/usr/local/build/systemtap-obj/testsuite/cast-scope-m64.exe
reloc=.absolute pc=0x4007a4

-- 
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] 9+ messages in thread

end of thread, other threads:[~2014-02-28 20:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-21 12:22 [Bug translator/13420] New: prologue detection fails for unoptimized 64bit cast-scope.exp testcase mjw at redhat dot com
2011-11-21 12:44 ` [Bug translator/13420] " mjw at redhat dot com
2011-11-29 17:19 ` mjw at redhat dot com
2011-11-30 16:36 ` mjw at redhat dot com
2013-12-26 12:54 ` [Bug translator/13420] prologue detection fails for function parameters in unoptimized (-g only, no -O) code fche at redhat dot com
2013-12-26 13:04 ` fche at redhat dot com
2014-02-12 16:42 ` jlebon at redhat dot com
2014-02-27 19:56 ` jlebon at redhat dot com
2014-02-28 20:09 ` jlebon 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).