llvm-project/lldb
Pavel Labath 90b0a53499 lldb-test symbols: Add ability to do name-based lookup
Summary:
lldb-test already had the ability to dump all symbol information in a
module. This is interesting, but it can be too verbose, and it also does
not use the same APIs that lldb uses to query symbol information. The
last part is interesting to me now, because I am about to add DWARF v5
debug_names support, which needs to implement these APIs.

This patch adds a set of arguments to lldb-test, which modify it's
behavior from dumping all symbols to dumping only the requested
information:
- --find={function,namespace,type,variable} - search for the given
  kind of objects.

- --name - the name to search for.

- --regex - whether to treat the "name" as a regular expression. This is
  not available for all lookup types (we do not have the required APIs
  for namespaces and types).

- --context - specifies the context, which can be used to restrict the
  search. This argument takes a variable name (which must be defined and
  be unique), and we then use the context that this variable is defined
  in as the search context.

- --function-flags={auto,full,base,method,selector} - a set of flags to
  further restrict the search for function symbols.

Together, these flags and their combinations cover the main SymbolFile
entry points which I will need to modify for the accelerator table
support, and so I plan to do most of the regression testing this way.
(I've also found this a useful tool for exploration of what the given
APIs are supposed to do.)

I add a couple of tests to demonstrate the usage of the usage of the
various options, and also an xfailed test which demonstrates a bug I
found while playing with this. The only requirement for these tests is
the presence of lld -- the should run on any platform which is able to
build lldb.

These tests use c++ code as input, but this isn't a requirement. It is also
possible to use IR, assembly or json to create the test module.

Reviewers: davide, zturner, asmith, JDevlieghere, clayborg, alexshap

Subscribers: mgorny, aprantl, lldb-commits

Differential Revision: https://reviews.llvm.org/D46318

llvm-svn: 331447
2018-05-03 10:57:16 +00:00
..
cmake [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687) 2018-03-14 10:08:21 +00:00
docs Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
examples Added a BSD archive tool. 2018-04-02 17:20:21 +00:00
include/lldb lldb-test symbols: Add ability to do name-based lookup 2018-05-03 10:57:16 +00:00
lit lldb-test symbols: Add ability to do name-based lookup 2018-05-03 10:57:16 +00:00
lldb.xcodeproj Fix the Xcode gtest target for the move of FileSpecTest.cpp. 2018-04-20 18:30:31 +00:00
lldb.xcworkspace Fix a typo in the gtest build target for Debug configuration. 2018-04-10 17:49:56 +00:00
packages/Python/lldbsuite Use the UUID from the minidump's CodeView Record for placeholder modules 2018-05-02 20:06:17 +00:00
resources
scripts [Commands] Expose statistics through the SBAPI. 2018-04-16 22:55:34 +00:00
source [NSDictionary] Simplify the formatter. NFCI. 2018-05-02 23:36:07 +00:00
test Revert "[lit] Replace generator expressions in lit.site.cfg" 2018-05-01 17:08:09 +00:00
third_party/Python/module *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
tools lldb-test symbols: Add ability to do name-based lookup 2018-05-03 10:57:16 +00:00
unittests Fix gdb-remote qMemoryRegionInfo unit tests for xml-enabled builds 2018-05-02 17:00:33 +00:00
utils *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
www [docs] Add LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_USE_CUSTOM_CXX_COMPILER to the build and test hmtl pages 2018-04-12 23:29:49 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format Updated .clang-format rules so bring LLDB in line with LLVM standards. 2016-09-06 17:19:00 +00:00
.gitignore [dotest] Remove crashinfo hook 2018-01-10 10:18:47 +00:00
CMakeLists.txt [lit] Update how clang and other binaries are found in per-configuration directories 2018-02-21 00:05:51 +00:00
CODE_OWNERS.txt Remove Sean Callanan from the CODE_OWNERS, he won't have time 2017-11-01 01:38:42 +00:00
INSTALL.txt Changed builld-llvm.py to use .json files 2017-02-23 02:21:34 +00:00
LICENSE.TXT
use_lldb_suite_root.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00