From: Andrew Cagney <ac131313@cygnus.com>
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA 2nd try] tell in which register a register var is loaded.
Date: Tue, 27 Nov 2001 19:37:00 -0000 [thread overview]
Message-ID: <3C045C10.3020902@cygnus.com> (raw)
In-Reply-To: <4.2.0.58.20011120180519.016c6008@ics.u-strasbg.fr>
> This patch superseeds the previous one,
> the lval_reg_frame_relative case was not handled correctly there.
>
> http://sources.redhat.com/ml/gdb-patches/2001-11/msg00301.html
>
>
> Still no idea who should give an approval for this patch ?
No one else did so ...
> 2001-11-20 Pierre Muller <muller@ics.u-strasbg.fr>
>
> * findvar.c (locate_var_value): specify in which register a register
> variable is stored.
Don't forget to ucase ``specify''.
Hmm, can REGISTER_NAME (num) ever be invalid or is this just being careful?
If the latter then can I suggest an assertion vis:
gdb_assert (REGISTER_NAME (...) != NULL
&& *REGISTER_NAME (...) != '\0');
If the former then the test will need to be tweeked to check for both
NULL and '\0'.
Your choice.
I don't think the ``$'' prefix is consistent with existing code - based
mainly on a quick grep that didn't reveal any code doing this. (I don't
actually have anything agains the convention though - just a separate
change :-)
Otherwize, yes, a much more helpful error message.
enjoy,
Andrew
> Index: findvar.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/findvar.c,v
> retrieving revision 1.25
> diff -u -r1.25 findvar.c
> --- findvar.c 2001/11/10 21:34:56 1.25
> +++ findvar.c 2001/11/20 17:04:06
> @@ -869,8 +869,20 @@
> switch (VALUE_LVAL (lazy_value))
> {
> case lval_register:
> + if (REGISTER_NAME (VALUE_REGNO (lazy_value)))
> + error("Address requested for identifier \"%s\" which is in register $%s",
> + SYMBOL_SOURCE_NAME (var), REGISTER_NAME (VALUE_REGNO (lazy_value)));
> + else
> + error ("Address requested for identifier \"%s\" which is in a register.",
> + SYMBOL_SOURCE_NAME (var));
> + break;
> +
> case lval_reg_frame_relative:
> - error ("Address requested for identifier \"%s\" which is in a register.",
> + if (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)))
> + error("Address requested for identifier \"%s\" which is in frame register $%s",
> + SYMBOL_SOURCE_NAME (var), REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));
> + else
> + error ("Address requested for identifier \"%s\" which is in a register.",
> SYMBOL_SOURCE_NAME (var));
> break;
>
WARNING: multiple messages have this Message-ID
From: Andrew Cagney <ac131313@cygnus.com>
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA 2nd try] tell in which register a register var is loaded.
Date: Thu, 15 Nov 2001 10:53:00 -0000 [thread overview]
Message-ID: <3C045C10.3020902@cygnus.com> (raw)
Message-ID: <20011115105300.zRjwkGwOctkC_TfOVjNsLZFFSz8YdfLRKfAL9jU-EBI@z> (raw)
In-Reply-To: <4.2.0.58.20011120180519.016c6008@ics.u-strasbg.fr>
> This patch superseeds the previous one,
> the lval_reg_frame_relative case was not handled correctly there.
>
> http://sources.redhat.com/ml/gdb-patches/2001-11/msg00301.html
>
>
> Still no idea who should give an approval for this patch ?
No one else did so ...
> 2001-11-20 Pierre Muller <muller@ics.u-strasbg.fr>
>
> * findvar.c (locate_var_value): specify in which register a register
> variable is stored.
Don't forget to ucase ``specify''.
Hmm, can REGISTER_NAME (num) ever be invalid or is this just being careful?
If the latter then can I suggest an assertion vis:
gdb_assert (REGISTER_NAME (...) != NULL
&& *REGISTER_NAME (...) != '\0');
If the former then the test will need to be tweeked to check for both
NULL and '\0'.
Your choice.
I don't think the ``$'' prefix is consistent with existing code - based
mainly on a quick grep that didn't reveal any code doing this. (I don't
actually have anything agains the convention though - just a separate
change :-)
Otherwize, yes, a much more helpful error message.
enjoy,
Andrew
> Index: findvar.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/findvar.c,v
> retrieving revision 1.25
> diff -u -r1.25 findvar.c
> --- findvar.c 2001/11/10 21:34:56 1.25
> +++ findvar.c 2001/11/20 17:04:06
> @@ -869,8 +869,20 @@
> switch (VALUE_LVAL (lazy_value))
> {
> case lval_register:
> + if (REGISTER_NAME (VALUE_REGNO (lazy_value)))
> + error("Address requested for identifier \"%s\" which is in register $%s",
> + SYMBOL_SOURCE_NAME (var), REGISTER_NAME (VALUE_REGNO (lazy_value)));
> + else
> + error ("Address requested for identifier \"%s\" which is in a register.",
> + SYMBOL_SOURCE_NAME (var));
> + break;
> +
> case lval_reg_frame_relative:
> - error ("Address requested for identifier \"%s\" which is in a register.",
> + if (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)))
> + error("Address requested for identifier \"%s\" which is in frame register $%s",
> + SYMBOL_SOURCE_NAME (var), REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));
> + else
> + error ("Address requested for identifier \"%s\" which is in a register.",
> SYMBOL_SOURCE_NAME (var));
> break;
>
next prev parent reply other threads:[~2001-11-27 19:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-08 7:24 Pierre Muller
2001-11-27 19:37 ` Andrew Cagney [this message]
2001-11-15 10:53 ` Andrew Cagney
2001-11-16 14:19 ` Pierre Muller
2001-11-28 7:52 ` Pierre Muller
2001-11-28 11:27 ` Andrew Cagney
2001-11-17 17:22 ` Andrew Cagney
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=3C045C10.3020902@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=muller@cerbere.u-strasbg.fr \
/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