Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA 3rd] tell in which register a register var is.
  2001-11-30  3:31 [RFA 3rd] tell in which register a register var is Pierre Muller
@ 2001-11-21 13:43 ` Pierre Muller
  2001-11-21 19:37 ` Andrew Cagney
  1 sibling, 0 replies; 5+ messages in thread
From: Pierre Muller @ 2001-11-21 13:43 UTC (permalink / raw)
  To: gdb-patches

I simplified my patch as REGISTER_NAME is used without
any tests at several other location in gdb sources.

OK to commit?



2001-11-30 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 -r1.25 findvar.c
871a872,877
 >       error("Address requested for identifier "
 >           "\"%s\" which is in register $%s",
 >             SYMBOL_SOURCE_NAME (var),
 >           REGISTER_NAME (VALUE_REGNO (lazy_value)));
 >       break;
 >
873,874c879,882
<       error ("Address requested for identifier \"%s\" which is in a register.",
<            SYMBOL_SOURCE_NAME (var));
---
 >       error("Address requested for identifier "
 >           "\"%s\" which is in frame register $%s",
 >             SYMBOL_SOURCE_NAME (var),
 >           REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));



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] 5+ messages in thread

* Re: [RFA 3rd] tell in which register a register var is.
  2001-11-30  3:31 [RFA 3rd] tell in which register a register var is Pierre Muller
  2001-11-21 13:43 ` Pierre Muller
@ 2001-11-21 19:37 ` Andrew Cagney
  2001-11-30  8:52   ` Andrew Cagney
  2001-12-03  0:42   ` Pierre Muller
  1 sibling, 2 replies; 5+ messages in thread
From: Andrew Cagney @ 2001-11-21 19:37 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> 2001-11-30 Pierre Muller  <muller@ics.u-strasbg.fr>
> * findvar.c (locate_var_value): Specify in which register a register
> 	variable is stored.
> 

Yes, ok.

However, can you, as a favour, add the assertion I suggested?  I agree 
with your logic - it should be ok.  However, I'm currently working on 
the REGISTER code and would dearly like more assertions so that I can 
detect earlier my screwups.

Either way, it is ok to go straight in.

enjoy,
Andrew



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

* [RFA 3rd] tell in which register a register var is.
@ 2001-11-30  3:31 Pierre Muller
  2001-11-21 13:43 ` Pierre Muller
  2001-11-21 19:37 ` Andrew Cagney
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre Muller @ 2001-11-30  3:31 UTC (permalink / raw)
  To: gdb-patches

I simplified my patch as REGISTER_NAME is used without
any tests at several other location in gdb sources.

OK to commit?



2001-11-30 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 -r1.25 findvar.c
871a872,877
 >       error("Address requested for identifier "
 >           "\"%s\" which is in register $%s",
 >             SYMBOL_SOURCE_NAME (var),
 >           REGISTER_NAME (VALUE_REGNO (lazy_value)));
 >       break;
 >
873,874c879,882
<       error ("Address requested for identifier \"%s\" which is in a register.",
<            SYMBOL_SOURCE_NAME (var));
---
 >       error("Address requested for identifier "
 >           "\"%s\" which is in frame register $%s",
 >             SYMBOL_SOURCE_NAME (var),
 >           REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));



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] 5+ messages in thread

* Re: [RFA 3rd] tell in which register a register var is.
  2001-11-21 19:37 ` Andrew Cagney
@ 2001-11-30  8:52   ` Andrew Cagney
  2001-12-03  0:42   ` Pierre Muller
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2001-11-30  8:52 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> 2001-11-30 Pierre Muller  <muller@ics.u-strasbg.fr>
> * findvar.c (locate_var_value): Specify in which register a register
> 	variable is stored.
> 

Yes, ok.

However, can you, as a favour, add the assertion I suggested?  I agree 
with your logic - it should be ok.  However, I'm currently working on 
the REGISTER code and would dearly like more assertions so that I can 
detect earlier my screwups.

Either way, it is ok to go straight in.

enjoy,
Andrew



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

* Re: [RFA 3rd] tell in which register a register var is.
  2001-11-21 19:37 ` Andrew Cagney
  2001-11-30  8:52   ` Andrew Cagney
@ 2001-12-03  0:42   ` Pierre Muller
  1 sibling, 0 replies; 5+ messages in thread
From: Pierre Muller @ 2001-12-03  0:42 UTC (permalink / raw)
  To: gdb-patches

At 17:52 30/11/2001 , Andrew Cagney a écrit:
>>2001-11-30 Pierre Muller  <muller@ics.u-strasbg.fr>
>>* findvar.c (locate_var_value): Specify in which register a register
>>         variable is stored.
>
>Yes, ok.
>
>However, can you, as a favour, add the assertion I suggested?  I agree with your logic - it should be ok.  However, I'm currently working on the REGISTER code and would dearly like more assertions so that I can detect earlier my screwups.

   Committed, modifed as Andrew asked for.

Thus I send the patch once more.

2001-11-30  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 -p -r1.25 findvar.c
--- findvar.c   2001/11/10 21:34:56     1.25
+++ findvar.c   2001/12/03 08:38:00
@@ -29,6 +29,7 @@
  #include "inferior.h"
  #include "target.h"
  #include "gdb_string.h"
+#include "gdb_assert.h"
  #include "floatformat.h"
  #include "symfile.h"           /* for overlay functions */
  #include "regcache.h"
@@ -869,9 +870,21 @@ locate_var_value (register struct symbol
    switch (VALUE_LVAL (lazy_value))
      {
      case lval_register:
+       gdb_assert (REGISTER_NAME (VALUE_REGNO (lazy_value)) != NULL
+                   && *REGISTER_NAME (VALUE_REGNO (lazy_value)) != '\0');
+      error("Address requested for identifier "
+           "\"%s\" which is in register $%s",
+            SYMBOL_SOURCE_NAME (var), 
+           REGISTER_NAME (VALUE_REGNO (lazy_value)));
+      break;
+
      case lval_reg_frame_relative:
-      error ("Address requested for identifier \"%s\" which is in a register.",
-            SYMBOL_SOURCE_NAME (var));
+       gdb_assert (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != NULL
+                   && *REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != '\0');
+      error("Address requested for identifier "
+           "\"%s\" which is in frame register $%s",
+            SYMBOL_SOURCE_NAME (var), 
+           REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));
        break;
  
      default:



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] 5+ messages in thread

end of thread, other threads:[~2001-12-03  8:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-30  3:31 [RFA 3rd] tell in which register a register var is Pierre Muller
2001-11-21 13:43 ` Pierre Muller
2001-11-21 19:37 ` Andrew Cagney
2001-11-30  8:52   ` Andrew Cagney
2001-12-03  0:42   ` Pierre Muller

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