public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-ambiguous-linespec: use immediately-enclosing block, not linkage block, when uniquifying this should work better when one function is inlined multiple times into another function Date: Mon, 01 Aug 2011 14:43:00 -0000 [thread overview] Message-ID: <20110801144320.15252.qmail@sourceware.org> (raw) The branch, archer-tromey-ambiguous-linespec has been updated via 2b3ef167d511e1874e37fc6311b49014838713ec (commit) via 4a8903151014230999b83552b2fbd0223c7f2601 (commit) from 22222f4f6c22a5d4b2ed7336f7ecc2ef898a110e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 2b3ef167d511e1874e37fc6311b49014838713ec Author: Tom Tromey <tromey@redhat.com> Date: Mon Aug 1 08:19:47 2011 -0600 use immediately-enclosing block, not linkage block, when uniquifying this should work better when one function is inlined multiple times into another function commit 4a8903151014230999b83552b2fbd0223c7f2601 Author: Tom Tromey <tromey@redhat.com> Date: Sat Jul 30 19:47:41 2011 -0600 use blocks, not minimal symbols, when uniquifying ----------------------------------------------------------------------- Summary of changes: gdb/block.c | 14 ++++++++++++++ gdb/block.h | 2 ++ gdb/symtab.c | 11 +++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) First 500 lines of diff: diff --git a/gdb/block.c b/gdb/block.c index 776ae53..7803c5f 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -80,6 +80,20 @@ block_linkage_function (const struct block *bl) return BLOCK_FUNCTION (bl); } +/* Return the symbol for the function which contains a specified + block, described by a struct block BL. The return value will be + the closest enclosing function, which might be an inline + function. */ + +struct symbol * +block_containing_function (const struct block *bl) +{ + while (BLOCK_FUNCTION (bl) == NULL && BLOCK_SUPERBLOCK (bl) != NULL) + bl = BLOCK_SUPERBLOCK (bl); + + return BLOCK_FUNCTION (bl); +} + /* Return one if BL represents an inlined function. */ int diff --git a/gdb/block.h b/gdb/block.h index 923013c..3e9d909 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -131,6 +131,8 @@ struct blockvector extern struct symbol *block_linkage_function (const struct block *); +extern struct symbol *block_containing_function (const struct block *); + extern int block_inlined_p (const struct block *block); extern int contained_in (const struct block *, const struct block *); diff --git a/gdb/symtab.c b/gdb/symtab.c index 7681c7b..229a1d8 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2325,7 +2325,7 @@ find_pcs_for_symtab_line (struct symtab *symtab, int line) { VEC (CORE_ADDR) *result = NULL; int start = 0, ix; - struct minimal_symbol *previous_function = NULL; + struct symbol *previous_function = NULL; /* First, collect all the PCs that are at this line. */ while (1) @@ -2351,10 +2351,13 @@ find_pcs_for_symtab_line (struct symtab *symtab, int line) function should only appear a single time. */ for (ix = 0; ix < VEC_length (CORE_ADDR, result); ) { - struct minimal_symbol *sym; + struct symbol *sym; + struct block *block; + + block = block_for_pc (VEC_index (CORE_ADDR, result, ix)); + sym = block ? block_containing_function (block) : NULL; - sym = lookup_minimal_symbol_by_pc (VEC_index (CORE_ADDR, result, ix)); - if (sym == previous_function) + if (sym == NULL || sym == previous_function) VEC_ordered_remove (CORE_ADDR, result, ix); else { hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2011-08-01 14:43 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110801144320.15252.qmail@sourceware.org \ --to=tromey@sourceware.org \ --cc=archer-commits@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: linkBe 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).