This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 01/15 v3] Introduce common/errors.h
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches <gdb-patches at sourceware dot org>, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 17 Jul 2014 17:12:06 +0100
- Subject: Re: [PATCH 01/15 v3] Introduce common/errors.h
- Authentication-results: sourceware.org; auth=none
- References: <1405520243-17282-1-git-send-email-gbenson at redhat dot com> <1405520243-17282-2-git-send-email-gbenson at redhat dot com> <CADPb22TEuAHAsNg7L6h8We6hJKv0Wdj6vQL6yBbqGcUwRUYpkw at mail dot gmail dot com> <20140717134728 dot GB31916 at blade dot nx> <53C7E6AB dot 4080703 at redhat dot com> <20140717153957 dot GA1921 at blade dot nx>
On 07/17/2014 04:39 PM, Gary Benson wrote:
> Pedro Alves wrote:
>> On 07/17/2014 02:47 PM, Gary Benson wrote:
>>> +/* Throw an error. The current operation will be aborted. The
>>> + message will be issued to the user. The application will
>>> + return to a state where it is accepting commands from the user. */
>>
>> These comments aren't really true, though. We have plenty of places
>> catching errors with TRY_CATCH and proceeding without returning to a
>> state where we're accepting commands from the user.
>
> How about "Throw an error. The current operation will be aborted.
> The application may catch and process the error, or, if not, the
> message will be issued to the user and the application will return
> to a state where it is accepting commands from the user."
Still infers what the application does with the error. IMO, it's
best to describe the interface. Like:
Throw a generic error. This function not return, instead
it executes a long jump, aborting the current operation.
The function takes printf-style arguments, which are used to
construct the error message.
>> (We should really bite the bullet and move exceptions.{h|c} and
>> cleanups.{h|c} to common/ and make gdbserver use them too.)
>
> Can I leave this for another series please? This one's big enough
> already.
Yes, of course. That's why it was a parenthesis.
--
Pedro Alves