[22/29] Only search for "main" as a function

Message ID 20231120-submit-domain-hacks-2-v1-22-29650d01b198@tromey.com
State New
Headers
Series Restructure symbol domains |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed

Commit Message

Tom Tromey Nov. 21, 2023, 3:53 a.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 3d7a5a1811b..b02204cc430 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -6336,7 +6336,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)
 	   {