Add & in catch in svr4_handle_solib_event

Message ID 20240821150507.26543-1-tdevries@suse.de
State Committed
Headers
Series Add & in catch in svr4_handle_solib_event |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Tom de Vries Aug. 21, 2024, 3:05 p.m. UTC
  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.
---
 gdb/solib-svr4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 28c3bf55f0f9aca8619c6d01be34a02a887c5577
  

Comments

Tom Tromey Aug. 21, 2024, 4:59 p.m. UTC | #1
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> This seems to be the only place were we do this, elsewhere we have:
Tom> ...
Tom> 	catch (const gdb_exception_error &)
Tom> ...

Tom> I suppose the intent of adding '&' is to avoid a copy.  I'm not sure if it's
Tom> necessary given that it's an unnamed const parameter, but I suppose it can't
Tom> hurt either.

Tom> Add the '&' here as well.

Looks good, thank you.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

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;
 	  }