This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [patch v4 20/24] btrace, gdbserver: read branch trace incrementally
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Thu, 26 Sep 2013 06:27:22 +0000
- Subject: RE: [patch v4 20/24] btrace, gdbserver: read branch trace incrementally
- Authentication-results: sourceware.org; auth=none
- References: <1372842874-28951-1-git-send-email-markus dot t dot metzger at intel dot com> <1372842874-28951-21-git-send-email-markus dot t dot metzger at intel dot com> <20130818190905 dot GP24153 at host2 dot jankratochvil dot net> <A78C989F6D9628469189715575E55B230A9CEBAD at IRSMSX104 dot ger dot corp dot intel dot com> <20130922144224 dot GC19149 at host2 dot jankratochvil dot net> <A78C989F6D9628469189715575E55B230A9D4990 at IRSMSX104 dot ger dot corp dot intel dot com> <20130925190523 dot GA18559 at host2 dot jankratochvil dot net>
> -----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 = -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 system
> call,
> > e.g. ENOMEM, EOPNOTSUPP, ENOSYS.
>
> 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?
>
> 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