[RFA]: add reason code and silent flag to decode_line_1
Mon Dec 8 22:06:00 GMT 2003
This is part of my pending breakpoint changes. Daniel asked to break it up into
a few pieces; this being one of them.
I have added two new paramters to decode_line_1. One is a reason_code field and
the other is a silent_flag. The reason code is a pointer to an int to store a
reason code should the function cause an error. At present, the reason_code is
only set if the file or function is not found. I would have called it
not_found_ptr instead of reason_code_ptr but I felt this could be enhanced in
the future to include other forms of error that could be of interest to the
caller. The reason code works like errno whereby the caller is expected to
clear the field before calling and check it afterwards. The silent_if_not_found
flag tells the function not to issue an error message if the function is to fail
because the function/source file is not found.
Ok to commit?
-- Jeff J.
2003-12-08 Jeff Johnston <email@example.com>
* linespec.h (decode_line_1): Add new reason_code_ptr and
silent_if_not_found parameters. Add new DL1_NOT_FOUND reason
* linespec.c (decode_line_1): Add new parameters. Pass on
new parameters to decode_variable and symtab_from_filename
(decode_variable): Add new reason_code_ptr and silent_if_not_found
parameters. Set reason code if failing because function not
found. Throw exception rather than calling error() if silent
flag is set and function is not found.
(symtab_from_filename): Add new reason_code_ptr and silent_if_not_found
parameters. Set reason code if failing because source file not
found. Throw exception rather than using error call if
silent flag is set and source file is not found.
* breakpoint.c: Change all callers of decode_line_1 to add default
extra parameters for decode_line_1 calls.
* tracepoint.c: Ditto.
* cli/cli-cmds.c: Ditto.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Gdb-patches