This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] enum target_signal vs. int host_signal
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 24 Jul 2010 13:42:08 +0200
- Subject: [patch] enum target_signal vs. int host_signal
Hi,
enum target_signal and int host_signal are compatible without a cast in C.
Besides the change below I find some incorrect usage of gdb/gdbserver/target.h
struct thread_resume -> sig. But one should decide first which kind of signal
it should be.
No regressions on x86_64-fedora13-linux-gnu for */*core*.exp.
I will post also sanity checking patch for this kind of error.
Thanks,
Jan
gdb/
2010-07-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (linux_nat_do_thread_registers): Convert STOP_SIGNAL to
the host signal first.
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4190,7 +4190,8 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
if (strcmp (sect_list->sect_name, ".reg") == 0)
note_data = (char *) elfcore_write_prstatus
(obfd, note_data, note_size,
- lwp, stop_signal, gdb_regset);
+ lwp, target_signal_to_host (stop_signal),
+ gdb_regset);
else
note_data = (char *) elfcore_write_register_note
(obfd, note_data, note_size,
@@ -4217,11 +4218,9 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
else
fill_gregset (regcache, &gregs, -1);
- note_data = (char *) elfcore_write_prstatus (obfd,
- note_data,
- note_size,
- lwp,
- stop_signal, &gregs);
+ note_data = (char *) elfcore_write_prstatus
+ (obfd, note_data, note_size, lwp, target_signal_to_host (stop_signal),
+ &gregs);
if (core_regset_p
&& (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2",