diff options
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index af0a08a2c53..5c407b6bb9c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4335,6 +4335,7 @@ remote_check_symbols (void) struct remote_state *rs = get_remote_state (); char *msg, *reply, *tmp; int end; + long reply_size; struct cleanup *old_chain; /* The remote side has no concept of inferiors that aren't running @@ -4356,13 +4357,15 @@ remote_check_symbols (void) because we need both at the same time. */ msg = (char *) xmalloc (get_remote_packet_size ()); old_chain = make_cleanup (xfree, msg); + reply = (char *) xmalloc (get_remote_packet_size ()); + make_cleanup (free_current_contents, &reply); + reply_size = get_remote_packet_size (); /* Invite target to request symbol lookups. */ putpkt ("qSymbol::"); - getpkt (&rs->buf, &rs->buf_size, 0); - packet_ok (rs->buf, &remote_protocol_packets[PACKET_qSymbol]); - reply = rs->buf; + getpkt (&reply, &reply_size, 0); + packet_ok (reply, &remote_protocol_packets[PACKET_qSymbol]); while (startswith (reply, "qSymbol:")) { @@ -4390,8 +4393,7 @@ remote_check_symbols (void) } putpkt (msg); - getpkt (&rs->buf, &rs->buf_size, 0); - reply = rs->buf; + getpkt (&reply, &reply_size, 0); } do_cleanups (old_chain); |