diff options
author | Roland McGrath <roland@gnu.org> | 2004-02-25 20:41:29 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2004-02-25 20:41:29 +0000 |
commit | aa691b87c2317cc90bbe4964d79e5a29c29f348e (patch) | |
tree | 3148fc04a3808796f45d697c37aa827f71830170 /gdb/gdbserver/server.c | |
parent | 802188a76ca9ff156990952648232e279aa157b9 (diff) | |
download | gdb-aa691b87c2317cc90bbe4964d79e5a29c29f348e.zip gdb-aa691b87c2317cc90bbe4964d79e5a29c29f348e.tar.gz gdb-aa691b87c2317cc90bbe4964d79e5a29c29f348e.tar.bz2 |
2004-02-25 Roland McGrath <roland@redhat.com>
* target.h (struct target_ops): New member `read_auxv'.
* server.c (handle_query): Handle qPart:auxv:read: query using that.
* linux-low.c (linux_read_auxv): New function.
(linux_target_ops): Initialize `read_auxv' member to that.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r-- | gdb/gdbserver/server.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index dffff2e..b45b3f3 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -104,7 +104,7 @@ handle_query (char *own_buf) thread_ptr = thread_ptr->next; return; } - + if (strcmp ("qsThreadInfo", own_buf) == 0) { if (thread_ptr != NULL) @@ -119,7 +119,27 @@ handle_query (char *own_buf) return; } } - + + if (the_target->read_auxv != NULL + && strncmp ("qPart:auxv:read::", own_buf, 17) == 0) + { + char data[(PBUFSIZ - 1) / 2]; + CORE_ADDR ofs; + unsigned int len; + int n; + decode_m_packet (&own_buf[17], &ofs, &len); /* "OFS,LEN" */ + if (len > sizeof data) + len = sizeof data; + n = (*the_target->read_auxv) (ofs, data, len); + if (n == 0) + write_ok (own_buf); + else if (n < 0) + write_enn (own_buf); + else + convert_int_to_ascii (data, own_buf, n); + return; + } + /* Otherwise we didn't know what packet it was. Say we didn't understand it. */ own_buf[0] = 0; @@ -371,7 +391,7 @@ main (int argc, char *argv[]) detach_inferior (); write_ok (own_buf); putpkt (own_buf); - remote_close (); + remote_close (); /* If we are attached, then we can exit. Otherwise, we need to hang around doing nothing, until the child is gone. */ |