From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFC] lookup problem in blockframe.c:inside_main_func()
Date: Thu, 09 Oct 2003 14:27:00 -0000 [thread overview]
Message-ID: <20031009142754.GD29621@nevyn.them.org> (raw)
In-Reply-To: <20031007021431.GH933@gnat.com>
On Mon, Oct 06, 2003 at 07:14:31PM -0700, Joel Brobecker wrote:
> 2003-10-06 J. Brobecker <brobecker@gnat.com>
>
> * blockframe.c (inside_main_func): No longer use symbol_lookup()
> to lookup the main function symbol.
This is OK.
> Index: blockframe.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/blockframe.c,v
> retrieving revision 1.80
> diff -u -p -r1.80 blockframe.c
> --- blockframe.c 14 Sep 2003 16:32:12 -0000 1.80
> +++ blockframe.c 7 Oct 2003 01:56:40 -0000
> @@ -83,22 +83,27 @@ deprecated_inside_entry_file (CORE_ADDR
> int
> inside_main_func (CORE_ADDR pc)
> {
> + struct minimal_symbol *msymbol;
> +
> if (pc == 0)
> return 1;
> if (symfile_objfile == 0)
> return 0;
>
> + msymbol = lookup_minimal_symbol (main_name (), NULL, symfile_objfile);
> +
> /* If the addr range is not set up at symbol reading time, set it up
> now. This is for DEPRECATED_FRAME_CHAIN_VALID_ALTERNATE. I do
> this for coff, because it is unable to set it up and symbol
> reading time. */
>
> - if (symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC &&
> - symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
> + if (msymbol != NULL
> + && symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC
> + && symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
> {
> - struct symbol *mainsym;
> + struct symbol *mainsym
> + = find_pc_function (SYMBOL_VALUE_ADDRESS (msymbol));
>
> - mainsym = lookup_symbol (main_name (), NULL, VAR_DOMAIN, NULL, NULL);
> if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
> {
> symfile_objfile->ei.main_func_lowpc =
> @@ -111,8 +116,6 @@ inside_main_func (CORE_ADDR pc)
> /* Not in the normal symbol tables, see if "main" is in the partial
> symbol table. If it's not, then give up. */
> {
> - struct minimal_symbol *msymbol
> - = lookup_minimal_symbol (main_name (), NULL, symfile_objfile);
> if (msymbol != NULL && MSYMBOL_TYPE (msymbol) == mst_text)
> {
> struct obj_section *osect
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-10-09 14:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-06 23:37 Joel Brobecker
2003-10-07 0:15 ` Daniel Jacobowitz
2003-10-07 0:24 ` Joel Brobecker
2003-10-07 1:49 ` Daniel Jacobowitz
2003-10-07 2:14 ` Joel Brobecker
2003-10-07 3:01 ` Daniel Jacobowitz
2003-10-09 14:27 ` Daniel Jacobowitz [this message]
2003-10-10 20:57 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031009142754.GD29621@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox