Step into functions with veneers not working

Asked by Sebastian Perta on 2019-11-26


When veneer is used for a function call it is not possible to step into the function.

Since veneer don't have any debug information attached to them abd the GDB documentation says the following about stepping into functions without debug information "Also, the step command only enters a function if there is line number information for the function. Otherwise it acts like the next command." so we could say this is expected behavior.

Moreover this can be changed with "set step-mode on"
"The set step-mode on command causes the step command to stop at the first instruction of a function which contains no debug line information rather than stepping over it."

However using "set step-mode on" all the time is not very effective as the debugger is stepping into every library function so it needs to constantly turned on and off to be effective (and in turn the process of turning it on and off is not effective either).

Do you have any solution or possible solution to implement in a feature release to handle stepping to work correctly when veneers are involved? Thank you!

The toolchain version which I used is although is not to relevant as it can be reproduced with any toolchain which I tried and the veneer in question was:
000009b0 <__tutorial_veneer>:
 9b0: b401 push {r0}
 9b2: 4802 ldr r0, [pc, #8] ; (9bc <__tutorial_veneer+0xc>)
 9b4: 4684 mov ip, r0
 9b6: bc01 pop {r0}
 9b8: 4760 bx ip
 9ba: bf00 nop
 9bc: 20000869 .word 0x20000869

Question information

English Edit question
GNU Arm Embedded Toolchain Edit question
No assignee Edit question
Last query:
Last reply:

This question was reopened

Leo Havmøller (leh-p) said : #1

If you know it's a veneer then just step through disassembly?

Thank you for the quick reply!

>>If you know it's a veneer then just step through disassembly?

I didn't know it's a veneer, the C code looks like this:


Initially I thought it's a problem in GDB but after I saw the disassembly I realized what was happening.
As the project becomes more complex it's harder to keep track which function call have veneers and which don't.
Also I'm using Eclipse so there's no trivial way to swap back and forth between normal stepping and instruction stepping.

Leo Havmøller (leh-p) said : #3

> I'm using Eclipse
Well there's your problem ;-)

Launchpad Janitor (janitor) said : #4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.