From: Daniel Jacobowitz <drow@false.org>
To: Marcel Moolenaar <marcel@cup.hp.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] New port: ia64-*-freebsd
Date: Fri, 15 Jul 2005 02:16:00 -0000 [thread overview]
Message-ID: <20050715021634.GA27723@nevyn.them.org> (raw)
In-Reply-To: <2845064d598c2c3d2433909ea136f830@cup.hp.com>
On Thu, Jul 14, 2005 at 07:08:09PM -0700, Marcel Moolenaar wrote:
> >The comment on TARGET_OBJECT_DIRTY says "see ia64-tdep.c", which has
> >basically no comments explaining what it does, or why it is necessary
> >for FreeBSD when it isn't for GNU/Linux.
>
> A quick explanation then:
> Stacked registers are either dirty or flushed when it comes to
> accessing them. Stacked registers that are flushed have been
> written to the backing store by the processor -- they are in
> the target's memory. Stacked registers that are dirty are still
> in the processor. They end up on the kernel's stack of the
> corresponding process whenever there's a kernel context switch.
> Linux abstracts this and allows them both to be read and written
> the same way. FreeBSD doesn't abstract this. The reason
> FreeBSD doesn't abstract it is because it is not always possible
> to do so, nor is it always beneficial to do so.
> So, in order for gdb to handle all possible failure modes, it
> needs to be aware of the difference so that it can access the
> registers accordingly.
>
> A typical example of a failure mode that cannot be debugged with
> abstraction, is a core file created when the backing store overflows.
> The kernel will not be able to move the dirty stacked registers
> in the core file, because there's no room for it (there's no space
> on the backing store where they would normally go). They need to
> be written into the core file as a note (like the general registers)
> and fetched seperately.
Thank you! This needs to be described in the source somewhere. I'd
like to see a more descriptive name for TARGET_OBJECT_DIRTY, also,
though I don't have any advice - right now it would be a good place to
stick a dirty hack. Or dirty laundry.
> >The corelow.c implementation of TARGET_OBJECT_DIRTY looks pretty
> >sketchy for target-independent code.
>
> What exactly do you mean?
+ case TARGET_OBJECT_DIRTY:
+ {
+ ULONGEST addr;
+ addr = *(ULONGEST*)annex + offset;
+ if (readbuf)
+ return (*ops->deprecated_xfer_memory) (addr, readbuf, len,
+ 0/*read*/, NULL, ops);
+ if (writebuf)
+ return (*ops->deprecated_xfer_memory) (addr, writebuf, len,
+ 1/*write*/, NULL, ops);
+ return -1;
+ }
+
So, it treats the annex as a memory pointer and returns the contents of
memory there. Why? And why is this a useful generic implementation?
From your description abov it sounds like these ought to be in their
own core file note anyway; why have they ended up in "memory"?
>
> >You have a lot of non-GNUish formatting issues - mostly the pesky
> >spacing rules.
>
> No doubt. I'm not used to the GNU formatting :-)
You did better than most people not used to it can manage :-)
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-07-15 2:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-05 19:52 Marcel Moolenaar
2005-07-06 17:24 ` Followup: " Marcel Moolenaar
2005-07-15 0:01 ` Daniel Jacobowitz
2005-07-15 2:08 ` Marcel Moolenaar
2005-07-15 2:16 ` Daniel Jacobowitz [this message]
2005-07-15 18:20 ` Marcel Moolenaar
2005-07-24 21:26 ` Daniel Jacobowitz
2005-07-25 17:32 ` Marcel Moolenaar
2005-07-25 17:36 ` Daniel Jacobowitz
2005-07-25 17:58 ` Marcel Moolenaar
2005-07-25 19:34 ` Mark Kettenis
2005-07-25 20:41 ` Marcel Moolenaar
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=20050715021634.GA27723@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=marcel@cup.hp.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