aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-02-01 22:35:15 +0000
committerRoland McGrath <roland@gnu.org>2004-02-01 22:35:15 +0000
commitcbb685f35a8a7b238164ad66a4825df789c5c11e (patch)
tree1efe0baaa785fc427a1316942520bdb1b5be9362 /gdb
parent4e73f23d286f84c0c80f6302baaae5d92a1fe031 (diff)
downloadgdb-cbb685f35a8a7b238164ad66a4825df789c5c11e.zip
gdb-cbb685f35a8a7b238164ad66a4825df789c5c11e.tar.gz
gdb-cbb685f35a8a7b238164ad66a4825df789c5c11e.tar.bz2
2004-01-28 Roland McGrath <roland@redhat.com>
* procfs.c (procfs_make_note_section): If we can read TARGET_OBJECT_AUXV data, add an NT_AUXV note containing it. * linux-proc.c (linux_make_note_section): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/linux-proc.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index 22dc93d..0a77459 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -208,7 +208,7 @@ struct linux_corefile_thread_data
};
/* Function: linux_corefile_thread_callback
- *
+ *
* Called by gdbthread.c once per thread.
* Records the thread's register state for the corefile note section.
*/
@@ -221,7 +221,7 @@ linux_corefile_thread_callback (struct lwp_info *ti, void *data)
inferior_ptid = ti->ptid;
registers_changed ();
- target_fetch_registers (-1); /* FIXME should not be necessary;
+ target_fetch_registers (-1); /* FIXME should not be necessary;
fill_gregset should do it automatically. */
args->note_data = linux_do_thread_registers (args->obfd,
ti->ptid,
@@ -230,13 +230,13 @@ linux_corefile_thread_callback (struct lwp_info *ti, void *data)
args->num_notes++;
inferior_ptid = saved_ptid;
registers_changed ();
- target_fetch_registers (-1); /* FIXME should not be necessary;
+ target_fetch_registers (-1); /* FIXME should not be necessary;
fill_gregset should do it automatically. */
return 0;
}
/* Function: linux_do_registers
- *
+ *
* Records the register state for the corefile note section.
*/
@@ -245,7 +245,7 @@ linux_do_registers (bfd *obfd, ptid_t ptid,
char *note_data, int *note_size)
{
registers_changed ();
- target_fetch_registers (-1); /* FIXME should not be necessary;
+ target_fetch_registers (-1); /* FIXME should not be necessary;
fill_gregset should do it automatically. */
return linux_do_thread_registers (obfd,
ptid_build (ptid_get_pid (inferior_ptid),
@@ -258,8 +258,8 @@ linux_do_registers (bfd *obfd, ptid_t ptid,
/* Function: linux_make_note_section
*
* Fills the "to_make_corefile_note" target vector.
- * Builds the note section for a corefile, and returns it
- * in a malloc buffer.
+ * Builds the note section for a corefile, and returns it
+ * in a malloc buffer.
*/
static char *
@@ -271,6 +271,8 @@ linux_make_note_section (bfd *obfd, int *note_size)
char psargs[80] = { '\0' };
char *note_data = NULL;
ptid_t current_ptid = inferior_ptid;
+ char *auxv;
+ int auxv_len;
if (get_exec_file (0))
{
@@ -305,6 +307,14 @@ linux_make_note_section (bfd *obfd, int *note_size)
note_data = thread_args.note_data;
}
+ auxv_len = target_auxv_read (&current_target, &auxv);
+ if (auxv_len > 0)
+ {
+ note_data = elfcore_write_note (obfd, note_data, note_size,
+ "CORE", NT_AUXV, auxv, auxv_len);
+ xfree (auxv);
+ }
+
make_cleanup (xfree, note_data);
return note_data;
}
@@ -564,7 +574,7 @@ linux_info_proc_cmd (char *args, int from_tty)
printf_filtered ("End of text: 0x%x\n", itmp);
if (fscanf (procfile, "%u ", &itmp) > 0)
printf_filtered ("Start of stack: 0x%x\n", itmp);
-#if 0 /* Don't know how architecture-dependent the rest is...
+#if 0 /* Don't know how architecture-dependent the rest is...
Anyway the signal bitmap info is available from "status". */
if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */
printf_filtered ("Kernel stack pointer: 0x%x\n", itmp);