From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31164 invoked by alias); 1 Jul 2013 07:43:07 -0000 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 Received: (qmail 30905 invoked by uid 89); 1 Jul 2013 07:42:58 -0000 X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 01 Jul 2013 07:42:57 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r617gtBE011099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Jul 2013 03:42:55 -0400 Received: from psique.redhat.com (ovpn-113-175.phx2.redhat.com [10.3.113.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r617gssL017377; Mon, 1 Jul 2013 03:42:54 -0400 From: Sergio Durigan Junior To: GDB Patches Cc: Sergio Durigan Junior Subject: [PATCH 00/17] Implement gdbarch_gdb_signal_to_target Date: Mon, 01 Jul 2013 07:43:00 -0000 Message-Id: <1372664545-3947-1-git-send-email-sergiodj@redhat.com> X-SW-Source: 2013-07/txt/msg00002.txt.bz2 Hello, This patch implements the new gdbarch method gdbarch_gdb_signal_to_target. It will be used when one wants to convert between the internal GDB signal representation (enum gdb_signal) and the target's representation. The idea of this patch came from a chat between Pedro and I on IRC, plus the discussion of my patches to add the new $_exitsignal convenience variable: What I did was to investigate, on the Linux kernel, which targets shared the signal numbers definition with x86. My approach was to make the x86 the "de facto" implementation, and extend only the needed bits on each arch. For the record, I used linux-3.10-rc6 as the main source of information, always looking at arch//include/uapi/asm/signal.h. For SIGRTMAX (which defaults to _NSIG in most cases), I had to look at different signal-related files, but most of them (except MIPS) were defined to 64 anyway. Then, with all the differences in hand, I implemented the bits on each target. Since I obviously don't have access to all targets, I could not compile GDB to make sure everything worked on each one of them, but I'd be surprised if it didn't. I also am not submitting a testcase with this patch because the gdbarch method is not being used anywhere yet; I should send a proper testcase when I resubmit the $_exitsignal + $_signo patches, because they will make use of the method. I would appreciate if you could take a look and tell me your opinions. Most of the patches are trivial, because they share all the signal numbers with x86. If you want to narrow your review, I'd recommend taking a look at the patches 01, 02, and 17 (MIPS, see the message + patch for more explanations). Also, if you intend to test the compilation of this patch on some architecture, you will need patches 01 and 02 to successfully compile it. OK to apply? Comments are welcome. Thanks. -- Sergio gdb/alpha-linux-tdep.c | 89 +++++++++++++++++++++++ gdb/amd64-linux-tdep.c | 5 ++ gdb/arm-linux-tdep.c | 14 ++++ gdb/avr-tdep.c | 50 +++++++++++++ gdb/cris-tdep.c | 5 +- gdb/gdbarch.c | 33 +++++++++ gdb/gdbarch.h | 14 ++++ gdb/gdbarch.sh | 9 +++ gdb/h8300-tdep.c | 4 ++ gdb/i386-linux-tdep.c | 5 ++ gdb/ia64-linux-tdep.c | 2 + gdb/linux-tdep.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++ gdb/linux-tdep.h | 3 + gdb/m32r-linux-tdep.c | 2 + gdb/m68klinux-tdep.c | 3 + gdb/mips-linux-tdep.c | 132 ++++++++++++++++++++++++++++++++++ gdb/mn10300-linux-tdep.c | 2 + gdb/s390-tdep.c | 2 + gdb/sparc-linux-tdep.c | 83 +++++++++++++++++++++ gdb/xtensa-linux-tdep.c | 49 +++++++++++++ 20 files changed, 687 insertions(+), 1 deletion(-)