aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@fb.com>2022-08-30 15:46:57 -0700
committerGreg Clayton <gclayton@fb.com>2022-09-09 16:14:46 -0700
commit9af089f5179d52c6561ec27532880edcfb6253af (patch)
tree8f7e5edd89afcf9d6f9b0ba3ebc10394cff1317c /lldb/source/Commands/CommandObjectFrame.cpp
parent8e484b522b7a2f72f21632bd30cc858269db6a1f (diff)
downloadllvm-9af089f5179d52c6561ec27532880edcfb6253af.zip
llvm-9af089f5179d52c6561ec27532880edcfb6253af.tar.gz
llvm-9af089f5179d52c6561ec27532880edcfb6253af.tar.bz2
Add the ability to show when variables fails to be available when debug info is valid.
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 Differential Revision: https://reviews.llvm.org/D133164
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index e5d14d6..64bd2c3 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -483,9 +483,14 @@ protected:
// might clear the StackFrameList for the thread. So hold onto a shared
// pointer to the frame so it stays alive.
+ Status error;
VariableList *variable_list =
- frame->GetVariableList(m_option_variable.show_globals);
+ frame->GetVariableList(m_option_variable.show_globals, &error);
+ if (error.Fail() && (!variable_list || variable_list->GetSize() == 0)) {
+ result.AppendError(error.AsCString());
+
+ }
VariableSP var_sp;
ValueObjectSP valobj_sp;