[Lldb-commits] [lldb] [lldb][test] Skip one inline stepping test for arm-ubuntu. (PR #114295)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 1 04:18:22 PDT 2024


DavidSpickett wrote:

dwarfdump: [arm_dwarfdump.txt](https://github.com/user-attachments/files/17598949/arm_dwarfdump.txt) (this doesn't seem different to what AArch64 produces)
objdump: [arm_objdump.txt](https://github.com/user-attachments/files/17598953/arm_objdump.txt)
stepping log: [arm_step_log.txt](https://github.com/user-attachments/files/17598983/arm_step_log.txt)

In the log file I break on main then step (`n`) once. It might be relevant that we don't use hardware single step on Arm 32 bit (it exists we just don't use it). So perhaps the combination of software single step and this inlined function is a problem.

I noticed that although you can step into (`s`) and out of (`fin`) the inlined function, if I did instruction steps (`ni`), lldb would not recognise that it was inside the inlined function:
```
(lldb) ni
Process 1792462 stopped
* thread #1, name = 'a.out', stop reason = instruction step over
    frame #0: 0x00400558 a.out`main(argc=1, argv=0xfffef3d4) at calling.cpp:11:5
   8   	
   9   	int main (int argc, char **argv) {
   10  	    inline_value = 0;    // Stop here and step over to set up stepping over.
-> 11  	    inline_trivial_1 (); // At inline_trivial_1 called from main.
   12  	    return 0;
   13  	}
(lldb) dis
a.out`main:
    0x40052c <+0>:  push   {r11, lr}
    0x400530 <+4>:  mov    r11, sp
    0x400534 <+8>:  sub    sp, sp, #12
    0x400538 <+12>: movw   r2, #0x0
    0x40053c <+16>: str    r2, [r11, #-0x4]
    0x400540 <+20>: str    r0, [sp, #0x4]
    0x400544 <+24>: str    r1, [sp]
    0x400548 <+28>: movw   r0, #0x0
    0x40054c <+32>: ldr    r1, [pc, #0x14] ; <+60> at calling.cpp
    0x400550 <+36>: add    r1, pc, r1
    0x400554 <+40>: str    r0, [r1]
->  0x400558 <+44>: nop    
    0x40055c <+48>: movw   r0, #0x0
    0x400560 <+52>: mov    sp, r11
    0x400564 <+56>: pop    {r11, pc}
    0x400568 <+60>: andeq  r0, r1, r4, ror #21
(lldb) bt
* thread #1, name = 'a.out', stop reason = instruction step over
  * frame #0: 0x00400558 a.out`main(argc=1, argv=0xfffef3d4) at calling.cpp:11:5
    frame #1: 0xf7c8d7d6 libc.so.6`__libc_start_call_main(main=(a.out`main at calling.cpp:9), argc=1, argv=0xfffef3d4) at libc_start_call_main.h:58:16
    frame #2: 0xf7c8d886 libc.so.6`__libc_start_main_impl(main=(a.out`main at calling.cpp:9), argc=0, argv=0xf7d8e000, init=<unavailable>, fini=0x00000000, rtld_fini=(ld-linux-armhf.so.3`_dl_fini + 1 at dl-fini.c:51:20), stack_end=0xfffef3d4) at libc-start.c:392:3
    frame #3: 0x00400458 a.out`_start + 40
```

If I add a second nop, it will realise it's in the inlined function when it gets to the second nop.



https://github.com/llvm/llvm-project/pull/114295


More information about the lldb-commits mailing list