Protocol Buffers and pretty print

15,712 views
Skip to first unread message

Saptarshi

unread,
Aug 22, 2009, 12:06:57 AM8/22/09
to Protocol Buffers
Hello,
I'm new to using Protocol Buffers and am debugging my program.
Is there a way to pretty print a Message? (I'm new to C++ too and have
tried reading the API but probably missed it).

Also if stepping through GDB and given
REXP *rxp = new REXP();
..
rxp filled in
...

how can i do something like :

print(rxp)
in gdb to get the contents?

Thank you
Saptarshi

Saptarshi

unread,
Aug 22, 2009, 12:20:57 AM8/22/09
to Protocol Buffers

Kenton Varda

unread,
Aug 22, 2009, 2:08:39 PM8/22/09
to Saptarshi, Protocol Buffers
message->DebugString() is a shortcut that returns a string representation of the message.

Saptarshi

unread,
Aug 23, 2009, 1:48:51 AM8/23/09
to Protocol Buffers
This was exactly what I needed. Much thanks.


On Aug 22, 2:08 pm, Kenton Varda <ken...@google.com> wrote:
> message->DebugString() is a shortcut that returns a string representation of
> the message.
>
Reply all
Reply to author
Forward
0 new messages