[Bug gdb/26313] New: [aarch64] GDB doesn't skip prologues properly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26313] New: [aarch64] GDB doesn't skip prologues properly

Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26313

            Bug ID: 26313
           Summary: [aarch64] GDB doesn't skip prologues properly
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P1
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: luis.machado at linaro dot org
                CC: alan.hayward at arm dot com
  Target Milestone: ---
              Host: aarch64-*
            Target: aarch64-*
             Build: aarch64-*

Using gdb.arch/aarch64-prologue.exp, if we try to insert a breakpoint into
excessiveprologue, it will be inserted midway through the prologue. This is
incorrect.

The correct position should be the branch instruction.

--
(gdb) disass excessiveprologue                                
Dump of assembler code for function excessiveprologue:        
   0x00000000000007cc <+0>:     stp     x29, x30, [sp, #-208]!
   0x00000000000007d0 <+4>:     mov     x29, sp              
   0x00000000000007d4 <+8>:     stp     w0, w1, [sp, #16]    
   0x00000000000007d8 <+12>:    stp     x2, x3, [sp, #24]    
   0x00000000000007dc <+16>:    str     w4, [sp, #40]        
   0x00000000000007e0 <+20>:    str     x5, [sp, #48]        
   0x00000000000007e4 <+24>:    stur    w6, [sp, #52]        
   0x00000000000007e8 <+28>:    stur    x7, [sp, #56]        
   0x00000000000007ec <+32>:    stp     s0, s1, [sp, #64]    
   0x00000000000007f0 <+36>:    stp     d2, d3, [sp, #72]    
   0x00000000000007f4 <+40>:    stp     q4, q5, [sp, #96]    
   0x00000000000007f8 <+44>:    str     b6, [sp, #128]        
   0x00000000000007fc <+48>:    str     h7, [sp, #132]        
   0x0000000000000800 <+52>:    str     s8, [sp, #136]        
   0x0000000000000804 <+56>:    stur    d9, [sp, #140]        
   0x0000000000000808 <+60>:    stur    q10, [sp, #148]      
   0x000000000000080c <+64>:    stur    b11, [sp, #164]      
   0x0000000000000810 <+68>:    stur    h12, [sp, #160]      
   0x0000000000000814 <+72>:    stur    s13, [sp, #172]      
   0x0000000000000818 <+76>:    stur    d14, [sp, #176]      
   0x000000000000081c <+80>:    stur    q15, [sp, #184]      
   0x0000000000000820 <+84>:    bl      0x724 <innerfunc>    
   0x0000000000000824 <+88>:    ldp     w0, w1, [sp, #16]    
   0x0000000000000828 <+92>:    ldp     x2, x3, [sp, #24]    
   0x000000000000082c <+96>:    ldr     w4, [sp, #40]        
   0x0000000000000830 <+100>:   ldr     x5, [sp, #48]        
   0x0000000000000834 <+104>:   ldur    w6, [sp, #52]        
   0x0000000000000838 <+108>:   ldur    x7, [sp, #56]        
   0x000000000000083c <+112>:   ldp     s0, s1, [sp, #64]    
   0x0000000000000840 <+116>:   ldp     d2, d3, [sp, #72]    
   0x0000000000000844 <+120>:   ldp     q4, q5, [sp, #96]    
   0x0000000000000848 <+124>:   ldr     b6, [sp, #128]        
   0x000000000000084c <+128>:   ldr     h7, [sp, #132]        
   0x0000000000000850 <+132>:   ldr     s8, [sp, #136]        
   0x0000000000000854 <+136>:   ldur    d9, [sp, #140]        
   0x0000000000000858 <+140>:   ldur    q10, [sp, #148]      
   0x000000000000085c <+144>:   ldur    b11, [sp, #164]      
   0x0000000000000860 <+148>:   ldur    h12, [sp, #160]      
   0x0000000000000864 <+152>:   ldur    s13, [sp, #172]      
   0x0000000000000868 <+156>:   ldur    d14, [sp, #176]      
   0x000000000000086c <+160>:   ldur    q15, [sp, #184]      
   0x0000000000000870 <+164>:   ldp     x29, x30, [sp], #208  
   0x0000000000000874 <+168>:   ret                          
End of assembler dump.                              
--

(gdb) b excessiveprologue
Breakpoint 1 at 0x804

The correct position should be 0x820.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26313] [aarch64] GDB doesn't skip prologues properly

Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26313

--- Comment #1 from Luis Machado <luis.machado at linaro dot org> ---
The problem seems to be the lack of handling of OP_STURV in GDB's aarch64
prologue analyzer.

--
You are receiving this mail because:
You are on the CC list for the bug.