public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Use search_domain::FUNCTIONS_DOMAIN when setting breakpoints
Date: Wed, 08 Nov 2017 20:26:00 -0000	[thread overview]
Message-ID: <56d87ef769e6adab27af77fa86ea294ee7c6ee72@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 56d87ef769e6adab27af77fa86ea294ee7c6ee72 ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 56d87ef769e6adab27af77fa86ea294ee7c6ee72

Use search_domain::FUNCTIONS_DOMAIN when setting breakpoints

While working on C++ support for wild matching, I noticed that
attaching to my system's Firefox (which uses .gdb_index), setting a
break at main and bailing, like:

  $ gdb --batch -q -p `pidof firefox` -ex "b main"

would get substancially slower.  It'd take around 20s when currently
it takes 3s.

The problem is that gdb would expand more symtabs than currently,
because Firefox has symbols named like "nsHtml5Atoms::main",
"nsGkAtoms::main", etc., which given wild matching, match.

However, these are not function symbols, [they're "(nsIAtom *)"], so
it seems silly that they'd cause expansion in the first place.

The .gdb_index code (dwarf2read.c:dw2_expand_marked_cus) filters out
symbols matches based on search_domain:

  case VARIABLES_DOMAIN:
    if (symbol_kind != GDB_INDEX_SYMBOL_KIND_VARIABLE)
      continue;
    break;
  case FUNCTIONS_DOMAIN:
    if (symbol_kind != GDB_INDEX_SYMBOL_KIND_FUNCTION)
      continue;
    break;
  case TYPES_DOMAIN:
    if (symbol_kind != GDB_INDEX_SYMBOL_KIND_TYPE)
      continue;
    break;
  default:
    break;

however, we're currently passing down search_domain::ALL_DOMAIN when
we know we're looking for functions, for no good reason.  This patch
fixes that.

It seems like search_domain is underutilized throughout, but I'll
leave using it more for another pass.

gdb/ChangeLog:
2017-11-08  Pedro Alves  <palves@redhat.com>

	* linespec.c (iterate_over_all_matching_symtabs): Add
	search_domain parameter.  Pass it down to expand_symtabs_matching.
	(decode_objc): Request FUNCTIONS_DOMAIN symbols only.
	(lookup_prefix_sym): Adjust by passing ALL_DOMAIN as
	search_domain.
	(add_all_symbol_names_from_pspace): Add search_domain parameter.
	Pass it down.
	(find_method, find_function_symbols): Request FUNCTIONS_DOMAIN
	symbols.
	(add_matching_symbols_to_info): Add search_domain parameter.  Pass
	it down.


             reply	other threads:[~2017-11-08 20:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 20:26 sergiodj+buildbot [this message]
2017-11-08 20:26 ` Failures on Fedora-x86_64-native-gdbserver-m32, branch master sergiodj+buildbot
2017-11-08 20:41 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2017-11-08 20:45 ` *** COMPILATION FAILED *** Failures on Fedora-i686, branch master *** BREAKAGE *** sergiodj+buildbot
2017-11-08 21:04 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master sergiodj+buildbot
2017-11-08 21:08 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2017-11-08 21:13 ` Failures on Fedora-x86_64-m64, " sergiodj+buildbot
2017-11-08 21:19 ` *** COMPILATION FAILED *** Failures on Ubuntu-AArch32-m32, branch master *** BREAKAGE *** sergiodj+buildbot
2017-11-08 21:25 ` *** COMPILATION FAILED *** Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-08 21:31 ` *** COMPILATION FAILED *** Failures on Ubuntu-AArch32-native-gdbserver-m32, " sergiodj+buildbot
2017-11-08 23:43 ` Failures on Ubuntu-AArch64-m64, branch master sergiodj+buildbot

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=56d87ef769e6adab27af77fa86ea294ee7c6ee72@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@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).