* [OB] comment fix, corelow.c
@ 2008-01-16 1:17 Michael Snyder
2008-01-16 14:04 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2008-01-16 1:17 UTC (permalink / raw)
To: gdb-patches
cut and paste botch...
2008-01-15 Michael Snyder <msnyder@specifix.com>
* corelow.c (core_xfer_partial): Comment, cut/paste error.
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.71
diff -u -p -r1.71 corelow.c
--- corelow.c 1 Jan 2008 22:53:09 -0000 1.71
+++ corelow.c 16 Jan 2008 01:15:28 -0000
@@ -520,7 +520,7 @@ core_xfer_partial (struct target_ops *op
case TARGET_OBJECT_MEMORY:
if (readbuf)
return (*ops->deprecated_xfer_memory) (offset, readbuf,
- len, 0/*write*/, NULL, ops);
+ len, 0/*read*/, NULL, ops);
if (writebuf)
return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf,
len, 1/*write*/, NULL, ops);
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [OB] comment fix, corelow.c 2008-01-16 1:17 [OB] comment fix, corelow.c Michael Snyder @ 2008-01-16 14:04 ` Daniel Jacobowitz 2008-01-16 22:12 ` Michael Snyder 0 siblings, 1 reply; 5+ messages in thread From: Daniel Jacobowitz @ 2008-01-16 14:04 UTC (permalink / raw) To: Michael Snyder; +Cc: gdb-patches On Tue, Jan 15, 2008 at 05:16:58PM -0800, Michael Snyder wrote: > cut and paste botch... FYI, no objection, but I think it was right the way it was too... > return (*ops->deprecated_xfer_memory) (offset, readbuf, > - len, 0/*write*/, NULL, ops); > + len, 0/*read*/, NULL, ops); The value of the parameter is 0, and its name was write. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OB] comment fix, corelow.c 2008-01-16 14:04 ` Daniel Jacobowitz @ 2008-01-16 22:12 ` Michael Snyder 2008-01-16 22:20 ` Mark Kettenis 0 siblings, 1 reply; 5+ messages in thread From: Michael Snyder @ 2008-01-16 22:12 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb-patches On Wed, 2008-01-16 at 09:04 -0500, Daniel Jacobowitz wrote: > On Tue, Jan 15, 2008 at 05:16:58PM -0800, Michael Snyder wrote: > > cut and paste botch... > > FYI, no objection, but I think it was right the way it was too... > > > return (*ops->deprecated_xfer_memory) (offset, readbuf, > > - len, 0/*write*/, NULL, ops); > > + len, 0/*read*/, NULL, ops); > > The value of the parameter is 0, and its name was write. I don't think the comment refers to the name of the parameter. If you look, there are two adjacent calls to xfer_memory: if (readbuf) return (*ops->deprecated_xfer_memory) (offset, readbuf, len, 0/*read*/, NULL, ops); if (writebuf) return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf, len, 1/*write*/, NULL, ops); One call is a read, the other is a write. None of the other parameters have their names in a comment. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OB] comment fix, corelow.c 2008-01-16 22:12 ` Michael Snyder @ 2008-01-16 22:20 ` Mark Kettenis 2008-01-16 22:30 ` Michael Snyder 0 siblings, 1 reply; 5+ messages in thread From: Mark Kettenis @ 2008-01-16 22:20 UTC (permalink / raw) To: msnyder; +Cc: drow, gdb-patches > From: Michael Snyder <msnyder@specifix.com> > Date: Wed, 16 Jan 2008 14:11:42 -0800 > > On Wed, 2008-01-16 at 09:04 -0500, Daniel Jacobowitz wrote: > > On Tue, Jan 15, 2008 at 05:16:58PM -0800, Michael Snyder wrote: > > > cut and paste botch... > > > > FYI, no objection, but I think it was right the way it was too... > > > > > return (*ops->deprecated_xfer_memory) (offset, readbuf, > > > - len, 0/*write*/, NULL, ops); > > > + len, 0/*read*/, NULL, ops); > > > > The value of the parameter is 0, and its name was write. > > I don't think the comment refers to the name of the parameter. > > If you look, there are two adjacent calls to xfer_memory: > > if (readbuf) > return (*ops->deprecated_xfer_memory) (offset, readbuf, > len, 0/*read*/, NULL, ops); > if (writebuf) > return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf, > len, 1/*write*/, NULL, ops); > > One call is a read, the other is a write. > > None of the other parameters have their names in a comment. And if you ask me having those comments is silly in the first place. It's much better to have appropriate #defines and use those instead. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OB] comment fix, corelow.c 2008-01-16 22:20 ` Mark Kettenis @ 2008-01-16 22:30 ` Michael Snyder 0 siblings, 0 replies; 5+ messages in thread From: Michael Snyder @ 2008-01-16 22:30 UTC (permalink / raw) To: Mark Kettenis; +Cc: drow, gdb-patches On Wed, 2008-01-16 at 23:19 +0100, Mark Kettenis wrote: > > From: Michael Snyder <msnyder@specifix.com> > > Date: Wed, 16 Jan 2008 14:11:42 -0800 > > > > On Wed, 2008-01-16 at 09:04 -0500, Daniel Jacobowitz wrote: > > > On Tue, Jan 15, 2008 at 05:16:58PM -0800, Michael Snyder wrote: > > > > cut and paste botch... > > > > > > FYI, no objection, but I think it was right the way it was too... > > > > > > > return (*ops->deprecated_xfer_memory) (offset, readbuf, > > > > - len, 0/*write*/, NULL, ops); > > > > + len, 0/*read*/, NULL, ops); > > > > > > The value of the parameter is 0, and its name was write. > > > > I don't think the comment refers to the name of the parameter. > > > > If you look, there are two adjacent calls to xfer_memory: > > > > if (readbuf) > > return (*ops->deprecated_xfer_memory) (offset, readbuf, > > len, 0/*read*/, NULL, ops); > > if (writebuf) > > return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf, > > len, 1/*write*/, NULL, ops); > > > > One call is a read, the other is a write. > > > > None of the other parameters have their names in a comment. > > And if you ask me having those comments is silly in the first place. > It's much better to have appropriate #defines and use those instead. Right. The comments are in lieu of constants. But by fixing the comment, I did not necessarily volunteer to fix the lack of constants. ;-) ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-16 22:30 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-01-16 1:17 [OB] comment fix, corelow.c Michael Snyder 2008-01-16 14:04 ` Daniel Jacobowitz 2008-01-16 22:12 ` Michael Snyder 2008-01-16 22:20 ` Mark Kettenis 2008-01-16 22:30 ` Michael Snyder
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox