* [RFA] comment looks wrong...
@ 2009-10-28 19:31 Michael Snyder
2009-10-28 20:04 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2009-10-28 19:31 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
The comment in findvar about extract_*_integer looked wrong to me,
with respect to target vs. host. If I'm right, this is an improvement,
but if I'm confused, then so are these comments. ;-/
[-- Attachment #2: findvar.txt --]
[-- Type: text/plain, Size: 1166 bytes --]
2009-10-28 Michael Snyder <msnyder@vmware.com>
* findvar.c (top level): Fix and add comments.
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.126
diff -u -p -r1.126 findvar.c
--- findvar.c 2 Jul 2009 17:25:53 -0000 1.126
+++ findvar.c 28 Oct 2009 19:28:48 -0000
@@ -36,8 +36,9 @@
#include "block.h"
#include "objfiles.h"
-/* Basic byte-swapping routines. GDB has needed these for a long time...
- All extract a target-format integer at ADDR which is LEN bytes long. */
+/* Basic byte-swapping routines. GDB has needed these for a long
+ time... All 'extract' functions extract a host-format integer at
+ ADDR which is LEN bytes long. */
#if TARGET_CHAR_BIT != 8 || HOST_CHAR_BIT != 8
/* 8 bit characters are a pretty safe assumption these days, so we
@@ -179,6 +180,8 @@ extract_typed_address (const gdb_byte *b
return gdbarch_pointer_to_address (get_type_arch (type), type, buf);
}
+/* All 'store' functions store a target-format integer at ADDR
+ which is LEN bytes long. */
void
store_signed_integer (gdb_byte *addr, int len,
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] comment looks wrong...
2009-10-28 19:31 [RFA] comment looks wrong Michael Snyder
@ 2009-10-28 20:04 ` Daniel Jacobowitz
2009-11-01 18:28 ` Michael Snyder
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-10-28 20:04 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Wed, Oct 28, 2009 at 12:23:11PM -0700, Michael Snyder wrote:
> The comment in findvar about extract_*_integer looked wrong to me,
> with respect to target vs. host. If I'm right, this is an improvement,
> but if I'm confused, then so are these comments. ;-/
It's some subject/object fuzziness, I think.
> -/* Basic byte-swapping routines. GDB has needed these for a long time...
> - All extract a target-format integer at ADDR which is LEN bytes long. */
> +/* Basic byte-swapping routines. GDB has needed these for a long
> + time... All 'extract' functions extract a host-format integer at
> + ADDR which is LEN bytes long. */
Which do you extract - the value being read or the value being
returned? It means the value being read, which is in target format.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] comment looks wrong...
2009-10-28 20:04 ` Daniel Jacobowitz
@ 2009-11-01 18:28 ` Michael Snyder
2009-11-01 19:33 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2009-11-01 18:28 UTC (permalink / raw)
To: Michael Snyder, gdb-patches
Daniel Jacobowitz wrote:
> On Wed, Oct 28, 2009 at 12:23:11PM -0700, Michael Snyder wrote:
>> The comment in findvar about extract_*_integer looked wrong to me,
>> with respect to target vs. host. If I'm right, this is an improvement,
>> but if I'm confused, then so are these comments. ;-/
>
> It's some subject/object fuzziness, I think.
>
>> -/* Basic byte-swapping routines. GDB has needed these for a long time...
>> - All extract a target-format integer at ADDR which is LEN bytes long. */
>> +/* Basic byte-swapping routines. GDB has needed these for a long
>> + time... All 'extract' functions extract a host-format integer at
>> + ADDR which is LEN bytes long. */
>
> Which do you extract - the value being read or the value being
> returned? It means the value being read, which is in target format.
>
Does that mean you don't favor changing it?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] comment looks wrong...
2009-11-01 18:28 ` Michael Snyder
@ 2009-11-01 19:33 ` Daniel Jacobowitz
2009-11-01 20:37 ` Michael Snyder
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-11-01 19:33 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Sun, Nov 01, 2009 at 10:19:56AM -0800, Michael Snyder wrote:
> Does that mean you don't favor changing it?
Your new formulation uses the opposite meaning of extract to the one
presently there. If the old one was unclear, the new one is unclear
also...
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] comment looks wrong...
2009-11-01 19:33 ` Daniel Jacobowitz
@ 2009-11-01 20:37 ` Michael Snyder
2009-11-02 0:57 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2009-11-01 20:37 UTC (permalink / raw)
To: Michael Snyder, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
Daniel Jacobowitz wrote:
> On Sun, Nov 01, 2009 at 10:19:56AM -0800, Michael Snyder wrote:
>> Does that mean you don't favor changing it?
>
> Your new formulation uses the opposite meaning of extract to the one
> presently there. If the old one was unclear, the new one is unclear
> also...
>
Fair enough -- how's this?
[-- Attachment #2: findvar.txt --]
[-- Type: text/plain, Size: 1126 bytes --]
2009-10-28 Michael Snyder <msnyder@vmware.com>
* findvar.c (top level): Fix and add comments.
Index: gdb/findvar.c
===================================================================
--- gdb.orig/findvar.c 2009-10-28 12:33:28.000000000 -0700
+++ gdb/findvar.c 2009-11-01 12:37:26.000000000 -0800
@@ -36,8 +36,9 @@
#include "block.h"
#include "objfiles.h"
-/* Basic byte-swapping routines. GDB has needed these for a long time...
- All extract a target-format integer at ADDR which is LEN bytes long. */
+/* Basic byte-swapping routines. GDB has needed these for a long
+ time... All 'extract' functions return a host-format integer
+ from a target-format integer ADDR which is LEN bytes long. */
#if TARGET_CHAR_BIT != 8 || HOST_CHAR_BIT != 8
/* 8 bit characters are a pretty safe assumption these days, so we
@@ -179,6 +180,8 @@
return gdbarch_pointer_to_address (get_type_arch (type), type, buf);
}
+/* All 'store' functions accept a host-format integer and store a
+ target-format integer at ADDR which is LEN bytes long. */
void
store_signed_integer (gdb_byte *addr, int len,
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] comment looks wrong...
2009-11-01 20:37 ` Michael Snyder
@ 2009-11-02 0:57 ` Daniel Jacobowitz
2009-11-11 19:27 ` Michael Snyder
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-11-02 0:57 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Sun, Nov 01, 2009 at 12:38:06PM -0800, Michael Snyder wrote:
> +/* Basic byte-swapping routines. GDB has needed these for a long
> + time... All 'extract' functions return a host-format integer
> + from a target-format integer ADDR which is LEN bytes long. */
I suggest dropping the long time comment, and putting back the lost
"at":
/* Basic byte-swapping routines. All 'extract' functions return a
host-format integer from a target-format integer at ADDR which
is LEN bytes long. */
How's that?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] comment looks wrong...
2009-11-02 0:57 ` Daniel Jacobowitz
@ 2009-11-11 19:27 ` Michael Snyder
0 siblings, 0 replies; 7+ messages in thread
From: Michael Snyder @ 2009-11-11 19:27 UTC (permalink / raw)
To: Michael Snyder, gdb-patches
Daniel Jacobowitz wrote:
> On Sun, Nov 01, 2009 at 12:38:06PM -0800, Michael Snyder wrote:
>> +/* Basic byte-swapping routines. GDB has needed these for a long
>> + time... All 'extract' functions return a host-format integer
>> + from a target-format integer ADDR which is LEN bytes long. */
>
> I suggest dropping the long time comment, and putting back the lost
> "at":
>
> /* Basic byte-swapping routines. All 'extract' functions return a
> host-format integer from a target-format integer at ADDR which
> is LEN bytes long. */
>
>
> How's that?
Agreed and committed.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-11 19:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28 19:31 [RFA] comment looks wrong Michael Snyder
2009-10-28 20:04 ` Daniel Jacobowitz
2009-11-01 18:28 ` Michael Snyder
2009-11-01 19:33 ` Daniel Jacobowitz
2009-11-01 20:37 ` Michael Snyder
2009-11-02 0:57 ` Daniel Jacobowitz
2009-11-11 19:27 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox