[PATCH] gdb/source: Fix open_source_file error handling

Tom Tromey tom@tromey.com
Wed Feb 8 17:53:57 GMT 2023


Ok, I re-read the patch and see you did use ATTRIBUTE_NORETURN.  Sorry
about that.  And adding an optional argument means changing gdbserver as
well... IMO this is fine but up to you.

Though it seems to me that:

Aaron> +  bfd_set_error (bfd_error_no_error);
Aaron> +  errno = 0;

... these two lines are probably leftovers from ancient times, when the
gdb exception mechanism was much less robust.  They should not be in new
code, and TBH probably the best route forward is to remove them from
utils.c, and in fact merge the definition of perror_with_name into
gdbsupport, since AFAICT it's really identical between gdb and
gdbserver.

Tom


More information about the Gdb-patches mailing list