Commit Graph

623 Commits

Author SHA1 Message Date
David Spickett 9f052f3dd2 [lldb] Require x86 target for NativePDB test
This test would fail if you only build for example,
just the AArch64 backend, due to the x86 triple.
2022-03-18 12:31:03 +00:00
Jonas Devlieghere 7ed1abd4a6
[lldb] Skip invalid-condition.test on Windows
This test is making the Windows bot unhappy. Unfortunately the output
doesn't tell me much about what exactly is wrong.
2022-03-17 08:34:12 -07:00
Jonas Devlieghere d10c0c7b18
[lldb] Migrate condition evaluation failure to ReportError
Migrate to using ReportError to report a failure to evaluate a
watchpoint condition. I had already done so for the parallel code for
breakpoints.

In the process, I noticed that I accidentally regressed the error
reporting for breakpoint conditions by dropping the call to
GetDescription. This patch rectifies that and adds a test.

Because the call to GetDescription expects a Stream*, I also switches
from using a raw_string_ostream to a StreamString for both breakpoints
and watchpoints.
2022-03-16 22:54:02 -07:00
Jonas Devlieghere 8212b41b7b
[lldb] Fix flakiness in command-disassemble-process.yaml (2/2)
I split up the test so we could stop redirecting stderr to stdout but I
forgot to include that part in the previous commit.
2022-03-16 22:12:39 -07:00
Jonas Devlieghere 557a0e7b96
[lldb] Fix flakyness in command-disassemble-process.yaml 2022-03-16 21:27:54 -07:00
Jonas Devlieghere 8e893dfed5
[lldb] Fix flakyness in Minidump/no-process-id.yaml 2022-03-16 21:21:11 -07:00
Med Ismail Bennani 0a65112cf7 [lldb/crashlog] Create artificial frames for non-crashed scripted threads
This patch pipes down the `-a|--load-all` crashlog command option to the
Scripted Process initializer to load all the images used by crashed
process instead of only loading the images related to the crashed
thread.

This allows us to recreate artificial frames also for the non-crashed
scripted threads.

rdar://90396265

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-16 15:50:10 -07:00
Jonas Devlieghere 3f0e050842
[lldb] Fix Minidump/no-process-id.yaml
Update warning after 2fc38b2b7b.
2022-03-16 09:32:06 -07:00
Sam McCall 75acad41bc Use lit_config.substitute instead of foo % lit_config.params everywhere
This mechanically applies the same changes from D121427 everywhere.

Differential Revision: https://reviews.llvm.org/D121746
2022-03-16 09:57:41 +01:00
Zequan Wu 384e890dd3 [LLDB][NativePDB] Remove REQUIRES: system-windows for local-variables-regsiters.s 2022-03-15 17:49:46 -07:00
Zequan Wu 583223cd5e [LLDB][NativePDB] Don't complete static members' types when completing a record type.
`UdtRecordCompleter` shouldn't complete static members' types. static members' types are going to be completed when the types are called in `SymbolFile::CompleteType`.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121030
2022-03-15 14:06:54 -07:00
Shafik Yaghmour 6583f01707 [LLDB] Fixing DWARFExpression handling of ValueType::FileAddress case for DW_OP_deref_size
Currently DW_OP_deref_size just drops the ValueType::FileAddress case and does
not attempt to handle it. This adds support for this case and a test that
verifies this support.

I did a little refactoring since DW_OP_deref and DW_OP_deref_size have some
overlap in code.

Also see: rdar://66870821

Differential Revision: https://reviews.llvm.org/D121408
2022-03-15 09:36:20 -07:00
Ayush Sahay d506a9ef2b [lldb] Require native for command-thread-siginfo.test
command-thread-siginfo.test employs a subject with a call to wait, and
thus requires system-linux. However, it's possible to target non-Linux
platforms despite operating on Linux hosts. So, have it require native
too.

Reviewed By: mgorny, labath

Differential Revision: https://reviews.llvm.org/D121487
2022-03-14 21:20:21 +05:30
Petr Hosek 0c0f6cfb7b [CMake] Rename TARGET_TRIPLE to LLVM_TARGET_TRIPLE
This clarifies that this is an LLVM specific variable and avoids
potential conflicts with other projects.

Differential Revision: https://reviews.llvm.org/D119918
2022-03-11 15:43:01 -08:00
Zequan Wu 5e9c9b324a [LLDB][NativePDB] Add support for S_DEFRANGE_REGISTER and S_DEFRANGE_SUBFIELD_REGISTER
Differential Revision: https://reviews.llvm.org/D119508
2022-03-10 12:40:31 -08:00
Med Ismail Bennani 8d097a6b93 [lldb/crashlog] Make interactive mode display more user-friendly
This patch makes the crashlog interactive mode show the scripted process
status with the crashed scripted thread backtrace after launching it.

rdar://89634338

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-10 11:06:59 -08:00
Pavel Labath acf77bd2fd [lldb] Don't print *trailing* nuls in char arrays
Embedded nul characters are still printed, and they don't terminate the
string. See also D111634.

Differential Revision: https://reviews.llvm.org/D120803
2022-03-09 14:31:17 +01:00
Pavel Labath 8f6ee17f22 [lldb] Warn when we fail to find dwo/dwp files
This ensures that the user is aware that many commands will not work
correctly.

We print the warning only once (per module) to avoid spamming the user
with potentially thousands of error messages.

Differential Revision: https://reviews.llvm.org/D120892
2022-03-09 14:31:17 +01:00
Jonas Devlieghere 34eb15b5c3
[lldb] Remove reproducer verifier and corresponding command
This removes the reproducer verifier and the corresponding `reproducer
verify` subcommand.
2022-03-03 11:21:00 -08:00
Zequan Wu 15983c28aa [LLDB] Dump valid ranges of variables
This allows `image lookup -a ... -v` to print variables only if the given
address is covered by the valid ranges of the variables. Since variables created
in dwarf plugin always has empty scope range, print the variable if it has
empty scope.

Differential Revision: https://reviews.llvm.org/D119963
2022-03-02 13:44:19 -08:00
Jason Molenda daba823622 Refine error msgs from CommandObject & Disassemble
Make it clearer for end users why a command cannot be used
when a process is not stopped, etc.

Differential Revision: https://reviews.llvm.org/D120594
2022-03-02 11:17:48 -08:00
Nikita Popov 8dcb5e6bf5 Revert "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"
See post-commit discussion on https://reviews.llvm.org/D120305.
This change breaks the clang-ppc64le-rhel buildbot, though
there is suspicion that it's an issue with the bot. The change
also had a larger than expected impact on compile-time and
code-size.

This reverts commit 3c4ed02698
and some followup changes.
2022-02-26 15:32:49 +01:00
Med Ismail Bennani badb6e2730 [lldb/crashlog] Fix scripted_crashlog_json.test failure
This patch should fix the test failure on scripted_crashlog_json.test.

The failure is happening because crash reporter will obfuscate the
executable path in the crashlog, if it is located inside the user's
home directory and replace it with `/USER/*/` as a placeholder.

To fix that, we can patch the placeholder with the executable path
before loading the crashlog in lldb.

This also fixes a bug where we would create another target when loading
the crashlog in a scripted process, even if lldb already had a target
for it. Now, crashlog will only create a target if there is none in lldb.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-25 17:20:35 -08:00
Muhammad Omair Javaid 317a2b1f60 [LLDB] Remove XFAIL from minidebuginfo-set-and-hit-breakpoint.test
This patch removes XFAIL from minidebuginfo-set-and-hit-breakpoint.test.
Test started passing after 3c4ed02698.

Differential Revision: https://reviews.llvm.org/D120305
2022-02-25 15:55:05 +05:00
Med Ismail Bennani d95961f214 [lldb/test] Disable scripted_crashlog_json.test on non darwin aarch64 systems
This patch adds requirement for the `scripted_crashlog_json` test to
make sure it only runs on apple silicon systems.

