summaryrefslogtreecommitdiff
path: root/lldb
AgeCommit message (Collapse)Author
2018-10-01Enable C++ tests to run in the -gmodules configuration on Darwin.Adrian Prantl
This addresses PR36048 (http://llvm.org/bugs/show_bug.cgi?id=36048) rdar://problem/36776281
2018-10-01Fix tests affected by printing change.Jonas Devlieghere
I forgot to update some tests that were affected by the escaping of backticks in the format string, landed in r343471.
2018-10-01Fix build with GCC < 5.0 (PR39131)Tatyana Krasnukha
2018-10-01[lldb] Start a new line for the next output if there are no symbols in the ↵Aaron Smith
current symtab Summary: If there is no newline the "lldb" prompt could be on the wrong line. To reproduce the missing newline you can do 'image dump smytab' on any binary. Previously Symtab, file = D:\upstream\build\Debug\bin\clang-diff.exe, num_symbols = 0(lldb) Now Symtab, file = D:\upstream\build\Debug\bin\clang-diff.exe, num_symbols = 0 (lldb) Reviewers: zturner, aleksandr.urakov, lldb-commits Subscribers: abidh Differential Revision: https://reviews.llvm.org/D52627
2018-10-01[Interpreter] Escape backticks when dumping format entities.Jonas Devlieghere
Currently we reject our own default disassembly-format string because it contains two backticks which causes everything in between to be interpreter as an expression by the command interpreter. This patch fixes that by escaping backticks when dumping format strings.
2018-10-01Escape newlines in default disassembly format.Jonas Devlieghere
We can safely escape newlines in format strings because they will be ignored by the format entity parser.
2018-09-30Fix NetBSD build for r343409Pavel Labath
Forgot to remove the method declaration from the header.
2018-09-30Pull GetSoftwareBreakpointPCOffset into base classPavel Labath
Summary: This function encodes the knowledge of whether the PC points to the breakpoint instruction of the one following it after the breakpoint is "hit". This behavior mainly(*) depends on the architecture and not on the OS, so it makes sense for it to be implemented in the base class, where it can be shared between different implementations (Linux and NetBSD atm). (*) It is possible for an OS to expose a different API, perhaps by doing some fixups in the kernel. In this case, the implementation can override this function to implement custom behavior. Reviewers: krytarowski, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D52532
2018-09-28[SBAPI/Target] Expose SetStatistics(bool enable)/GetStatistics().Davide Italiano
<rdar://problem/44875808>
2018-09-28[Driver] Remove unused declarations and "include" directivesTatyana Krasnukha
2018-09-28Clean-up usage of OptionDefinition arraysTatyana Krasnukha
Differential Revision: https://reviews.llvm.org/D52604
2018-09-28Revert r343318 together with llvm commit r343317Luke Cheeseman
2018-09-28Reapply the changes reverted by r343236Luke Cheeseman
2018-09-28[PDB] Handle `char` as a builtin typeAleksandr Urakov
Summary: `char`, `signed char` and `unsigned char` are three different types, and they are mangled differently: ``` void __declspec(dllexport) /* ?foo@@YAXD@Z */ foo(char c) { } void __declspec(dllexport) /* ?foo@@YAXE@Z */ foo(unsigned char c) { } void __declspec(dllexport) /* ?foo@@YAXC@Z */ foo(signed char c) { } ``` This commit separates `char` from `signed char` and `unsigned char`. Reviewers: asmith, zturner, labath Reviewed By: asmith, zturner Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52468
2018-09-28[lldb] Remove an assertion in RichManglingContext::GetBufferRef() hit when ↵Aaron Smith
debugging a native x86 Windows process Summary: A RichManglingContext constructed with an invalid demangled name or with a demangled function name without any context will have an empty context. This triggers an assertion in RichManglingContext::GetBufferRef() when debugging a native Windows process on x86 when it shouldn't. Remove the assertion. Reviewers: aleksandr.urakov, zturner, lldb-commits Reviewed By: zturner Subscribers: erik.pilkington Differential Revision: https://reviews.llvm.org/D52626
2018-09-27Fixes for GDB remote packet disassembler:Greg Clayton
- Add latency timings to GDB packet log summary if timestamps are on log - Add the ability to plot the latencies for each packet type with --plot - Don't crash the script when target xml register info is in wierd format
2018-09-27Add an interactive mode to BSD archive parser.Greg Clayton
2018-09-27Revert r343193 together with r343192Luke Cheeseman
2018-09-27Update CallFrameString API to account for r343114Luke Cheeseman
- CallFrameString now takes an Arch parameter to account for multiplexing overlapping CFI directives
2018-09-27Refactor ClangUserExpression::GetLanguageForExprRaphael Isemann
Summary: The `ClangUserExpression::GetLanguageForExpr` method is currently a big source of sadness, as it's name implies that it's an accessor method, but it actually is also initializing some variables that we need for parsing. This caused that we currently call this getter just for it's side effects while ignoring it's return value, which is confusing for the reader. This patch renames it to `UpdateLanguageForExpr` and merges all calls to the method into a single call in `ClangUserExpression::PrepareForParsing` (as calling this method is anyway mandatory for parsing to succeed) While looking at the code, I also found that we actually have two language variables in this class hierarchy. The normal `Language` from the UserExpression class and the `LanguageForExpr` that we implemented in this subclass. Both don't seem to actually contain the same value, so we probably should look at this next. Reviewers: xbolva00 Reviewed By: xbolva00 Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D52561
2018-09-27Replace pointer to C-array of PropertyDefinition with llvm::ArrayRefTatyana Krasnukha
Differential Revision: https://reviews.llvm.org/D52572
2018-09-27[target] Fix typo and give bool a default valueJonas Devlieghere
This addresses Stella's review feedback in D51859.
2018-09-27llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song
The convenience wrapper in STLExtras is available since rL342102.
2018-09-26Fix ProcessKDP after r343130Tatyana Krasnukha
2018-09-26Fix OSX build after r343130Tatyana Krasnukha
2018-09-26Replace "nullptr-terminated" C-arrays of OptionValueEnumeration with safer ↵Tatyana Krasnukha
llvm::ArrayRef Differential Revision: https://reviews.llvm.org/D49017
2018-09-26[unittest] Fix NativeProcessProtocolTest.cpp (NFC)Jonas Devlieghere
Cast std::min's second argument to size_t to prevent conflicting types for parameter deduction.
2018-09-26[PDB] Restore the calling convention from PDBAleksandr Urakov
Summary: This patch implements restoring of the calling convention from PDB. It is necessary for expressions evaluation, if we want to call a function of the debuggee process with a calling convention other than ccall. Reviewers: clayborg, zturner, labath, asmith Reviewed By: clayborg Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52501
2018-09-26Fix a memory read bug in lldb-serverPavel Labath
NativeProcessProtocol::ReadMemoryWithoutTrap had a bug, where it failed to properly remove inserted breakpoint opcodes if the memory read partially overlapped the trap opcode. This could not happen on x86 because it has a one-byte breakpoint instruction, but it could happen on arm, which has a 4-byte breakpoint instruction (in arm mode). Since triggerring this condition would only be possible on an arm machine (and even then it would be a bit tricky). I test this using a NativeProcessProtocol unit test.
2018-09-25[lldb-mi] Fix bugs in target-select-so-path.testAlexander Polyakov
Summary: * This patch fixes hanging of the test in case of using python3, changes callback function that will be called if the timer ends, changes python interpreter to `%python` that is set up by llvm-lit. * Also, the test didn't work properly since it didn't contain a call of filecheck_proc.communicate(), that means that filecheck didn't run and its return code was equal to 0 in all cases. Reviewers: teemperor, labath, tatyana-krasnukha, aprantl Reviewed By: teemperor, labath Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D52498
2018-09-25Change the unwinder to not use a hard-coded limit on theJason Molenda
max number of stack frames to backtrace, make it a setting, target.process.thread.max-backtrace-depth. Add a test case for the setting. <rdar://problem/28759559>
2018-09-25[lldbinline] Set directory attribute on test-specific classesVedant Kumar
Set the "mydir" attribute of an inline test on the test-specific class, instead of on the base InlineTest class. This makes it possible to run dotest.py on a directory containing inline tests. This wasn't really possible prior to this patch, because what would happen is that one test would just run over and over again, even though the test infrastructure would claim that different tests were being run. Example: The test infrastructure claimed that all of these different tests were passing, which couldn't be true -- $ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep PASS PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateTailCallSeq) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestArtificialFrameStepOutMessage) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq1) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguatePathsToCommonSink) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateCallSite) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestUnambiguousTailCalls) PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq2) RESULT: PASSED (7 passes, 0 failures, 0 errors, 24 skipped, 0 expected failures, 0 unexpected successes) ... because it wasn't even looking at some of these tests: $ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep "Change dir" Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 E.g it was only building one of them: $ ls lldb-test-build.noindex/functionalities/tail_call_frames/                         ambiguous_tail_call_seq2 Differential Revision: https://reviews.llvm.org/D52516
2018-09-25XFAIL some tests in TestTargetCreateDeps on linuxPavel Labath
On linux, we do not support automatic loading of dependent modules, so the module list will always contain just one module (until the target is launched).
2018-09-25Replace boolean parameter with enum value according r342633Tatyana Krasnukha
2018-09-25[Swig] Merge typemaps with same bodiesTatyana Krasnukha
Differential Revision: https://reviews.llvm.org/D52376
2018-09-24[lldb-mi] Fix hanging of target-select-so-path.testAlexander Polyakov
Summary: The target-select-so-path test might hang on some platforms. The reason of that behavior was in incorrect usage of Filecheck and lldb-mi processes. Instead of redirecting lldb-mi's output to Filecheck, we should run lldb-mi session, finish the session, collect its output and then pass it to Filecheck. Also, this patch adds a timer to the test to prevent it from hanging in the future. Reviewers: tatyana-krasnukha, aprantl, teemperor Reviewed By: tatyana-krasnukha, teemperor Subscribers: apolyakov, aprantl, teemperor, ki.stfu, abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D52139
2018-09-24Add NativeProcessProtocol unit testsPavel Labath
Summary: NativeProcessProtocol is an abstract class, but it still contains a significant amount of code. Some of that code is tested via tests of specific derived classes, but these tests don't run everywhere, as they are OS and arch-specific. They are also relatively high-level, which means some functionalities (particularly the failure cases) are hard/impossible to test. In this approach, I replace the abstract methods with mocks, which allows me to inject failures into the lowest levels of breakpoint setting code and test the class behavior in this situation. Reviewers: zturner, teemperor Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D52152
2018-09-22Change type of m_user_expression_start_pos to size_tRaphael Isemann
AbsPosToLineColumnPos is the only reader of m_user_expression_start_pos and actually treats it like a size_t. Also the value we store in m_user_expression_start_pos is originally a size_t, so it makes sense to change the type of this variable to size_t.
2018-09-21Move architecture-specific address adjustment to architecture pluginsTatyana Krasnukha
Differential Revision: https://reviews.llvm.org/D48623
2018-09-21build: add libedit to include pathsTatyana Krasnukha
Differential Revision: https://reviews.llvm.org/D51999
2018-09-21Add dependency on llc required by find-variable-dwo testTatyana Krasnukha
2018-09-21Skip test if gcc version is less than 7.1 since it doesn't support ↵Tatyana Krasnukha
-gcolumn-info option
2018-09-20[lldbtest] Fix self.filecheck check file lookupVedant Kumar
The 'test_filename' property in TestBase changes over time, so attempting to find a check file relative to the directory containing 'test_filename' is flaky. Use the absolute path of the check file as that's always correct (and simpler). This relies on the test driver changing into the test directory, which it seems we can safely assume. As a drive-by, make self.filecheck respect the trace (-t) option.
2018-09-20Replace boolean parameter with enum value according r342633Tatyana Krasnukha
2018-09-20Refactor FindVariable() core functionality into StackFrame out of SBFrameShafik Yaghmour
rdar://problem/14365983 Patch by Shafik Yaghmour Differential Revision: https://reviews.llvm.org/D52247
2018-09-20[target] Change target create's behavior wrt loading dependent files.Jonas Devlieghere
When creating a target, lldb loads all dependent files (i.e. libs in LC_LOAD_DYLIB for Mach-O). This can be confusing, especially when two versions of the same library end up in the shared cache. It's possible to change this behavior, by specifying target create -d <target> these dependents are not loaded. This patch changes the default behavior to only load dependent files only when the target is an executable. When creating a target for a library, it is now no longer necessary to pass -d. The user can still override this behavior by specifying the -d option to change this behavior. rdar://problem/43721382 Differential revision: https://reviews.llvm.org/D51934
2018-09-20[NFC] Turn "load dependent files" boolean into an enumJonas Devlieghere
This is an NFC commit to refactor the "load dependent files" parameter from a boolean to an enum value. We want to be able to specify a default, in which case we decide whether or not to load the dependent files based on whether the target is an executable or not (i.e. a dylib). This is a dependency for D51934. Differential revision: https://reviews.llvm.org/D51859
2018-09-19[DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour
rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520
2018-09-18Allow use of self.filecheck in LLDB tests (c.f self.expect)Vedant Kumar
Add a "filecheck" method to the LLDB test base. This allows test authors to pattern match command output using FileCheck, making it possible to write stricter tests than what `self.expect` allows. For context (motivation, examples of stricter checking, etc), see the lldb-dev thread: "Using FileCheck in lldb inline tests". Differential Revision: https://reviews.llvm.org/D50751
2018-09-17Revert "[DataFormatters] Add formatter for C++17 std::variant"Shafik Yaghmour
This reverts commit r342421. Because it breaks build bot http://green.lab.llvm.org/green/job/lldb-cmake-clang-5.0.2//418/console