[RFC] output remote protocol timestamps with "set debug remote"
Pedro Alves
pedro@codesourcery.com
Wed Nov 19 14:07:00 GMT 2008
On Tuesday 18 November 2008 21:45:35, Daniel Jacobowitz wrote:
> On Fri, Nov 14, 2008 at 06:50:28PM +0000, Pedro Alves wrote:
> > I'm making use of this:
> >
> > /* Debugging level. 0 is off, and non-zero values mean to print some debug
> > information (higher values, more information). */
> > extern int remote_debug;
> >
> > ... to enable timestamps, you do "set debug remote 2". level 1
> > still outputs the same as usual.
>
> It's such a good idea, that it's already there :-) "set debug
> timestamp". However, I'd never tried it with remote; it clearly
> does not work right for multiple printf calls in a single debugging
> message. I'd suggest fixing that, instead.
Ah, sneaky! I missed that going in.
> 1227044669:904148 Sending packet: 1227044669:904155 $1227044669:904161
> q1227044669:904166 S1227044669:904172 y1227044669:904177
> m1227044669:904182 b1227044669:904188 o1227044669:904193
> l1227044669:904198 :1227044669:904205 :1227044669:904211
> #1227044669:904217 51227044669:904222 b1227044669:904228
> ...1227044669:904279 Ack
That attached patch make two changes to address this.
1) Makes sure that timestamped output always ends with a newline, so we
get this,
un-timestamped, like before, unchanged:
Sending packet: $m80484d1,1#67... Packet received: 51
and timestamped:
1227058218:708583 Sending packet: $m80484d1,1#67...
1227058218:708675 Packet received: 51
[ If other output other than gdb_stdlog is mixed, then you still
don't have the nice alignment, but, that doesn't seem as bad. ]
2) Makes sure a single fprintf_unfiltered is used to dump a packet,
so we get a single timestamp for a packet, unlike your output
above, where there's one timestamp per octet (that's from
fputstrn_unfiltered ending up on fprintf_unfiltered once
per char).
Something like this?
(I'm running it through the testsuite against gdbserver with
"set debug remote 1"/"set debug timestamp" just in case).
--
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remote_timestamps.diff
Type: text/x-diff
Size: 5520 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20081119/50431a7a/attachment.bin>
More information about the Gdb-patches
mailing list