public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Use a function-domain search in inside_main_func
@ 2024-01-28 23:45 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-01-28 23:45 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e11de080a35f08c016e90d11f18918ec78fd1efc
commit e11de080a35f08c016e90d11f18918ec78fd1efc
Author: Tom Tromey <tom@tromey.com>
Date: Tue Sep 19 17:35:08 2023 -0600
Use a function-domain search in inside_main_func
This changes inside_main_func to search only for functions.
Diff:
---
gdb/frame.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/gdb/frame.c b/gdb/frame.c
index 9e286a4272b..fae89cbbc0a 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -2560,13 +2560,9 @@ inside_main_func (frame_info_ptr this_frame)
symbol with the name of the main function. In this case we should
search the full symbols to see if we can find a match. */
struct block_symbol bs = lookup_symbol (name, nullptr,
- SEARCH_VFT, nullptr);
+ SEARCH_FUNCTION_DOMAIN, nullptr);
- /* We might have found some unrelated symbol. For example, the
- Rust compiler can emit both a subprogram and a namespace with
- the same name in the same scope; and due to how gdb's symbol
- tables currently work, we can't request the one we'd
- prefer. */
+ /* This lookup should always yield a block-valued symbol. */
if (bs.symbol != nullptr && bs.symbol->aclass () == LOC_BLOCK)
{
const struct block *block = bs.symbol->value_block ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-28 23:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-28 23:45 [binutils-gdb] Use a function-domain search in inside_main_func Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).