Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: dan@codesourcery.com (Daniel Jacobowitz)
Cc: matthew.gretton-dann@arm.com, rearnsha@arm.com,
	gdb-patches@sourceware.org
Subject: Re: [rfa] ARM prologue parsing support for Thumb-2 instructions
Date: Tue, 12 Oct 2010 16:56:00 -0000	[thread overview]
Message-ID: <201010121656.o9CGuMDo025020@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20101008132747.GO23776@caradoc.them.org> from "Daniel Jacobowitz" at Oct 08, 2010 09:27:48 AM

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


  reply	other threads:[~2010-10-12 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100719141029.GI6088@caradoc.them.org>
2010-10-08 12:55 ` Ulrich Weigand
2010-10-08 13:17   ` Richard Earnshaw
2010-10-08 13:32     ` Ulrich Weigand
2010-10-08 13:28   ` Daniel Jacobowitz
2010-10-12 16:56     ` Ulrich Weigand [this message]
2010-10-12 20:12       ` Daniel Jacobowitz
2010-10-14 14:10         ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010121656.o9CGuMDo025020@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=matthew.gretton-dann@arm.com \
    --cc=rearnsha@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox