Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [RFC][gdb] Use partial symbol table to find language for main
Date: Fri, 13 Mar 2020 07:59:26 -0600	[thread overview]
Message-ID: <87mu8kfj9d.fsf@tromey.com> (raw)
In-Reply-To: <bae9984b-a892-8db4-55e6-2800fc81156a@suse.de> (Tom de Vries's message of "Wed, 4 Mar 2020 17:07:18 +0100")

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> [gdb] Use partial symbol table to find language for main

Tom> When language is set to auto, part of loading an executable is to update the
Tom> language accordingly.  This is implemented by set_initial_language.

...

Tom> +/* Psymtab version of lookup_symbol_language.  See its definition in
Tom> +   the definition of quick_symbol_functions in symfile.h.  */
Tom> +
Tom> +enum language
Tom> +psym_lookup_symbol_language (struct objfile *objfile,
Tom> +			     block_enum block_index,
Tom> +			     const char *name,
Tom> +			     domain_enum domain,
Tom> +			     bool *symbol_found_p)

This should be static.

Tom> diff --git a/gdb/psymtab.h b/gdb/psymtab.h
Tom> index 040b973927..a8a5d344b0 100644
Tom> --- a/gdb/psymtab.h
Tom> +++ b/gdb/psymtab.h
Tom> @@ -151,4 +151,9 @@ extern const struct quick_symbol_functions dwarf2_debug_names_functions;
Tom>  extern psymtab_storage::partial_symtab_range require_partial_symbols
Tom>      (struct objfile *objfile, bool verbose);
 
Tom> +enum language psym_lookup_symbol_language (struct objfile *objfile,
Tom> +					   block_enum block_index,
Tom> +					   const char *name,
Tom> +					   domain_enum domain,
Tom> +					   bool *symbol_found_p);

... and not declared here.

Tom> +  /* Check to see if the symbol is defined in a "partial" symbol table
Tom> +     of OBJFILE.  BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
Tom> +     depending on whether we want to search global symbols or static
Tom> +     symbols.  NAME is the name of the symbol to look for.  DOMAIN
Tom> +     indicates what sort of symbol to search for.
Tom> +
Tom> +     If found, sets *symbol_found_p to true and returns the symbol language.
Tom> +     defined, or NULL if no such symbol table exists.  */
Tom> +  enum language (*lookup_symbol_language) (struct objfile *objfile,
Tom> +					   block_enum block_index,

Does this really need the block index?  It seems to me that main will
normally be global.  Also, the code seems to only ever use the global
scope.

Tom> +/* Find the language for partial symbol with NAME.  */
Tom> +
Tom> +enum language
Tom> +find_quick_symbol_language (block_enum block_index, const char *name,
Tom> +			    const domain_enum domain)

This can be static.

Tom> diff --git a/gdb/symtab.h b/gdb/symtab.h
Tom> index 5fa067b5f4..da8d3011ea 100644
Tom> --- a/gdb/symtab.h
Tom> +++ b/gdb/symtab.h
Tom> @@ -2349,4 +2349,8 @@ private:
Tom>    std::vector<bound_minimal_symbol> m_minimal_symbols;
Tom>  };
 
Tom> +enum language
Tom> +find_quick_symbol_language (block_enum block_index, const char *name,
Tom> +			    const domain_enum domain);

No need to declare here.

Tom


  reply	other threads:[~2020-03-13 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 23:18 Tom de Vries
2020-03-03 15:48 ` Tom Tromey
2020-03-04 16:07   ` Tom de Vries
2020-03-13 13:59     ` Tom Tromey [this message]
2020-03-17 15:25       ` [PATCH][gdb] " Tom de Vries
2020-03-30 21:20         ` [PING][PATCH][gdb] " Tom de Vries
2020-04-01 20:07         ` [PATCH][gdb] " Tom Tromey

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=87mu8kfj9d.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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