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 00/20] Remove cleanups


On 2/13/19 1:29 PM, Tom Tromey wrote:
> This series removes the remaining uses of make_cleanup from the tree,
> then removes make_cleanup and some related functions (but note that
> final cleanups remain).
> 
> Then, it removes the TRY/CATCH macros in favor of ordinary C++ code.
> 
> Finally, it cleans up a few spots that currently use TRY/CATCH but
> that are more succinctly written using SCOPE_EXIT or RAII.
> 
> Regression tested by the buildbot.

Yay!

The only comment I have is that the structure names for exceptions look a
bit awkward in code now with the mix of lower and upper case, e.g.:

   try
     {
       e_msg = ada_exception_message_1 ();
     }
   catch (struct gdb_exception_RETURN_MASK_ERROR &e)
     {
       e_msg.reset (nullptr);
     }

We could drop the 'struct' perhaps, but not sure if we could simplify the
classes a bit to something like:

struct gdb_exception_error : public gdb_exception
{
};

struct gdb_exception_quit : public gdb_exception
{
};

And use 'gdb_execption' instead of 'struct gdb_exception_RETURN_MASK_ALL',
'gdb_exception_error' instead of 'struct gdb_exception_RETURN_MASK_ERROR',
and 'gdb_exception_quit' instead of 'struct gdb_exception_RETURN_MASK_QUIT'?

-- 
John Baldwin

                                                                            


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