public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* MI: "print /c whatever"
@ 2006-01-30 13:32 Vladimir Prus
  2006-02-06 23:42 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Prus @ 2006-01-30 13:32 UTC (permalink / raw)
  To: gdb


Hi!
It seems like MI has no command that's equivalent to "print /c whatever",
that is, printing using character format.

The -data-evaluate-expression does not accept format specifier, and the
-var-set-format does not allow to specify character format (that's with CVS
code state).

So:
1. Can anybody suggest a workaround that works with gdb 6.3 and 6.4? 
2. What's the best fix -- adding format specifier to
-data-evaluate-expression (note that -data-list-changed-registers and
-data-read-memory *do* allow format specifier), or fixing -var-set-format?

Thanks,
Volodya

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

* Re: MI: "print /c whatever"
  2006-01-30 13:32 MI: "print /c whatever" Vladimir Prus
@ 2006-02-06 23:42 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2006-02-06 23:42 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On Mon, Jan 30, 2006 at 01:49:32PM +0300, Vladimir Prus wrote:
> 
> Hi!
> It seems like MI has no command that's equivalent to "print /c whatever",
> that is, printing using character format.
> 
> The -data-evaluate-expression does not accept format specifier, and the
> -var-set-format does not allow to specify character format (that's with CVS
> code state).
> 
> So:
> 1. Can anybody suggest a workaround that works with gdb 6.3 and 6.4? 
> 2. What's the best fix -- adding format specifier to
> -data-evaluate-expression (note that -data-list-changed-registers and
> -data-read-memory *do* allow format specifier), or fixing -var-set-format?

I don't know - but adding "character" to -var-set-format might be a
solution.  Or, you can do this using the existing code:

-var-create foo * "(char) 1"
^done,name="foo",numchild="0",type="char"
(gdb)
-var-evaluate-expression foo
^done,value="1 '\\001'"
(gdb) 

The character format is a bit ambiguous, as we've discussed before, I
think; I'm not sure what should be done with it.

-- 
Daniel Jacobowitz
CodeSourcery

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

end of thread, other threads:[~2006-02-06 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-30 13:32 MI: "print /c whatever" Vladimir Prus
2006-02-06 23:42 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).