diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-03-12 14:03:26 +0100 |
---|---|---|
committer | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-03-30 01:51:06 +0200 |
commit | 28170b88cc8b40fdea2b065dafe6e1872a47ee4e (patch) | |
tree | cb05b89e30b424c98961d3e3eb13e63f29055484 /gdb/gdbserver/server.c | |
parent | a08b52b5c45195c0b095215f19422d2ab67a3a8d (diff) | |
download | gdb-28170b88cc8b40fdea2b065dafe6e1872a47ee4e.zip gdb-28170b88cc8b40fdea2b065dafe6e1872a47ee4e.tar.gz gdb-28170b88cc8b40fdea2b065dafe6e1872a47ee4e.tar.bz2 |
gdbserver: Handle 'v' packet while processing qSymbol.
On powerpc64, qSymbol query may require gdb to read a function
descriptor, sending a vFile packet to gdbserver. Thus, we need
to handle 'v' packet in look_up_one_symbol.
vFile replies may be quite long, and require reallocating own_buf.
Since handle_v_requests assumes the buffer is the static global own_buf
from server.c and reallocates it, we need to make own_buf global and
use it from look_up_one_symbol instead of using our own auto variable.
I've also done the same change in relocate_instruction, just in case.
On gdb side, in remote_check_symbols, rs->buf may be clobbered by vFile
handling, yet we need its contents for the reply (the symbol name is
stored there). Allocate a new buffer instead.
This broke fast tracepoints on powerpc64, due to errors in reading IPA
symbols.
gdb/ChangeLog:
* remote.c (remote_check_symbols): Allocate own buffer for reply.
gdbserver/ChangeLog:
* remote-utils.c (look_up_one_symbol): Remove own_buf, handle 'v'
packets.
(relocate_instruction): Remove own_buf.
* server.c (own_buf): Make global.
(handle_v_requests): Make global.
* server.h (own_buf): New declaration.
(handle_v_requests): New prototype.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r-- | gdb/gdbserver/server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index ef715e7..9c50929 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -119,7 +119,7 @@ int disable_packet_qfThreadInfo; static struct target_waitstatus last_status; static ptid_t last_ptid; -static char *own_buf; +char *own_buf; static unsigned char *mem_buf; /* A sub-class of 'struct notif_event' for stop, holding information @@ -2935,7 +2935,7 @@ handle_v_kill (char *own_buf) } /* Handle all of the extended 'v' packets. */ -static void +void handle_v_requests (char *own_buf, int packet_len, int *new_packet_len) { if (!disable_packet_vCont) |