From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Stan Shebs Cc: gdb-patches@sourceware.cygnus.com Subject: Re: (patch) hpjyg15: hppah-nat.c & related Date: Thu, 11 Nov 1999 17:13:00 -0000 Message-id: <991112011245.ZM3290@ocotillo.lan> References: <199911120046.QAA29304@andros.cygnus.com> X-SW-Source: 1999-q4/msg00246.html On Nov 11, 4:46pm, Stan Shebs wrote: > I've seen some inconsistent behavior from indent, and was planning to > investigate further one of these days. Nothing to get too excited > about, the oddities amounting to about ~100 in 400K lines of code, > but good to be aware of. diff -w is useful for separating out the > "real" diffs from the uninteresting ones. The output of indent should be idempotent wrt indent; i.e, if you run indent on the output of a previous indent run, you should get the same output from the second run of indent. E.g, indent foo.c cp foo.c foo1.c indent foo1.c diff foo.c foo1.c The diff at the end should show no changes. Unfortunately, this is not the case. In particular, indent seems to want to move comments around and add/delete whitespace from the ends of lines. I used to have some patches (for a much older version of indent) that fixed many of these problems at least for the code that I was indenting at the time. If there is sufficient interest, I can rumage around on my backup tapes to see if I can find these patches. Kevin >From kevinb@cygnus.com Fri Nov 12 10:42:00 1999 From: Kevin Buettner To: cagney@cygnus.com Cc: gdb-patches@sourceware.cygnus.com Subject: RFA: PACKET_OVERHEAD constant added to remote.c Date: Fri, 12 Nov 1999 10:42:00 -0000 Message-id: <991112184146.ZM22052@ocotillo.lan> X-SW-Source: 1999-q4/msg00247.html Content-length: 2427 Hi Andrew, Jesper Skov alerted me to the fact that we were getting some "Remote packet too long" messages when attempting to debug using a gdbserver for i386 linux. The problem was that the memory packet size computations were not taking into account the packet overhead. This would've been a one line fix, but I decided to define PACKET_OVERHEAD instead of adding another hard-coded instance of the constant 32. Kevin * remote.c (PACKET_OVERHEAD): Define. (get_memory_packet_size): Take PACKET_OVERHEAD into account when computing memory packet size. (build_remote_packet_sizes): Use PACKET_OVERHEAD instead of hard-coded constants. Index: remote.c =================================================================== RCS file: /cvs/cvsfiles/devo/gdb/remote.c,v retrieving revision 1.258 diff -u -r1.258 remote.c --- remote.c 1999/11/08 13:14:17 1.258 +++ remote.c 1999/11/12 17:57:13 @@ -315,6 +315,11 @@ /* compatibility. */ #define PBUFSIZ (remote_packet_size) +/* Overhead for packet header / footer. NOTE: cagney/1999-10-26: I suspect + that 8 (``$NN:G...#NN'') is a better guess, the below has been padded a + little. */ +#define PACKET_OVERHEAD 32 + /* User configurable variables for the number of characters in a memory read/write packet. MIN (PBUFSIZ, g-packet-size) is the default. Some targets need smaller values (fifo overruns, et.al.) @@ -358,7 +363,7 @@ } else { - what_they_get = remote_packet_size; + what_they_get = remote_packet_size - PACKET_OVERHEAD; /* Limit the packet to the size specified by the user. */ if (config->size > 0 && what_they_get > config->size) @@ -502,12 +507,9 @@ remote_packet_size = 400; /* Should REGISTER_BYTES needs more space than the default, adjust the size accordingly. Remember that each byte is encoded as two - characters. 32 is the overhead for the packet header / - footer. NOTE: cagney/1999-10-26: I suspect that 8 - (``$NN:G...#NN'') is a better guess, the below has been padded a - little. */ - if (REGISTER_BYTES > ((remote_packet_size - 32) / 2)) - remote_packet_size = (REGISTER_BYTES * 2 + 32); + characters. */ + if (REGISTER_BYTES > ((remote_packet_size - PACKET_OVERHEAD) / 2)) + remote_packet_size = (REGISTER_BYTES * 2 + PACKET_OVERHEAD); /* This one is filled in when a ``g'' packet is received. */ actual_register_packet_size = 0;