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: -var-update using formatted value


 > > If I change the format to hexadecimal, 11 -> 0xb say, the display should
 > > change, so I would like GDB to report it through -var-update.
 > 
 > Can you elaborate?  When do you call var-update in this case?  Is it right
 > after the var-set-format?

Yes.  Emacs sends commands to GDB behind the user's back to update the display
every time the user initiates a GDB command himself.

You can see what Emacs 22.1 does quite easily.  You probably don't want to look
through thousands of lines of lisp code (gdb-ui.el) but you can just set
gdb-enable-debug to t and look at the value of gdb-debug-log after issuing some
commands to GDB in a session in Emacs (M-x gdb) so see the transactions.

In fact, I'd be interested to know how well (badly?) GDB in Emacs performs
in an embedded environment.

 > > I don't use -var-evaluate-expression for current GDB.
 > 
 > So how to you display a value in a different format (say hex)? You must be
 > calling -var-update right away after the set-format.  That is why I thought
 > "-var-set-format --all-values var1 hex" would return the value in hex (or
 > whatever format specified).  I'd use this too, as I wouldn't need to call
 > evaluate-expression after var-set-format.

"-var-update --all-values" returns the value in hex so currently I don't think
you need it in the output of "-var-set-format".  Previously, when the contents
were compared, I did submit a patch to add the value field to the output of
"-var-set-format" but it was never incorporated.  Note that, as stated in the
manual, new fields may be added to existing commands, so your existinng
frontend should be able to handle the parsing of these possible extra fields
and adding an option "--all-values" isn't necessary.  In fact, it's probably
undesirable because the frontend would have to test for the availability of
this option, rather than just the presence of the field in the output.

 > Then, you could say var-evaluate-expression is superfluous (I think).

I think I already have!

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