From: Daniel Jacobowitz <drow@false.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: target_find_description question
Date: Thu, 04 Sep 2008 12:12:00 -0000 [thread overview]
Message-ID: <20080904121139.GA27200@caradoc.them.org> (raw)
In-Reply-To: <200809022347.m82NluUS012008@d12av02.megacenter.de.ibm.com>
On Wed, Sep 03, 2008 at 01:47:56AM +0200, Ulrich Weigand wrote:
> Hi Dan,
>
> in testing the Cell debugger, I came across the question how to handle
> target_find_description for native (inf-ptrace) targets. As I understand
> it, the idea is to determine the target description *before* any access
> to target registers happens.
That's right. The remote target used to have a similar problem to the
one you describe, and before final merge I redid bits of it in order
to move target description reads earlier.
> But it seems a proper fix should be rather to call target_find_description
> earlier, indeed before any register access happens. Unfortunately this
> is a bit awkward as it would mean that either startup_inferior can no
> longer just call wait_for_inferior, or else that there would need to
> be special handling for this case in wait_for_inferior ...
>
> Do you have any suggestions how best to handle this?
target_find_description currently has a global flag,
target_desc_fetched, which means that reading the description multiple
times is harmless. The flag will need to become per-target in a
multi-target GDB, of course. So it's OK to call
target_find_description by hand at an earlier point, before any
register access.
Unfortunately we're supposed to do that when the target is stopped.
Otherwise, any check which attempts to read the registers or aux
vector will not work.
I suppose the easiest thing to do would be to call
target_find_description right before handle_inferior_event, and rely
on target_desc_fetched to prevent duplicate work.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-09-04 12:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-02 23:49 Ulrich Weigand
2008-09-04 12:12 ` Daniel Jacobowitz [this message]
2008-09-04 19:17 ` Ulrich Weigand
2008-09-04 21:52 ` Daniel Jacobowitz
2008-09-04 22:12 ` Pedro Alves
2008-09-04 22:27 ` Pedro Alves
2008-09-05 0:00 ` [patch, rfc] " Ulrich Weigand
2008-09-05 2:40 ` Daniel Jacobowitz
2008-09-05 13:11 ` Pedro Alves
2008-09-06 1:55 ` Joel Brobecker
2008-09-11 16:13 ` 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=20080904121139.GA27200@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.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