From: Tom de Vries Date: Thu, 22 Aug 2024 07:49:53 +0000 (+0200) Subject: [gdb] Add & in catch in svr4_handle_solib_event X-Git-Tag: gdb-16-branchpoint~1094 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=78125417227bd3f3765ba52d04066f8607d62f44;p=thirdparty%2Fbinutils-gdb.git [gdb] Add & in catch in svr4_handle_solib_event In svr4_handle_solib_event I noticed: ... catch (const gdb_exception_error) ... This seems to be the only place were we do this, elsewhere we have: ... catch (const gdb_exception_error &) ... I suppose the intent of adding '&' is to avoid a copy. I'm not sure if it's necessary given that it's an unnamed const parameter, but I suppose it can't hurt either. Add the '&' here as well. Tested on x86_64-linux. Approved-By: Tom Tromey --- diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 1a0e5424806..ff5887a221d 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1948,7 +1948,7 @@ svr4_handle_solib_event (void) { link_map_id_val = pa->prob->evaluate_argument (0, frame); } - catch (const gdb_exception_error) + catch (const gdb_exception_error &) { link_map_id_val = NULL; }