]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: detect main function even when there's no matching msymbol
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 8 Oct 2020 11:28:19 +0000 (12:28 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Sun, 11 Oct 2020 17:35:39 +0000 (18:35 +0100)
commit9370fd51ebfca8a8acacaecb92c57ee54f4f8382
treed36933bddea27597c50b9fa5680dfc7136f369a6
parentf7c1edaa78ed5ef18ba1e290effd76ecc49884d2
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/ChangeLog
gdb/frame.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/mixed-lang-stack.exp