public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] enum target_signal vs. int host_signal
@ 2010-07-24 11:42 Jan Kratochvil
  2010-07-24 22:44 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kratochvil @ 2010-07-24 11:42 UTC (permalink / raw)
  To: gdb-patches

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",

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-25 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-24 11:42 [patch] enum target_signal vs. int host_signal Jan Kratochvil
2010-07-24 22:44 ` Pedro Alves
2010-07-25  9:33   ` [patch] gdbserver: enum target_signal vs. int host_signal [Re: [patch] enum target_signal vs. int host_signal] Jan Kratochvil
2010-07-25 10:05     ` Pedro Alves
2010-07-25 10:17       ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).