This is the mail archive of the mailing list for the GDB 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]

Re: syscall backtraces on arm-linux-gnu

On Fri, Aug 07, 2009 at 05:49:49PM +0200, Baurzhan Ismagulov wrote:
> It turned out that select is implemented in assembly in glibc, so no CFI
> is provided and gdb falls back to prologue analysis. The following hack
> fixes the use case for me:

The right answer is to somehow get CFI for this.  My preferred
solution is to teach gas how to generate DWARF-2 CFI from the ARM
EH directives (the functions in glibc are already annotated).
Worst case, someone can write the necessary DWARF by hand using
.byte directives.

> @@ -988,8 +990,6 @@ arm_scan_prologue (struct frame_info *th
>  			     regs[fp_start_reg++]);
>  	    }
>  	}
> -      else if ((insn & 0xf0000000) != 0xe0000000)
> -	break;			/* Condition not true, exit early */
>        else if ((insn & 0xfe200000) == 0xe8200000)	/* ldm? */
>  	break;			/* Don't scan past a block load */
>        else

Skipping a jump during scanning is definitely not safe.  That means
GDB's got no idea whether following instructions - pushes and stack
adjusts included - were executed.

You won't see much in the way of testsuite changes with this, because
the testsuite runs (A) with DWARF CFI from the compiler, and (B)
mostly without optimization.

Daniel Jacobowitz

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