This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [patch v4 20/24] btrace, gdbserver: read branch trace incrementally


> -----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.
> 
> 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.  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]