Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb@sourceware.org, Pierre Muller <muller@ics.u-strasbg.fr>
Subject: Re: New breakpoint_re_set call vs remote targets
Date: Wed, 24 Jun 2009 23:46:00 -0000	[thread overview]
Message-ID: <20090624234634.GA24279@caradoc.them.org> (raw)
In-Reply-To: <200906250037.17148.pedro@codesourcery.com>

On Thu, Jun 25, 2009 at 12:37:16AM +0100, Pedro Alves wrote:
> What does the failure look like?  I assume that either prologue
> skipping just doesn't skip anything meaningful and the breakpoint
> ends up set at the beginning of the garbage "prologue"; or, some exception
> is thrown (I'd argue that prologue skipping shouldn't throw in this case).

The memory happens to be mostly zero at this point.  The zero pattern
in Thumb mode is lsl r0, #0 (from memory, don't shoot me if I'm
wrong).  That's a nop - which the prologue skipper happily skips.
In fact, in one case it keeps skipping right past the end of the
function.

(This is nodebug.exp.)

> This sounds like something that has always been broken, but we
> didn't notice due to the fact that nothing happens pulls symbols
> between "target remote" and "load" on those configurations: e.g.,
> from your description, target remote; add-symbol-file; load;
> should be failing even before that patch? (given that add-symbol-file
> triggers a breakpoint reset).

Probably so, but in practice it rarely ever triggered before now.
Now it happens all the time, although it's mitigated by debug info;
we'll use that for prologue skipping instead.

> Yeah, this could hacked by forcing trust-readonly-sections in
> some places.  This and address spaces have made me think before that
> to_xfer_partial may be a too stiff interface for memory reads
> (in that we may end up reviving deprecated_xfer_memory...).
> 
> > and (B) I'm not 
> > sure if we want to handle fix-and-continue style function patching in
> > which case we need to read from the target anyway.
> 
> Right.  That's the main counter-point.

Curious what folks think of the tradeoff here.

> > Thoughts?  Any other approaches to fix this failure?
> 
> Assuming the debugging session didn't blow up, wouldn't a
> breakpoint_re_set call after loading fix this?  The live
> target has gotten new code loaded, so triggering
> breakpoint re-evaluation and prologue skipping doesn't sound
> wrong to me.

Yeah, that would probably do it.  I think it's wacky that prologue
skipping relies on target memory, though.

> It also occurs to me that for always-inserted mode, we'd probably
> want to uninsert breakpoints before loading.

Uck.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2009-06-24 23:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24 19:04 Daniel Jacobowitz
2009-06-24 23:36 ` Pedro Alves
2009-06-24 23:46   ` Daniel Jacobowitz [this message]
2009-06-24 23:53     ` Pedro Alves
2009-06-25 16:52 ` Doug Evans
2009-06-25 18:33   ` Daniel Jacobowitz
2009-06-25 19:36     ` Doug Evans

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=20090624234634.GA24279@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=muller@ics.u-strasbg.fr \
    --cc=pedro@codesourcery.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