This is the mail archive of the gdb-patches@sourceware.org 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: [rfa] ARM prologue parsing support for Thumb-2 instructions


Daniel Jacobowitz wrote:
> On Fri, Oct 08, 2010 at 02:54:59PM +0200, Ulrich Weigand wrote:
> > All these are caused by failures to parse the prologues of hand-written
> > *ARM* assembler routines in glibc (system call handlers like nanosleep).
> > These simply deviate too far from the usual rules (e.g. by intermixing
> > stack saving/restoring of registers with conditional branches, or by
> > temporarily saving registers into other registers instead of the stack)
> > for the ARM prologue parser to be able to handle them.
> > 
> > It seems to me that there is not much sense in attempting to support
> > even this type of code.  I guess we should strongly recommend to have
> > (at least) glibc debuginfo files installed if you want to debug.
> 
> I agree with your conclusion.  It's just not worthwhile; either
> install debuginfo files, or leave .debug_frame in the stripped
> libraries.

Hmm, I noticed one set of problems is due to the __libc_do_syscall
function you added in this patch:

http://sourceware.org/ml/gdb-patches/2010-10/msg00137.html

	.thumb
	.syntax unified
	.hidden __libc_do_syscall

ENTRY (__libc_do_syscall)
	.fnstart
	push	{r7, lr}
	.save	{r7, lr}
	cfi_adjust_cfa_offset (8)
	cfi_rel_offset (r7, 0)
	cfi_rel_offset (lr, 4)
	mov	r7, ip
	swi	0x0
	pop	{r7, pc}
	.fnend
END (__libc_do_syscall)


The GDB prologue parser would actually be easily capable of understanding
this function prologue.  However, it doesn't work because GDB does not even
find the start of the function in the first place, since the symbol is
present only in the regular symbol table (which is stripped), and not in
the dynamic symbol table, because of the ".hidden" directive.

Is there any particular reason why this function could not be at least
.protected instead?

[ Note that this shows up even with glibc debuginfo installed when running
the break-interp.exp test case, because that test uses a copy of libc.so
so that GDB doesn't find the install debuginfo any more ... ]

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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