[RFC] -thread-info new command

Nick Roberts nickrob@snap.net.nz
Wed Mar 21 21:09:00 GMT 2007


 > but I could only come up with:
 > 
 > http://sourceware.org/ml/gdb-patches/2006-11/msg00208.html
 > 
 > which didn't seem that simple and is probably not correct

I've gone through the archives to try to understand the changes.   The above
message says:

   Well we need to propagate the error message back to
   captured_mi_execute_command.

Actually there are currently two ways to catch an error in MI:

1) Using error () and catch_exception.

2) Using MI_CMD_ERROR and mi_error_message.

The first gets caught in mi_execute_command and the error message is stored
in result.message.  The second goes back to captured_mi_execute_command and
the error message is manually stored in mi_error_message.

I think that only one method should be used and this should be the first one.

It appears that catch_exceptions_with_msg was used to avoid using
error_last_message () but this was no longer needed when mi_execute_command was
changed to use catch_exception instead of catch_exceptions (the comment "Can
this use of catch_exceptions..." is an anachronism).  The error message should
be available in result.message for these functions (gdb_thread_select,
gdb_breakpoint,..)  anyway.

-- 
Nick                                           http://www.inet.net.nz/~nickrob



More information about the Gdb-patches mailing list