From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23397 invoked by alias); 16 Sep 2013 12:48:51 -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 23385 invoked by uid 89); 16 Sep 2013 12:48:51 -0000 Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Sep 2013 12:48:51 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga03.intel.com Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 16 Sep 2013 05:48:48 -0700 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by azsmga001.ch.intel.com with ESMTP; 16 Sep 2013 05:48:45 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.69]) by IRSMSX102.ger.corp.intel.com ([169.254.2.234]) with mapi id 14.03.0123.003; Mon, 16 Sep 2013 13:48:43 +0100 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" , Pedro Alves Subject: RE: [patch v4 20/24] btrace, gdbserver: read branch trace incrementally Date: Mon, 16 Sep 2013 12:48:00 -0000 Message-ID: References: <1372842874-28951-1-git-send-email-markus.t.metzger@intel.com> <1372842874-28951-21-git-send-email-markus.t.metzger@intel.com> <20130818190905.GP24153@host2.jankratochvil.net> In-Reply-To: <20130818190905.GP24153@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00440.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Sunday, August 18, 2013 9:09 PM Thanks for your review. > > -VEC (btrace_block_s) * > > -linux_read_btrace (struct btrace_target_info *tinfo, > > +int > > +linux_read_btrace (VEC (btrace_block_s) **btrace, > > + struct btrace_target_info *tinfo, > > enum btrace_read_type type) > > { > > - return NULL; > > + return ENOSYS; >=20 > You return -EOVERFLOW in its real implementation while ENOSYS here, its > sign does not match (+it is not documented). linux_low_read_btrace checks > for -EOVERFLOW. The -EOVERFLOW return signals a buffer overflow which indicates that delta trace is not available. GDB then switches to a full read after disca= rding the existing trace. The -ENOSYS return signals that the feature is not available. This error is passed on to the user. > > - /* Read branch trace data. */ > > - VEC (btrace_block_s) *(*to_read_btrace) (struct btrace_target_info= *, > > - enum btrace_read_type); > > + /* Read branch trace data into DATA. The vector is cleared before= any > > + new data is added. > > + Returns 0 on success; a negative error code, otherwise. */ >=20 > "a negative errno code" (error code seems too ambiguous to me) >=20 > But target_read_btrace several lines above returns positive errno code. That was a bug. Fixed. > TBH returning all these errno codes are not common in GDB, returning -1 > would make it easier but I do not insist on it. I need to distinguish different types of errors, e.g. overflow and not supp= orted. Regards, Markus. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052