Broken prologue skipping with non-returning function

Jonathan Larmour
Fri Sep 19 19:01:00 GMT 2008

Daniel Jacobowitz wrote:
> On Fri, Sep 19, 2008 at 03:32:59PM +0100, Jonathan Larmour wrote:
>> We end up with a .loc for both lines 6 and 7 with no intervening
>> instructions. gdb's symtab.c:find_pc_sect_line() looks for when the pc
>> changes to something different and thus ends up returning a symtab_and_line
>> indicating that the line at that pc is at the 'if' and runs from the start
>> of the function to the ldr after the .loc 1 9 0.
> skip_prologue_using_sal is supposed to detect this.  We have a
> patch to improve it in our internal tree that we haven't gotten round
> to yet.  Here it is; I do not remember what the language_asm check was
> really about, except that I'm sure it came up running the gdb
> testsuite, so removing it and running asm-source.exp would probably
> explain it.

Thanks! The current arm-tdep.c doesn't presently use
skip_prologue_using_sal() however. At a guess that's also lurking in your
internal tree, but nevermind, I'm attaching a patch assuming that's useful.

With both of these (and my tentative patch reverted) I can confirm it works
as expected.

If it helps, I have write after approval perms, and a valid current FSF
copyright assignment, including disclaimer with my current employer. I
noticed I need to update my email address in the MAINTAINERS file which I
can do too.

I can check in your change too. If so, presumably you already have a
ChangeLog entry you'd like me to use to ease your merges?


2008-09-19  Jonathan Larmour  <>

	* arm-tdep.c (arm_skip_prologue): Call skip_prologue_using_sal
	instead of determining symbol and line info directly.

eCosCentric Limited     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine
    >>>> Visit us on stand 905 at the Embedded Systems Show 2008 <<<<
    >>>> Oct 1-2, NEC, Birmingham, UK  <<<<
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm.skip.prologue.using.sal.patch
Type: text/x-patch
Size: 2441 bytes
Desc: not available
URL: <>

More information about the Gdb mailing list