This should fix the following green dragon failure:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/41454

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-16 13:51:53 -08:00
Med Ismail Bennani 7c54ffdc6c [lldb/crashlog] Add CrashLogScriptedProcess & remove interactive mode
This patch introduces a new type of ScriptedProcess: CrashLogScriptedProcess.
It takes advantage of lldb's crashlog parsers and Scripted Processes to
reconstruct a static debugging session with symbolicated stackframes, instead
of just dumping out everything in the user's terminal.

The crashlog command also has an interactive mode that only provide a
very limited experience. This is why this patch removes all the logic
for this interactive mode and creates CrashLogScriptedProcess instead.

This will fetch and load all the libraries that were used by the crashed
thread and re-create all the frames artificially.

rdar://88721117

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-16 11:44:07 -08:00
Muhammad Omair Javaid 73a961b9cc [LLDB] Port toolchain-msvc.test for Arm/AArch4 Windows
This patch updates toolchain-msvc.test to cater for Arm64 windows platform.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D117676
2022-02-09 17:40:39 +05:00
Dave Lee f8d889a789 [lldb] Print message after loading 'crashlog' command
Previously, importing `crashlog` resulted in a message being printed. The
message was about other commands (those in heap.py), not `crashlog`. The
changes in D117237 made it so that the heap.py messages were printed only when
importing `lldb.macosx.heap`, not when importing `lldb.macosx.crashlog`. Some
users may see no output and think `crashlog` wasn't successfully loaded. This
ensures users see that `crashlog` is loaded.

rdar://88283132

Differential Revision: https://reviews.llvm.org/D119155
2022-02-07 12:34:12 -08:00
Jonas Devlieghere a5a71b139c [lldb] Fix Lua/watchpoint_callback.test on Apple Silicon
As Pavel pointed out, on Apple Silicon "b main" stops at a point after
the variable has already been initialized. This patch updates the test
case to avoids that. I've also split the test into separate files so its
easier to reproduce the individual scenarios without having to build any
shared state.
2022-02-07 12:08:24 -08:00
Zequan Wu f3e1ba1d03 [LLDB] add sub regigter enums on x64 Windows
Differential Revision: https://reviews.llvm.org/D118750
2022-02-02 14:21:08 -08:00
Michał Górny 287ce6b516 [lldb] [Commands] Implement "thread siginfo"
Differential Revision: https://reviews.llvm.org/D118473
2022-02-02 19:31:44 +01:00
Jonas Devlieghere d329dfd0c8 [lldb] Use the build's python interpreter in the shell tests
Make sure that the shell tests use the same python interpreter as the
rest of the build instead of picking up `python` from the PATH.

It would be nice if we could use the _disallow helper, but that triggers
on invocations that specify python as the scripting language.
2022-01-31 16:53:42 -08:00
Jonas Devlieghere e1cad1303b [lldb] Support Rosetta registers in crashlog.py
Rosetta crashlogs can have their own thread register state. Unlike the
other registers which ware directly listed under "threadState", the
Rosetta registers are nested under their own key in the JSON, as
illustrated below:

  {
      "threadState":
      {
          "rosetta":
          {
              "tmp2":
              {
                  "value": 4935057216
              },
              "tmp1":
              {
                  "value": 4365863188
              },
              "tmp0":
              {
                  "value": 18446744073709551615
              }
          }
      }
  }
2022-01-31 10:50:16 -08:00
Pavel Labath 4cd8877a34 [lldb/test] Fix gnu-style-compression.yaml
In the rush to get the bot green, I did not realize I was building the
file with -gsplit-dwarf, and therefore the yaml ended up referring to a
file I did not check it.

