From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7025 invoked by alias); 14 Jun 2013 20:21:59 -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 6732 invoked by uid 89); 14 Jun 2013 20:21:53 -0000 X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,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; Fri, 14 Jun 2013 20:21:53 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5EKLlAL027622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Jun 2013 16:21:47 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5EKLjhe010492; Fri, 14 Jun 2013 16:21:45 -0400 Message-ID: <51BB7B58.9030007@redhat.com> Date: Fri, 14 Jun 2013 20:36:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Sergio Durigan Junior CC: Pierre Muller , "'GDB Patches'" Subject: Re: [RFC/PATCH] Add new internal variable $_signo References: <002801ce68dd$845cd2e0$8d1678a0$@muller@ics-cnrs.unistra.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00342.txt.bz2 On 06/14/2013 06:58 PM, Sergio Durigan Junior wrote: > Hi Pierre, > > Thanks for the review. > > On Friday, June 14 2013, Pierre Muller wrote: > >> Is it that I didn't understand the patch correctly or >> do you use the GDB signal number in infrun.c >> while you use the native signal integer value in the >> corelow.c case? > > Yes, you are right. > >> Aren't those two values sometimes different? > > They probably are in some cases. > >> Wouldn't it be more consistent to only use the GDB internal number? > > Hm, now that you raised the question, I am wondering. I believe it is > more consistent to use the GDB internal number when we are printing > something, yeah. > > However, in the $_signo case, we are actually displaying the number > itself, so your comment applies to my patch, but backwards: I should > actually be converting the GDB internal number to the actual signal > number on infrun.c. > >> In fact, this "inconsistency" is not specific to your patch, >> the siggy from corelow.c is printed out, while other signals are always >> first converted to GDB enum values before being printed (and apparently not >> in >> integer form but using the gdb_signal_to_name function. >> >> Shouldn't we use gdb_signal_to_name (sig) in core_open >> and set $_signo also to sig? > > I don't think $_signo should be set to "sig", it should remain "siggy". > What should happen (IIUC everything) is that the infrun.c uses should be > converted to the actual signal number (by using gdb_signal_to_host). gdb_signal_to_host is the fallback (and having a fallback is sort of a hack). The right signal number is the target's not the host's. We have gdbarch_gdb_signal_from_target for the opposite direction, but not gdbarch_gdb_signal_to_target... Having to bake the target OS's signal numbers into GDB is a bit unfortunate, though we could get around it at some point if we wanted by extending the RSP, and/or adding a python hook. -- Pedro Alves