This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/13420] New: prologue detection fails for unoptimized 64bit cast-scope.exp testcase


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]