aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-tdep.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@codesourcery.com>2013-10-24 20:37:49 +0100
committerTom Tromey <tromey@sourceware.org>2013-10-25 14:03:00 +0000
commitbbe769cc07aa1b1b0f4ede05c189a2d9897603bb (patch)
tree81a47277793b9f86c0db32c08cece90d249ba2db /gdb/linux-tdep.c
parent72ee449576f27ec95de5d03c868a14372e0250cb (diff)
downloadgdb-bbe769cc07aa1b1b0f4ede05c189a2d9897603bb.zip
gdb-bbe769cc07aa1b1b0f4ede05c189a2d9897603bb.tar.gz
gdb-bbe769cc07aa1b1b0f4ede05c189a2d9897603bb.tar.bz2
Avoid producing broken non-native core files
gdb/ * linux-tdep.c (linux_corefile_thread_callback): Propagate any failure from register information collection. gdb/testsuite/ * lib/gdb.exp (gdb_gcore_cmd): Also handle a "Target does not support core file generation" reply.
Diffstat (limited to 'gdb/linux-tdep.c')
-rw-r--r--gdb/linux-tdep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 5bca076..304fe09 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1209,14 +1209,15 @@ linux_corefile_thread_callback (struct thread_info *info, void *data)
args->note_data, args->note_size,
args->stop_signal);
- if (siginfo_data != NULL)
- {
+ /* Don't return anything if we got no register information above,
+ such a core file is useless. */
+ if (args->note_data != NULL)
+ if (siginfo_data != NULL)
args->note_data = elfcore_write_note (args->obfd,
args->note_data,
args->note_size,
"CORE", NT_SIGINFO,
siginfo_data, siginfo_size);
- }
do_cleanups (old_chain);
}