From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19886 invoked by alias); 24 Jul 2010 11:42:18 -0000 Received: (qmail 19878 invoked by uid 22791); 24 Jul 2010 11:42:18 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 24 Jul 2010 11:42:13 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6OBgBbh006982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 24 Jul 2010 07:42:12 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6OBg9KF031723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 24 Jul 2010 07:42:11 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o6OBg9s5009739 for ; Sat, 24 Jul 2010 13:42:09 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o6OBg8N7009738 for gdb-patches@sourceware.org; Sat, 24 Jul 2010 13:42:08 +0200 Date: Sat, 24 Jul 2010 11:42:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] enum target_signal vs. int host_signal Message-ID: <20100724114208.GA8491@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00380.txt.bz2 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 * 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",