From: Andrew Cagney <ac131313@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>
Cc: drow@mvista.com, gdb@sources.redhat.com
Subject: Re: RFC: Variables in blocks of registers
Date: Sun, 02 Feb 2003 16:52:00 -0000 [thread overview]
Message-ID: <3E3D43E5.3060904@redhat.com> (raw)
In-Reply-To: <200302012235.h11MZ30D023842@elgar.kettenis.dyndns.org>
If only it were that easy. The dwarf2 reader, for instance, also
contains the assumption that registers are allocated sequentially.
Is the proposal to modify such readers so that they check against this
next_allocated_regnum algorithm?
Andrew
> Index: findvar.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/findvar.c,v
> retrieving revision 1.44
> diff -u -p -r1.44 findvar.c
> --- findvar.c 14 Jan 2003 00:49:03 -0000 1.44
> +++ findvar.c 1 Feb 2003 22:29:45 -0000
> @@ -753,17 +753,18 @@ value_from_register (struct type *type,
> for (local_regnum = regnum;
> value_bytes_copied < len;
> (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum),
> - ++local_regnum))
> + local_regnum = gdbarch_next_allocated_regnum (current_gdbarch,
> + local_regnum)))
> {
> + if (local_regnum == -1)
> + return NULL; /* Register unknown. */
> +
> get_saved_register (value_bytes + value_bytes_copied,
> - &optim,
> - &addr,
> - frame,
> - local_regnum,
> + &optim, &addr, frame, local_regnum,
> &lval);
>
> Index: valops.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/valops.c,v
> retrieving revision 1.89
> diff -u -p -r1.89 valops.c
> --- valops.c 30 Jan 2003 16:44:20 -0000 1.89
> +++ valops.c 1 Feb 2003 22:29:47 -0000
> @@ -704,13 +704,17 @@ value_assign (struct value *toval, struc
> /* Copy it out. */
> for (regno = reg_offset, amount_copied = 0;
> amount_copied < amount_to_copy;
> - amount_copied += REGISTER_RAW_SIZE (regno), regno++)
> + (amount_copied += REGISTER_RAW_SIZE (regno),
> + regno = gdbarch_next_allocated_regnum (current_gdbarch, regno)))
> {
> enum lval_type lval;
> CORE_ADDR addr;
> int optim;
> int realnum;
> -
> +
> + if (regno == -1)
> + error ("Location of variable is unknown.");
> +
> /* Just find out where to put it. */
> frame_register (frame, regno, &optim, &lval, &addr, &realnum,
> NULL);
>
>
>
next prev parent reply other threads:[~2003-02-02 16:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-01 14:48 Mark Kettenis
2003-02-01 15:48 ` Andrew Cagney
2003-02-01 17:09 ` Daniel Jacobowitz
2003-02-01 20:45 ` Andrew Cagney
2003-02-02 16:13 ` Mark Kettenis
2003-02-02 5:21 ` Daniel Jacobowitz
2003-02-02 16:52 ` Andrew Cagney [this message]
2003-02-02 16:27 ` Daniel Jacobowitz
2003-02-04 2:31 ` Jim Blandy
2003-02-04 4:07 ` Daniel Berlin
2003-02-02 15:33 ` Daniel Berlin
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=3E3D43E5.3060904@redhat.com \
--to=ac131313@redhat.com \
--cc=drow@mvista.com \
--cc=gdb@sources.redhat.com \
--cc=kettenis@chello.nl \
/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