From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sourceware.org
Subject: [RFA] Change to pre-expand symtabs
Date: Mon, 26 Jul 2010 18:47:00 -0000 [thread overview]
Message-ID: <4C4DD835.7060702@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]
Hi,
This patch actually does two things, both related to PR symtab/11743
(for which I've previously submitted various ugly patches). First, it
switches gdb to search for symtabs by using psymtab pre-expansion.
Second, it strips off overload information from psymtab search names,
since psymtabs do not contain any of this information to begin with. I
believe this is going to be the cleanest approach to fixing the
overload-instance-in-a-psymtab problem (symtab/11743) that we're likely
to find.
Note that I have not addressed the linespec.c problems specifically
reported in symtab/11743. This simply gets the non-quoted case working
(which is a pre-requisite anyway).
Keith
ChangeLog
2010-07-26 Keith Seitz <keiths@redhat.com>
PR symtab/11743 (partial):
* psymtab.c (lookup_symbol_aux_psymtabs): Always return NULL;
switching to pre-expanding symtabs instead.
(pre_expand_symtabs_matching_psymtabs): Implement.
If overload information is present in the search name,
strip it.
[-- Attachment #2: expand-psymtabs-overloaded.patch --]
[-- Type: text/plain, Size: 1526 bytes --]
Index: psymtab.c
===================================================================
RCS file: /cvs/src/src/gdb/psymtab.c,v
retrieving revision 1.7
diff -u -p -r1.7 psymtab.c
--- psymtab.c 13 Jul 2010 20:52:52 -0000 1.7
+++ psymtab.c 26 Jul 2010 18:38:24 -0000
@@ -409,15 +409,6 @@ lookup_symbol_aux_psymtabs (struct objfi
int block_index, const char *name,
const domain_enum domain)
{
- struct partial_symtab *ps;
- const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0);
-
- ALL_OBJFILE_PSYMTABS (objfile, ps)
- {
- if (!ps->readin && lookup_partial_symbol (ps, name, psymtab_index, domain))
- return PSYMTAB_TO_SYMTAB (ps);
- }
-
return NULL;
}
@@ -426,7 +417,27 @@ pre_expand_symtabs_matching_psymtabs (st
int kind, const char *name,
domain_enum domain)
{
- /* Nothing. */
+ char *paren;
+ struct partial_symtab *pst;
+ const int psymtab_index = (kind == GLOBAL_BLOCK ? 1 : 0);
+
+ /* If NAME contains overload information, strip it, since psymtabs only
+ contain the method name. */
+ paren = strchr (name, '(');
+ if (paren != NULL)
+ {
+ char *tmp = alloca (strlen (name));
+ memcpy (tmp, name, paren - name);
+ tmp[name - paren] = '\0';
+ name = tmp;
+ }
+
+ ALL_OBJFILE_PSYMTABS (objfile, pst)
+ {
+ if (!pst->readin
+ && lookup_partial_symbol (pst, name, psymtab_index, domain) != NULL)
+ PSYMTAB_TO_SYMTAB (pst);
+ }
}
/* Look, in partial_symtab PST, for symbol whose natural name is NAME.
next reply other threads:[~2010-07-26 18:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 18:47 Keith Seitz [this message]
2010-07-29 20:52 ` Tom Tromey
2010-07-30 16:48 ` Keith Seitz
2010-09-01 21:44 ` Tom Tromey
2010-09-02 17:28 ` Keith Seitz
2010-09-02 22:13 ` Keith Seitz
2010-09-04 20:48 ` Jan Kratochvil
2010-09-08 17:17 ` Keith Seitz
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=4C4DD835.7060702@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).