* [rfa] Fix remote debugging
@ 2004-10-04 20:01 Daniel Jacobowitz
2004-10-05 19:49 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-10-04 20:01 UTC (permalink / raw)
To: cagney, gdb-patches
Your recent patch made it mandatory for any target which implements
to_xfer_partial to support TARGET_OBJECT_MEMORY, i.e. its
to_xfer_memory will be ignored. remote.c doesn't meet this new
requirement. I didn't check all the other targets with _partial
methods.
OK? Tested on i386-pc-linux-gnu using gdbserver. Brings test results
from unspeakable back to merely disappointing.
--
Daniel Jacobowitz
2004-10-04 Daniel Jacobowitz <dan@debian.org>
* remote.c (remote_xfer_partial): Handle TARGET_OBJECT_MEMORY.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.148
diff -u -p -r1.148 remote.c
--- remote.c 24 Sep 2004 19:51:18 -0000 1.148
+++ remote.c 4 Oct 2004 19:58:44 -0000
@@ -4864,6 +4864,31 @@ remote_xfer_partial (struct target_ops *
char *p2 = &buf2[0];
char query_type;
+ /* Handle memory using remote_xfer_memory. */
+ if (object == TARGET_OBJECT_MEMORY)
+ {
+ int xfered;
+ errno = 0;
+
+ if (writebuf != NULL)
+ {
+ void *buffer = xmalloc (len);
+ struct cleanup *cleanup = make_cleanup (xfree, buffer);
+ memcpy (buffer, writebuf, len);
+ xfered = remote_xfer_memory (offset, buffer, len, 1, NULL, ops);
+ do_cleanups (cleanup);
+ }
+ else
+ xfered = remote_xfer_memory (offset, readbuf, len, 0, NULL, ops);
+
+ if (xfered > 0)
+ return xfered;
+ else if (xfered == 0 && errno == 0)
+ return 0;
+ else
+ return -1;
+ }
+
/* Only handle reads. */
if (writebuf != NULL || readbuf == NULL)
return -1;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfa] Fix remote debugging
2004-10-04 20:01 [rfa] Fix remote debugging Daniel Jacobowitz
@ 2004-10-05 19:49 ` Andrew Cagney
2004-10-05 19:52 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-10-05 19:49 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> Your recent patch made it mandatory for any target which implements
> to_xfer_partial to support TARGET_OBJECT_MEMORY, i.e. its
> to_xfer_memory will be ignored. remote.c doesn't meet this new
> requirement. I didn't check all the other targets with _partial
> methods.
>
> OK? Tested on i386-pc-linux-gnu using gdbserver. Brings test results
> from unspeakable back to merely disappointing.
There's no gdbserver.exp unit test, wasn't one going to be added? (the
patch is ok)
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfa] Fix remote debugging
2004-10-05 19:49 ` Andrew Cagney
@ 2004-10-05 19:52 ` Daniel Jacobowitz
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-10-05 19:52 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Tue, Oct 05, 2004 at 03:49:07PM -0400, Andrew Cagney wrote:
> >Your recent patch made it mandatory for any target which implements
> >to_xfer_partial to support TARGET_OBJECT_MEMORY, i.e. its
> >to_xfer_memory will be ignored. remote.c doesn't meet this new
> >requirement. I didn't check all the other targets with _partial
> >methods.
> >
> >OK? Tested on i386-pc-linux-gnu using gdbserver. Brings test results
> >from unspeakable back to merely disappointing.
>
> There's no gdbserver.exp unit test, wasn't one going to be added? (the
> patch is ok)
I haven't had time to figure out how to do it yet. A DWARF testsuite
is higher on my priorities.
Checked in.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-10-05 19:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-04 20:01 [rfa] Fix remote debugging Daniel Jacobowitz
2004-10-05 19:49 ` Andrew Cagney
2004-10-05 19:52 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox