[v2,23/30] Only search for "main" as a function

Message ID 20240118-submit-domain-hacks-2-v2-23-aecab29fa104@tromey.com
State New
Headers
Series Restructure symbol domains |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Tom Tromey Jan. 18, 2024, 8:32 p.m. UTC
  This changes find_main_name to restrict its search to the function
domain.
---
 gdb/symtab.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/symtab.c b/gdb/symtab.c
index 30b12d6f4eb..517e843244b 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -6435,7 +6435,8 @@  find_main_name (void)
      [&symbol_found_p, pspace] (objfile *obj)
        {
 	 language lang
-	   = obj->lookup_global_symbol_language ("main", SEARCH_VFT,
+	   = obj->lookup_global_symbol_language ("main",
+						 SEARCH_FUNCTION_DOMAIN,
 						 &symbol_found_p);
 	 if (symbol_found_p)
 	   {