From 9370fd51ebfca8a8acacaecb92c57ee54f4f8382 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 8 Oct 2020 12:28:19 +0100 Subject: gdb: detect main function even when there's no matching msymbol Currently, GDB will only stop the backtrace at the main function if there is a minimal symbol with the matching name. In Fortran programs compiled with gfortran this is not the case. The main function is present in the DWARF, and as marked as DW_AT_main_subprogram, but there's no minimal symbol. This commit extends `inside_main_func` to check the full symbols if no matching minimal symbol is found. There's an updated test case that covers this change. gdb/ChangeLog: * frame.c (inside_main_func): Check full symbols as well as minimal symbols. gdb/testsuite/ChangeLog: * gdb.fortran/mixed-lang-stack.exp (run_tests): Update expected output of backtrace. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.fortran/mixed-lang-stack.exp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d7e8095..2e8efd9 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-10-11 Andrew Burgess + + * gdb.fortran/mixed-lang-stack.exp (run_tests): Update expected + output of backtrace. + 2020-10-09 Tom Tromey * gdb.ada/scalar_storage/storage.adb (Another_Range): New type. diff --git a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp index edf2508..8d1f2bc 100644 --- a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp +++ b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp @@ -73,8 +73,7 @@ proc run_tests { lang } { "#6\\s+$hex in mixed_func_1c \\(\[^\r\n\]+\\) at \[^\r\n\]+" \ "#7\\s+$hex in mixed_func_1b \\($1b_args\\) at \[^\r\n\]+" \ "#8\\s+$hex in mixed_func_1a \\(\\) at \[^\r\n\]+" \ - "#9\\s+$hex in mixed_stack_main \\(\\) at \[^\r\n\]+" \ - "#10\\s+$hex in main \\(\[^\r\n\]+\\) at .*" ] + "#9\\s+$hex in mixed_stack_main \\(\\) at \[^\r\n\]+" ] gdb_test "bt -frame-arguments all" $bt_stack # Check the language for frame #0. -- cgit v1.1