public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch] enum target_signal vs. int host_signal
Date: Sat, 24 Jul 2010 11:42:00 -0000	[thread overview]
Message-ID: <20100724114208.GA8491@host1.dyn.jankratochvil.net> (raw)

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

             reply	other threads:[~2010-07-24 11:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24 11:42 Jan Kratochvil [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100724114208.GA8491@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).