This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

value_of_register think-o bug and so on ...


Hello,

findvar.c:value_of_register() contains:

   get_saved_register (raw_buffer, &optim, &addr,
		      selected_frame, regnum, &lval);

   if (register_cached (regnum) < 0)
     return NULL;		/* register value not available */

I think the test for register_cached(regnum) is wrong.  The value 
returned from get_saved_register() may have been taken from the stack so 
checking the status of the cache isn't correct.

I guess I need to change get_saved_register() and a number of other 
things up the chain to return a register not-available indication.

---

This let me to a bit of a search for where &optim is set.  As best I can 
tell it is only set in one place - dwarf2cfi.c.

Looking at that code:

	case REG_CTX_UNSAVED:
	  read_register_gen (regnum, raw_buffer);
	  if (lval != NULL)
	    *lval = not_lval;
	  if (optimized != NULL)
	    *optimized = 1;
	  break;

can anyone explain why this value was optimized?

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]