aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2013-07-24 16:20:12 +0000
committerLuis Machado <luisgpm@br.ibm.com>2013-07-24 16:20:12 +0000
commit3360c0bf75c98188a29b2ea29183a0bdc33b5801 (patch)
tree0a1144597538d9f9a1b9c4fca782944bbb8c7128 /gdb/gdbserver/server.c
parent7e8b059be6b6b97b611b034e90f576c1479bdf75 (diff)
downloadgdb-3360c0bf75c98188a29b2ea29183a0bdc33b5801.zip
gdb-3360c0bf75c98188a29b2ea29183a0bdc33b5801.tar.gz
gdb-3360c0bf75c98188a29b2ea29183a0bdc33b5801.tar.bz2
gdb/
* Makefile.in (SFILES): Add common/target-common.c. Add common/target-common.h to headers. (COMMON_OBS): Add target-common.o. (target-common.o): New target. * linux-nat.h (resume_kind): Move to common/target-common.h. * target.c (target_waitstatus_to_string): Move to common/target-common.c. * target.h: Include target-common.h. (target_waitkind): Move to common/target-common.h. (target_waitstatus): Likewise. (TARGET_WNOHANG): Likewise. * common/target-common.c: New file. * common/target-common.h: New file. gdb/gdbserver/ * Makefile.in (SFILES): /common/target-common.c. (OBS): Add target-common.o. (server_h): Add $(srcdir)/../common/target-common.h. (target-common.o): New target. * server.c (queue_stop_reply_callback): Free status string after use. * target.c (target_waitstatus_to_string): Remove. * target.h: Include target-common.h. (resume_kind): Likewise. (target_waitkind): Likewise. (target_waitstatus): Likewise. (TARGET_WNOHANG): Likewise.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index a172c98..a4b9129 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2470,10 +2470,17 @@ queue_stop_reply_callback (struct inferior_list_entry *entry, void *arg)
if (thread_stopped (thread))
{
if (debug_threads)
- fprintf (stderr,
- "Reporting thread %s as already stopped with %s\n",
- target_pid_to_str (entry->id),
- target_waitstatus_to_string (&thread->last_status));
+ {
+ char *status_string
+ = target_waitstatus_to_string (&thread->last_status);
+
+ fprintf (stderr,
+ "Reporting thread %s as already stopped with %s\n",
+ target_pid_to_str (entry->id),
+ status_string);
+
+ xfree (status_string);
+ }
gdb_assert (thread->last_status.kind != TARGET_WAITKIND_IGNORE);