aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-tdep.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-08-04 15:27:57 +0000
committerPedro Alves <palves@redhat.com>2010-08-04 15:27:57 +0000
commita5ee0f0c4d286ed3437ded51e904016b1e26209d (patch)
tree81658c57500656e4ac8a7e512273314d617ed930 /gdb/linux-tdep.c
parent1bed7b84a23fddaa0317904cf9f8f73b6da97274 (diff)
downloadgdb-a5ee0f0c4d286ed3437ded51e904016b1e26209d.zip
gdb-a5ee0f0c4d286ed3437ded51e904016b1e26209d.tar.gz
gdb-a5ee0f0c4d286ed3437ded51e904016b1e26209d.tar.bz2
* corelow.c (core_pid_to_str): Default to using normal_pid_to_str
instead of printing "Thread" here. * linux-tdep.c: Include inferior.h. (linux_core_pid_to_str): New. (linux_init_abi): New. * linux-tdep.h (linux_init_abi): Declare. * alpha-linux-tdep.c: Include linux-tdep.h. (alpha_linux_init_abi): Call linux_init_abi. * amd64-linux-tdep.c (amd64_linux_init_abi): Call linux_init_abi. * arm-linux-tdep.c (arm_linux_init_abi): Call linux_init_abi. * frv-linux-tdep.c: Include linux-tdep.h (frv_linux_init_abi): Call linux_init_abi. * hppa-linux-tdep.c: Include linux-tdep.h (hppa_linux_init_abi): Call linux_init_abi. * i386-linux-tdep.c (i386_linux_init_abi): Call linux_init_abi. * ia64-linux-tdep.c: Include linux-tdep.h. (ia64_linux_init_abi): Call linux_init_abi. * m32r-linux-tdep.c: Include linux-tdep.h. (m32r_linux_init_abi): Call linux_init_abi. * m68klinux-tdep.c: Include linux-tdep.h. (m68k_linux_init_abi): Call linux_init_abi. * microblaze-linux-tdep.c: Include linux-tdep.h. (microblaze_linux_init_abi): Call linux_init_abi. * mips-linux-tdep.c: Include linux-tdep.h. (mips_linux_init_abi): Call linux_init_abi. * mn10300-linux-tdep.c: Include linux-tdep.h. (am33_linux_init_osabi): Call linux_init_abi. Rename the 'gdbinfo' parameter to 'info'. * ppc-linux-tdep.c: Include linux-tdep.h. (ppc_linux_init_abi): Call linux_init_abi. * sh-linux-tdep.c: Include linux-tdep.h. (sh_linux_init_abi): Call linux_init_abi. * sparc-linux-tdep.c: Include linux-tdep.h. (sparc32_linux_init_abi): Call linux_init_abi. * sparc64-linux-tdep.c: Include linux-tdep.h. (sparc64_linux_init_abi): Call linux_init_abi. * xtensa-linux-tdep.c: Include linux-tdep.h. (xtensa_linux_init_abi): Call linux_init_abi. * i386-cygwin-tdep.c (i386_windows_core_pid_to_str): New. (i386_cygwin_init_abi): Install it as gdbarch_core_pid_to_str callback.
Diffstat (limited to 'gdb/linux-tdep.c')
-rw-r--r--gdb/linux-tdep.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 07fd67c..004451e 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -23,6 +23,7 @@
#include "auxv.h"
#include "target.h"
#include "elf/common.h"
+#include "inferior.h"
/* This function is suitable for architectures that don't
extend/override the standard siginfo structure. */
@@ -152,3 +153,28 @@ linux_has_shared_address_space (void)
return target_is_uclinux;
}
+
+/* This is how we want PTIDs from core files to be printed. */
+
+static char *
+linux_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
+{
+ static char buf[80];
+
+ if (ptid_get_lwp (ptid) != 0)
+ {
+ snprintf (buf, sizeof (buf), "LWP %ld", ptid_get_lwp (ptid));
+ return buf;
+ }
+
+ return normal_pid_to_str (ptid);
+}
+
+/* To be called from the various GDB_OSABI_LINUX handlers for the
+ various GNU/Linux architectures and machine types. */
+
+void
+linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ set_gdbarch_core_pid_to_str (gdbarch, linux_core_pid_to_str);
+}