This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] smart pointer support
On Mon, 09 Aug 2010 20:04:15 +0200, sami wagiaalla wrote:
> +
> + /* Check to see if the operator '->' has been overloaded. If the operator
> + has been overloaded replace arg2 with the value returned by the custom
> + operator and continue evaluation. */
> + while (unop_user_defined_p (op, arg2))
> + {
> + volatile struct gdb_exception except;
> + struct value *value = NULL;
> + TRY_CATCH (except, RETURN_MASK_ERROR)
> + {
> + value = value_x_unop (arg2, op, noside);
> + }
> +
> + if (except.reason < 0)
> + break;
What if some other error kind occurs? It would get hidden. Such as:
error (_("This target does not support function calls."));
In the case you want to go with the TRY_CATCH case you should IMO specialize
the error message you want to catch to some:
throw_error (THE_GREAT_NEW_KIND_OF_ERROR, that message);
To correctly check just that specific error kind in EXCEPT (and throw it again
otherwise).
OTOH I believe instead of making a new special kind of error message the
function calling schematics could be changed to not error itself and return
some normal error return value instead.
Regards,
Jan