Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA 2nd try] tell in which register a register var is loaded.
@ 2001-11-08  7:24 Pierre Muller
  2001-11-27 19:37 ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2001-11-08  7:24 UTC (permalink / raw)
  To: gdb-patches

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 ?


2001-11-20 Pierre Muller  <muller@ics.u-strasbg.fr>

	* findvar.c (locate_var_value): specify in which register a register
	variable is stored.


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;




Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 2nd try] tell in which register a register var is loaded.
  2001-11-27 19:37 ` Andrew Cagney
@ 2001-11-15 10:53   ` Andrew Cagney
  2001-11-16 14:19   ` Pierre Muller
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2001-11-15 10:53 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> 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;
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 2nd try] tell in which register a register var is loaded.
  2001-11-27 19:37 ` Andrew Cagney
  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
  1 sibling, 2 replies; 7+ messages in thread
From: Pierre Muller @ 2001-11-16 14:19 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

At 04:37 28/11/2001 , Andrew Cagney a écrit:
>>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.

Looking at different places where REGISTER_NAME is used, it seems to be 
almost always assumed that it is valid, so I will probably simply remove the check.

>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 :-)

Look at tracepoint.c around line 2380 in function scope_info
and you will find lots of GDB code using printf_filtered("... in register $%s",REGISTER_NAME(...))

>Otherwize, yes, a much more helpful error message.



Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 2nd try] tell in which register a register var is  loaded.
  2001-11-28 11:27     ` Andrew Cagney
@ 2001-11-17 17:22       ` Andrew Cagney
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2001-11-17 17:22 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

>>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 :-)
> 
> 
> Look at tracepoint.c around line 2380 in function scope_info
> and you will find lots of GDB code using printf_filtered("... in register $%s",REGISTER_NAME(...))
> 
> 
>>Otherwize, yes, a much more helpful error message.

Doh!  Ok, fine with me then.

enjoy,
Andrew



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 2nd try] tell in which register a register var is loaded.
  2001-11-08  7:24 [RFA 2nd try] tell in which register a register var is loaded Pierre Muller
@ 2001-11-27 19:37 ` Andrew Cagney
  2001-11-15 10:53   ` Andrew Cagney
  2001-11-16 14:19   ` Pierre Muller
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Cagney @ 2001-11-27 19:37 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> 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;
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 2nd try] tell in which register a register var is loaded.
  2001-11-16 14:19   ` Pierre Muller
@ 2001-11-28  7:52     ` Pierre Muller
  2001-11-28 11:27     ` Andrew Cagney
  1 sibling, 0 replies; 7+ messages in thread
From: Pierre Muller @ 2001-11-28  7:52 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]

At 04:37 28/11/2001 , Andrew Cagney a écrit:
>>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.

Looking at different places where REGISTER_NAME is used, it seems to be 
almost always assumed that it is valid, so I will probably simply remove the check.

>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 :-)

Look at tracepoint.c around line 2380 in function scope_info
and you will find lots of GDB code using printf_filtered("... in register $%s",REGISTER_NAME(...))

>Otherwize, yes, a much more helpful error message.



Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA 2nd try] tell in which register a register var is  loaded.
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2001-11-28 11:27 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

>>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 :-)
> 
> 
> Look at tracepoint.c around line 2380 in function scope_info
> and you will find lots of GDB code using printf_filtered("... in register $%s",REGISTER_NAME(...))
> 
> 
>>Otherwize, yes, a much more helpful error message.

Doh!  Ok, fine with me then.

enjoy,
Andrew



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-11-28 19:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-08  7:24 [RFA 2nd try] tell in which register a register var is loaded Pierre Muller
2001-11-27 19:37 ` Andrew Cagney
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox