From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16889 invoked by alias); 23 Sep 2013 07:09:25 -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 16875 invoked by uid 89); 23 Sep 2013 07:09:24 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Sep 2013 07:09:24 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga02.intel.com Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 23 Sep 2013 00:09:21 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga001.fm.intel.com with ESMTP; 23 Sep 2013 00:09:20 -0700 Received: from irsmsx153.ger.corp.intel.com (163.33.192.75) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 23 Sep 2013 08:09:19 +0100 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.69]) by IRSMSX153.ger.corp.intel.com ([169.254.9.47]) with mapi id 14.03.0123.003; Mon, 23 Sep 2013 08:09:19 +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, 23 Sep 2013 07:09: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> In-Reply-To: <20130922144224.GC19149@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/msg00809.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Sunday, September 22, 2013 4:42 PM > > I need to distinguish different types of errors, e.g. overflow and not > supported. >=20 > Then use enum. There is for example: > enum return_reason > { > /* User interrupt. */ > RETURN_QUIT =3D -2, > /* Any other error. */ > RETURN_ERROR > }; >=20 > One could even throw and catch specific exceptions (enum errors) but I fi= nd > that needlessly overcomplicated when we just return to the immediate > caller. In addition to errors I defined myself, I might get errors from the system = call, e.g. ENOMEM, EOPNOTSUPP, ENOSYS. For the not-available function, for example, I'm just mimicking the error that would be returned by the system call on systems where that call is not available. Do you want me to translate those into an enum? 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