From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Nick Duffek <nsd@redhat.com>
Cc: ezannoni@cygnus.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA] findvar.c: support LOC_BASEREG[_ARG] on Harvard archs
Date: Mon, 16 Jul 2001 11:29:00 -0000 [thread overview]
Message-ID: <np7kx8zpy0.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <200107161713.f6GHDNC08483@rtl.cygnus.com>
Nick Duffek <nsd@redhat.com> writes:
> At the moment, GDB doesn't apply the necessary POINTER_TO_ADDRESS
> translation to the base register value used for finding LOC_BASEREG and
> LOC_BASEREG_ARG variables.
>
> This patch applies that translation. Okay to apply?
(I think David Taylor is the maintainer for findvar.c.)
The idea seems fine. The alternative would be to have that code call
value_from_register and then value_as_pointer, as is done for
LOC_REGPARM_ADDR, rather than banging the bits yourself with
get_saved_register and extract_address. But if you are going to bang
the bits yourself, you do need to call POINTER_TO_ADDRESS.
I think it would be a little cleaner to use `lookup_pointer_type
(type)' instead of builtin_type_void_data_ptr; that gives more
information to the target's POINTER_TO_ADDRESS function. ANSI C says
void * can be used as a generic type for all data pointers, but GDB is
supposed to support other languages, too.
You should do similar things for LOC_INDIRECT, LOC_REF_ARG,
LOC_THREAD_LOCAL_STATIC. I think it's not needed for
LOC_REGPARM_ADDR; value_as_pointer should do the work.
>
> ChangeLog:
>
> * findvar.c (read_var_value): Filter LOC_BASEREG and
> LOC_BASEREG_ARG register values through POINTER_TO_ADDRESS.
>
> Nick Duffek
> <nsd@redhat.com>
>
> [patch follows]
>
> Index: gdb/findvar.c
> ===================================================================
> diff -up gdb/findvar.c gdb/findvar.c
> --- gdb/findvar.c Mon Jul 16 12:41:21 2001
> +++ gdb/findvar.c Mon Jul 16 12:39:40 2001
> @@ -612,9 +612,10 @@ addresses have not been bound by the dyn
> case LOC_BASEREG_ARG:
> {
> char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
> + memset (buf, 0, MAX_REGISTER_RAW_SIZE);
> get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
> NULL);
> - addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
> + addr = POINTER_TO_ADDRESS (builtin_type_void_data_ptr, buf);
> addr += SYMBOL_VALUE (var);
> break;
> }
>
next prev parent reply other threads:[~2001-07-16 11:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-16 10:13 Nick Duffek
2001-07-16 11:29 ` Jim Blandy [this message]
2001-07-16 14:35 ` Nick Duffek
[not found] ` <npsnfwy0u8.fsf@zwingli.cygnus.com>
2001-07-16 15:49 ` Andrew Cagney
2001-07-16 15:59 ` Jim Blandy
2001-07-16 16:13 ` Nick Duffek
2001-07-16 15:59 ` Nick Duffek
2001-07-16 16:09 ` Andrew Cagney
2001-07-16 16:13 ` Nick Duffek
2001-07-16 16:17 ` Nick Duffek
[not found] ` <3B535097.5040106@cygnus.com>
2001-07-16 14:16 ` Jim Blandy
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=np7kx8zpy0.fsf@zwingli.cygnus.com \
--to=jimb@zwingli.cygnus.com \
--cc=ezannoni@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=nsd@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