aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-11-30 00:50:36 +0000
committerAlan Modra <amodra@gmail.com>2004-11-30 00:50:36 +0000
commitedfc032f0a744b3e42dab52ca7161073c9dd54ed (patch)
tree102d5557bac9b1743a4315e25790a373f2670aee
parent2af8501f61b7b05d63dba33b6663e4c7da3ae10c (diff)
downloadgdb-edfc032f0a744b3e42dab52ca7161073c9dd54ed.zip
gdb-edfc032f0a744b3e42dab52ca7161073c9dd54ed.tar.gz
gdb-edfc032f0a744b3e42dab52ca7161073c9dd54ed.tar.bz2
* elf32-hppa.c (elf32_hppa_grok_prstatus): New function.
(elf32_hppa_grok_psinfo): New function. (elf_backend_grok_prstatus): Define. (elf_backend_grok_psinfo): Define.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-hppa.c63
2 files changed, 70 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2ba9b4e..5fe9ae6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-30 Randolph Chung <tausq@debian.org>
+
+ * elf32-hppa.c (elf32_hppa_grok_prstatus): New function.
+ (elf32_hppa_grok_psinfo): New function.
+ (elf_backend_grok_prstatus): Define.
+ (elf_backend_grok_psinfo): Define.
+
2004-11-24 H.J. Lu <hongjiu.lu@intel.com>
PR 574:
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 00fd990..4d43cb9 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1600,6 +1600,67 @@ elf32_hppa_gc_sweep_hook (bfd *abfd,
return TRUE;
}
+/* Support for core dump NOTE sections. */
+
+static bfd_boolean
+elf32_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+{
+ int offset;
+ size_t size;
+
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 396: /* Linux/hppa */
+ /* pr_cursig */
+ elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+
+ /* pr_pid */
+ elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
+
+ /* pr_reg */
+ offset = 72;
+ size = 320;
+
+ break;
+ }
+
+ /* Make a ".reg/999" section. */
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+ size, note->descpos + offset);
+}
+
+static bfd_boolean
+elf32_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 124: /* Linux/hppa elf_prpsinfo. */
+ elf_tdata (abfd)->core_program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
+ elf_tdata (abfd)->core_command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
+ }
+
+ /* Note that for some reason, a spurious space is tacked
+ onto the end of the args in some (at least one anyway)
+ implementations, so strip it off if it exists. */
+ {
+ char *command = elf_tdata (abfd)->core_command;
+ int n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+ }
+
+ return TRUE;
+}
+
/* Our own version of hide_symbol, so that we can keep plt entries for
plabels. */
@@ -4165,6 +4226,8 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections
#define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook
#define elf_backend_gc_sweep_hook elf32_hppa_gc_sweep_hook
+#define elf_backend_grok_prstatus elf32_hppa_grok_prstatus
+#define elf_backend_grok_psinfo elf32_hppa_grok_psinfo
#define elf_backend_object_p elf32_hppa_object_p
#define elf_backend_final_write_processing elf_hppa_final_write_processing
#define elf_backend_post_process_headers elf32_hppa_post_process_headers