From: Daniel Jacobowitz <drow@mvista.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: Andrew Cagney <ac131313@cygnus.com>,
Eli Zaretskii <eliz@is.elta.co.il>,
gdb@sources.redhat.com
Subject: Re: bitwise operations on registers
Date: Thu, 14 Mar 2002 21:03:00 -0000 [thread overview]
Message-ID: <20020315000245.A23867@nevyn.them.org> (raw)
In-Reply-To: <3C9173AD.E2FBA5DA@zip.com.au>
On Thu, Mar 14, 2002 at 08:08:13PM -0800, Andrew Morton wrote:
> Andrew Cagney wrote:
> >
> > Andrew,
> >
> > Sounds like a bug report is in order (http://sources.redhat.com/gdb/bugs)
>
> Done. Thanks, guys.
>
> Mind if I ask a little usage question while I'm here?
>
> The kernel has various funky tricks which I'd like to be
> able to express in the debugger. For example, the currently-running
> task's controlling structure is always at
>
> *($esp & ~8191).
>
> So it would be convenient to be able to do
>
> define current ((struct task_struct *)($esp & ~8191))
>
> then
>
> (gdb) p current->pid
Can't really do this, but you can at least:
define current
((struct task_struct *)($esp & ~8191))
end
(gdb) current
$33 = <blah>
(gdb) $33->pid
> That's a simple one. More complex is a representation of
> the kernel's trick of using negative offsetof() to go from
> a doubly-linked-list structure back to the start of its containing
> object. The list_entry() macro.
>
> But alas, as far as I know, none of this is possible.
>
> Any pointers to how one could set about doing all of this?
No generic way to do it, you do have some userdefined function
capability. As you find specific shortcomings, file bugs :)
For instance: macros that return values would be useful. offsetof
would be useful.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-03-15 5:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-10 23:50 Andrew Morton
2002-03-11 3:04 ` Eli Zaretskii
2002-03-11 7:35 ` Andrew Cagney
2002-03-11 7:39 ` Daniel Jacobowitz
2002-03-14 19:12 ` Andrew Cagney
[not found] ` <3C9173AD.E2FBA5DA@zip.com.au>
2002-03-14 21:03 ` Daniel Jacobowitz [this message]
2002-03-27 13:43 ` Andrew Cagney
2002-03-27 14:55 ` Daniel Jacobowitz
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=20020315000245.A23867@nevyn.them.org \
--to=drow@mvista.com \
--cc=ac131313@cygnus.com \
--cc=akpm@zip.com.au \
--cc=eliz@is.elta.co.il \
--cc=gdb@sources.redhat.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