From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104763 invoked by alias); 4 Sep 2017 14:19:54 -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 104236 invoked by uid 89); 4 Sep 2017 14:19:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sims X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Sep 2017 14:19:49 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B6CA75751; Mon, 4 Sep 2017 14:19:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0B6CA75751 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C1487B5F2; Mon, 4 Sep 2017 14:19:46 +0000 (UTC) Subject: Re: [PATCH v2] Define an error function in the PPC simulator library. To: John Baldwin , Luis Machado References: <20170405163332.82109-1-jhb@FreeBSD.org> <2136315.0HrDL9yZYa@ralph.baldwin.cx> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <6ff2bd23-446a-b27c-0b04-2c0d6b92315b@redhat.com> Date: Mon, 04 Sep 2017 14:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <2136315.0HrDL9yZYa@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00050.txt.bz2 Hi John, (Since it seems that Mike doesn't have much time for the sim currently, I'm trying to help move things along by reviewing this patch.) On 04/13/2017 06:18 PM, John Baldwin wrote: > On Thursday, April 13, 2017 08:25:27 AM Luis Machado wrote: >> On 04/05/2017 11:33 AM, John Baldwin wrote: >>> Previously this used the error function from GDB directly when linked >>> against GDB instead of the error method in the host callbacks >>> structure. This was exposed via a link error when GDB was converted >>> to C++. The error function invokes the error callback similar to >>> sim_io_error. >>> >> >> There is another implementation of error (...) in sim/ppc/main.c and >> sim/ppc/misc.c. Should those be kept as is or should we only use the new >> function you're providing? > > My understanding is that they should be kept as-is. This file is only used > when linking the library against GDB (and actually, rereading the log message, > I should reword the opening sentence to make this clearer). sim-calls.o isn't > included in the actual library. Each consumer of the library is required > to export a couple of symbols that libsim.a uses including "error". The dgen, > igen, tmp-filter, tmp-ld-decode, tmp-ld-cache, and tmp-ld-insn programs use > the functions from misc.c. psim uses the functions from main.c, and > GDB uses the functions from sim-calls.o. It'd be nice to include this info somewhere, likely in the commit log. > glibc includes a global function > called 'error' that libsim.a is linking against when linked into GDB on > Linux which is why it doesn't fail to link on Linux (but if it ever needs > to raise an error it probably blows up as error(3) doesn't have the same > calling convention). > >> Also, i don't see error being implemented in the other sim backends. I >> wonder if we should just use whatever is available (sim_io_error?) >> instead of supplying our own ppc-specific version? > > Other sims don't use an "error" function (ppc seems to be special in this > case). I think Pedro took a stab at replacing "error" (there's a thread > with the subject "gdb-7.12-powerpc-rtems4.12-gdb does not build on FreeBSD" > on gdb@) but thought this approach was simpler (and could also be merged > to 7.12 though that may be OBE by now). > Yeah. Your patch looks good to me as you have it. Even though renaming the sim's "error" function to something else would be nice, I don't think that should be a requirement. We've been calling it "error" since forever. Thanks, Pedro Alves