From 4144d36a68bda0f20c02e6a4444052b44a462155 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 16 Jul 2024 23:52:02 -0400 Subject: gdb: add program_space parameter to lookup_minimal_symbol >From what I can see, lookup_minimal_symbol doesn't have any dependencies on the global current state other than the single reference to current_program_space. Add a program_space parameter and make that current_program_space reference bubble up one level. Change-Id: I759415e2f9c74c9627a2fe05bd44eb4147eee6fe Reviewed-by: Keith Seitz Approved-By: Andrew Burgess --- gdb/p-lang.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gdb/p-lang.c') diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 70f28c9..4c5d4dd 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -59,20 +59,23 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program"; const char * pascal_main_name (void) { - bound_minimal_symbol msym = lookup_minimal_symbol (GPC_P_INITIALIZE); + bound_minimal_symbol msym + = lookup_minimal_symbol (current_program_space, GPC_P_INITIALIZE); /* If '_p_initialize' was not found, the main program is likely not written in Pascal. */ if (msym.minsym == NULL) return NULL; - msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1); + msym + = lookup_minimal_symbol (current_program_space, GPC_MAIN_PROGRAM_NAME_1); if (msym.minsym != NULL) { return GPC_MAIN_PROGRAM_NAME_1; } - msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2); + msym + = lookup_minimal_symbol (current_program_space, GPC_MAIN_PROGRAM_NAME_2); if (msym.minsym != NULL) { return GPC_MAIN_PROGRAM_NAME_2; -- cgit v1.1