aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-08-23 19:06:05 +0000
committerMark Kettenis <kettenis@gnu.org>2002-08-23 19:06:05 +0000
commit8acc2935383b05b6ae4626dac433883c21381cfb (patch)
treeca5473eb3fe6d9a3fc7c046eff2d941a8c0babe2 /gdb
parentfcf6238032a40bcc93e500a53d1e88abe339d1a9 (diff)
downloadfsf-binutils-gdb-8acc2935383b05b6ae4626dac433883c21381cfb.zip
fsf-binutils-gdb-8acc2935383b05b6ae4626dac433883c21381cfb.tar.gz
fsf-binutils-gdb-8acc2935383b05b6ae4626dac433883c21381cfb.tar.bz2
* linux-proc.c (struct linux_corefile_thread_data): Add num_notes
member. (linux_corefile_thread_callback): Increase args->num_notes. (linux_make_note_section): Initialize thread_args.num_notes, and use it to determine whether notes for any threads were created.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/linux-proc.c14
2 files changed, 17 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7b55f3e..9532614 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2002-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * linux-proc.c (struct linux_corefile_thread_data): Add num_notes
+ member.
+ (linux_corefile_thread_callback): Increase args->num_notes.
+ (linux_make_note_section): Initialize thread_args.num_notes, and
+ use it to determine whether notes for any threads were created.
+
2002-08-23 Donn Terry <dterry@microsoft.com>
* proc-api.c (rw_table): Do not include a row for PCDSTOP if the
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index c66df98..f76def3 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -198,10 +198,12 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid,
return note_data;
}
-struct linux_corefile_thread_data {
- bfd *obfd;
+struct linux_corefile_thread_data
+{
+ bfd *obfd;
char *note_data;
- int *note_size;
+ int *note_size;
+ int num_notes;
};
/* Function: linux_corefile_thread_callback
@@ -224,6 +226,7 @@ linux_corefile_thread_callback (struct thread_info *ti, void *data)
ti->ptid,
args->note_data,
args->note_size);
+ args->num_notes++;
inferior_ptid = saved_ptid;
registers_changed ();
target_fetch_registers (-1); /* FIXME should not be necessary;
@@ -271,11 +274,12 @@ linux_make_note_section (bfd *obfd, int *note_size)
thread_args.obfd = obfd;
thread_args.note_data = note_data;
thread_args.note_size = note_size;
+ thread_args.num_notes = 0;
iterate_over_threads (linux_corefile_thread_callback, &thread_args);
- if (thread_args.note_data == note_data)
+ if (thread_args.num_notes == 0)
{
/* iterate_over_threads didn't come up with any threads;
- just use inferior_ptid. */
+ just use inferior_ptid. */
note_data = linux_do_thread_registers (obfd, inferior_ptid,
note_data, note_size);
}