This rebuilds the file without split dwarf.
2022-01-27 10:23:21 +01:00
Pavel Labath aaa9f40e3f [lldb/test] Replace gnu-style-compression.cpp with a yaml file
In D117744, llvm removed writing support for this format, breaking the
test. We may eventually want to remove reading support as well, but for
now I have converted the test to a yaml file to maintain coverage.
2022-01-27 10:05:05 +01:00
David Blaikie 8b280df504 Rough guess at fixing lldb tests to handle Clang defaulting to DWARFv5 2022-01-23 21:24:25 -08:00
TCWG 9c4e93c71a [LLDB] Adjust compiler-full-path.test for Windows/Arm64
This patch updates compiler-full-path.test to make sure it passes on
Windows Arm64 platform with MSVC.
2022-01-19 19:47:03 +05:00
Zequan Wu f00cd23cae Revert "Revert "[LLDB][NativePDB] Add support for inlined functions""
This reland 945aa520ef with fixes.

This reverts commit 10bc3362a1.
2022-01-13 14:00:24 -08:00
Stella Stamenova 10bc3362a1 Revert "[LLDB][NativePDB] Add support for inlined functions"
This reverts commit 945aa520ef.

This commit broke the windows lldb bot.
2022-01-12 08:53:19 -08:00
Zequan Wu 945aa520ef [LLDB][NativePDB] Add support for inlined functions
This adds inline function support to NativePDB by parsing S_INLINESITE records
to retrieve inlinee line info and add them into line table at `ParseLineTable`.

Differential Revision: https://reviews.llvm.org/D116845
2022-01-11 16:10:39 -08:00
Jonas Devlieghere 4609e30f50 [lldb] Remove lldb-instr 2022-01-10 11:48:16 -08:00
Dave Lee 268a42d697 [lldb] Require x86 support for dwo-relative-path test 2022-01-09 21:35:32 -08:00
Jonas Devlieghere ab7618914d [lldb] Use lit_config.note to print module cache message 2022-01-07 13:35:18 -08:00
Zequan Wu d5b6e30ed3 [LLDB][Clang] add AccessSpecDecl for methods and fields in RecordType
This allows access type be printed when running `lldb-test -dump-ast` and
`lldb-test -dump-clang-ast`.

Differential Revision: https://reviews.llvm.org/D115062
2022-01-04 13:50:24 -08:00
Greg Clayton 48207b2559 Fix "settings set -g" so it works again.
When we switched options over to use the Options.td file, a bug was introduced that caused the "-g" option for "settings set" to require a filename arguemnt. This patch fixes this issue and adds a test so this doesn't regress.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D116012
2021-12-28 11:03:09 -08:00
Jonas Devlieghere fa1260697e [lldb] Remove reproducer replay functionality
This is part of a bigger rework of the reproducer feature. See [1] for
more details.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
2021-12-17 17:14:52 -08:00
Jonas Devlieghere 67bc243535 [lldb] Remove --reproducer-finalize and associated functionality
This is part of a bigger rework of the reproducer feature. See [1] for
more details.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
2021-12-17 12:19:55 -08:00
Stella Stamenova f4abf28c0a [lldb] Update the PDB tests to pass with the VS2019 toolset
The pdb lldb tests do not work correctly with both the VS2019 and VS2017 toolsets at the moment. This change updates several of the tests to work with both toolsets. Unfortunately, this makes the tests suboptimal for both toolsets, but we can update them to be better for VS2019 once we officially drop VS2017. This change is meant to bridge the gap until the update happens, so that the buildbots can work with either toolset.

Differential Revision: https://reviews.llvm.org/D115482
2021-12-14 13:06:07 -08:00
Jonas Devlieghere 100863ccd8 [lldb] Check if language is supported before creating a REPL instance
Currently, we'll try to instantiate a ClangREPL for every known
language. The plugin manager already knows what languages it supports,
so rely on that to only instantiate a REPL when we know the requested
language is supported.

rdar://86439474

Differential revision: https://reviews.llvm.org/D115698
2021-12-14 12:05:35 -08:00
Zequan Wu a3a8ed33a1 [LLDB][NativePDB] Fix function decl creation for class methods
This is a split of D113724. Calling `TypeSystemClang::AddMethodToCXXRecordType`
to create function decls for class methods.

Differential Revision: https://reviews.llvm.org/D113930
2021-12-07 10:41:28 -08:00