From 7718cbcbf47164ddaa66a748a050f670b3b37e1d Mon Sep 17 00:00:00 2001 From: attilio Date: Mon, 22 Nov 2010 14:42:13 +0000 Subject: Add the ability for GDB to printout the thread name along with other thread specific informations. In order to do that, and in order to avoid KBI breakage with existing infrastructure the following semantic is implemented: - For live programs, a new member to the PT_LWPINFO is added (pl_tdname) - For cores, a new ELF note is added (NT_THRMISC) that can be used for storing thread specific, miscellaneous, informations. Right now it is just popluated with a thread name. GDB, then, retrieves the correct informations from the corefile via the BFD interface, as it groks the ELF notes and create appropriate pseudo-sections. Sponsored by: Sandvine Incorporated Tested by: gianni Discussed with: dim, kan, kib MFC after: 2 weeks --- contrib/gdb/gdb/fbsd-proc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'contrib/gdb') diff --git a/contrib/gdb/gdb/fbsd-proc.c b/contrib/gdb/gdb/fbsd-proc.c index 16813a9..b2dbd5d 100644 --- a/contrib/gdb/gdb/fbsd-proc.c +++ b/contrib/gdb/gdb/fbsd-proc.c @@ -124,6 +124,7 @@ fbsd_make_corefile_notes (bfd *obfd, int *note_size) fpregset_t fpregs; char *note_data = NULL; Elf_Internal_Ehdr *i_ehdrp; + char fakename; /* Put a "FreeBSD" label in the ELF header. */ i_ehdrp = elf_elfheader (obfd); @@ -138,6 +139,10 @@ fbsd_make_corefile_notes (bfd *obfd, int *note_size) note_data = elfcore_write_prfpreg (obfd, note_data, note_size, &fpregs, sizeof (fpregs)); + fakename = '\0'; + note_data = elfcore_write_thrmisc (obfd, note_data, note_size, + &fakename, sizeof (fakename)); + if (get_exec_file (0)) { char *fname = strrchr (get_exec_file (0), '/') + 1; -- cgit v1.1