summaryrefslogtreecommitdiff
path: root/lldb/packages
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@fb.com>2022-08-30 15:46:57 -0700
committerGreg Clayton <gclayton@fb.com>2022-09-12 13:59:05 -0700
commit4763200ec95ce6514403176017f29b87757b292a (patch)
treed9c9baa6477a9b940a07584bc7888dc15d43822b /lldb/packages
parent9606608474873da64a870ff40ef042869051feb3 (diff)
downloadllvm-4763200ec95ce6514403176017f29b87757b292a.tar.gz
Add the ability to show when variables fails to be available when debug info is valid.
Summary: Many times when debugging variables might not be available even though a user can successfully set breakpoints and stops somewhere. Letting the user know will help users fix these kinds of issues and have a better debugging experience. Examples of this include: - enabling -gline-tables-only and being able to set file and line breakpoints and yet see no variables - unable to open object file for DWARF in .o file debugging for darwin targets due to modification time mismatch or not being able to locate the N_OSO file. This patch adds an new API to SBValueList: lldb::SBError lldb::SBValueList::GetError(); object so that if you request a stack frame's variables using SBValueList SBFrame::GetVariables(...), you can get an error the describes why the variables were not available. This patch adds the ability to get an error back when requesting variables from a lldb_private::StackFrame when calling GetVariableList. It also now shows an error in response to "frame variable" if we have debug info and are unable to get varialbes due to an error as mentioned above: (lldb) frame variable error: "a.o" object from the "/tmp/libfoo.a" archive: either the .o file doesn't exist in the archive or the modification time (0x63111541) of the .o file doesn't match Reviewers: labath JDevlieghere aadsm yinghuitan jdoerfert sscalpone Subscribers: Differential Revision: https://reviews.llvm.org/D133164
Diffstat (limited to 'lldb/packages')
-rw-r--r--lldb/packages/Python/lldbsuite/test/builders/builder.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py5
2 files changed, 7 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index e260431cad81..3cd48378435e 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -138,13 +138,14 @@ class Builder:
return None
def getBuildCommand(self, debug_info, architecture=None, compiler=None,
- dictionary=None, testdir=None, testname=None):
+ dictionary=None, testdir=None, testname=None, make_targets=None):
debug_info_args = self._getDebugInfoArgs(debug_info)
if debug_info_args is None:
return None
-
+ if make_targets is None:
+ make_targets = ["all"]
command_parts = [
- self.getMake(testdir, testname), debug_info_args, ["all"],
+ self.getMake(testdir, testname), debug_info_args, make_targets,
self.getArchCFlags(architecture), self.getArchSpec(architecture),
self.getCCSpec(compiler), self.getExtraMakeArgs(),
self.getSDKRootSpec(), self.getModuleCacheSpec(),
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 46eac450c6ba..101921ffc768 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1411,7 +1411,8 @@ class Base(unittest2.TestCase):
debug_info=None,
architecture=None,
compiler=None,
- dictionary=None):
+ dictionary=None,
+ make_targets=None):
"""Platform specific way to build binaries."""
if not architecture and configuration.arch:
architecture = configuration.arch
@@ -1426,7 +1427,7 @@ class Base(unittest2.TestCase):
module = builder_module()
command = builder_module().getBuildCommand(debug_info, architecture,
- compiler, dictionary, testdir, testname)
+ compiler, dictionary, testdir, testname, make_targets)
if command is None:
raise Exception("Don't know how to build binary")