Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: gdb@sourceware.org, Pedro Alves <pedro@codesourcery.com>,
	        Pierre Muller <muller@ics.u-strasbg.fr>
Subject: Re: New breakpoint_re_set call vs remote targets
Date: Thu, 25 Jun 2009 16:52:00 -0000	[thread overview]
Message-ID: <e394668d0906250952w276b5577j1059cfc47edfbb8a@mail.gmail.com> (raw)
In-Reply-To: <20090624190346.GA17908@caradoc.them.org>

On Wed, Jun 24, 2009 at 12:03 PM, Daniel Jacobowitz<drow@false.org> wrote:
> This patch:
>
> 2009-06-17  Pierre Muller  <muller@ics.u-strasbg.fr>
>        Pedro Alves  <pedro@codesourcery.com>
>
>        * infcmd.c (post_create_inferior): Call breakpoint_re_set
>        after target
>        is pushed for watchpoint promotion to hardware watchpoint.
>
> causes a testcase failure in nodebug.exp for arm-none-eabi.  It will
> affect all bare-metal targets.
>
> The sequence is "target remote", which calls post_create_inferior
> before any program exists on the remote side.  Then later "load" fills
> in the code.  So we're doing prologue skipping - by reading target
> memory - before we've written the code to target memory.

"create_inferior" has a very specific connotation (at least in some
contexts), and at first glance it's odd that target_remote is calling
any foo_create_inferior.  [Consider, for example, that "run" uses
target_create_inferior, to_create_inferior is the target hook for
starting programs, and target remote doesn't support "run".]

The first question I had is why is target remote calling post_create_inferior?

So I go and look at post_create_inferior, which has this:

/* Common actions to take after creating any sort of inferior, by any
     means (running, attaching, connecting, et cetera).  The target
     should be stopped.  */

I wonder if name choices are making things harder than they should be.
[Harder in the sense that bugs get inadvertently introduced, and in
the sense that it's not as straightforward to reason about these
things.]
[Bad timing that this came up yesterday in a different context. :-)]

> I have long had a plan to speed up prologue skipping by making it read
> directly from the executable if possible.  We're using the
> executable's symbol table, so there's no reason to think the prologue
> will have moved around on the target.  The problems with this approach
> are (A) it involves changing a lot of symbol readers, 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.
>
> Thoughts?  Any other approaches to fix this failure?

I wonder if one useful step is to reassess post_create_inferior, and
maybe split it up or something.

From my perhaps ancient point of view, gdb is for debugging two kinds
of programs: hosted and freestanding (to borrow jargon from C - though
non-bare-metal and bare-metal may be more accurate. 1/2 :-)), and I
wonder if they're being inadvertently fused.
Or not.


  parent reply	other threads:[~2009-06-25 16:52 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
2009-06-24 23:53     ` Pedro Alves
2009-06-25 16:52 ` Doug Evans [this message]
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=e394668d0906250952w276b5577j1059cfc47edfbb8a@mail.gmail.com \
    --to=dje@google.com \
    --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