From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1432 invoked by alias); 26 Sep 2013 06:27:28 -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 1334 invoked by uid 89); 26 Sep 2013 06:27:27 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Sep 2013 06:27:27 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPAM_SUBJECT,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga11.intel.com Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 25 Sep 2013 23:27:24 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga002.fm.intel.com with ESMTP; 25 Sep 2013 23:27:23 -0700 Received: from irsmsx106.ger.corp.intel.com (163.33.3.31) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 26 Sep 2013 07:27:23 +0100 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.69]) by IRSMSX106.ger.corp.intel.com ([169.254.8.226]) with mapi id 14.03.0123.003; Thu, 26 Sep 2013 07:27:22 +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: Thu, 26 Sep 2013 06:27: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> <20130922144224.GC19149@host2.jankratochvil.net> <20130925190523.GA18559@host2.jankratochvil.net> In-Reply-To: <20130925190523.GA18559@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/msg00917.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Jan Kratochvil > > > > I need to distinguish different types of errors, e.g. overflow and = not > > > supported. > > > > > > Then use enum. There is for example: > > > enum return_reason > > > { > > > /* User interrupt. */ > > > RETURN_QUIT =3D -2, > > > /* Any other error. */ > > > RETURN_ERROR > > > }; > > > > > > One could even throw and catch specific exceptions (enum errors) but I > find > > > that needlessly overcomplicated when we just return to the immediate > > > caller. > > > > In addition to errors I defined myself, I might get errors from the sys= tem > call, > > e.g. ENOMEM, EOPNOTSUPP, ENOSYS. >=20 > I do not see such system call. linux_read_btrace can ever return only 0, > -EOVERFLOW or -ENOSYS and nothing else. It never returns for example > variable value like "-errno". The system call is in linux_enable_btrace where I use a similar scheme. > > Do you want me to translate those into an enum? >=20 > As it can return only 0, -EOVERFLOW and -ENOSYS yes, I find enum as the > best > one. OK. I'll wait for more feedback on the other patches in v6 before sending the v7 version with those changes. 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