This is the mail archive of the gdb@sourceware.org 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]

RE: Re: -var-update using formatted value


 > I was trying to understand why the new behaviour for var-udpate, but I
 > haven't figured out why a front-end would benefit from having -var-update
 > indicate that a variable object has changed if only its printed value is
 > different but not its actual content.

My logic for making the change was that changes in string values were only
detected if their first character changed.  For example the change
"GNU" to GDB":

  strcpy (fred, "GNU");
  strcpy (fred, "GDB");

$4 = 0x804a018 "GNU"
$5 = 0x804a018 "GDB"

did not get picked up by -var-update.

Clearly I didn't consider your case.  I notice that:

(gdb) p 11
$1 = 11
(gdb) p/x 11
$2 = 0xb
(gdb) p/o 11
$3 = 013
(gdb) p/t 11
$6 = 1011

hexadecimal and octal outputs are distinguished by a prefix but the binary
output isn't.

In Eclipse how does the user know if he is looking at a binary or decimal
value?

I guess there's no accepted convention for binary numbers, but would it be
sensible for GDB to prefix their output in some way? , e.g.,

(gdb) p/t 11
$6 = b1011

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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