[all-commits] [llvm/llvm-project] 9af089: Add the ability to show when variables fails to be...

Greg Clayton via All-commits all-commits at lists.llvm.org
Fri Sep 9 16:15:04 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9af089f5179d52c6561ec27532880edcfb6253af
      https://github.com/llvm/llvm-project/commit/9af089f5179d52c6561ec27532880edcfb6253af
  Author: Greg Clayton <gclayton at fb.com>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M lldb/bindings/interface/SBValueList.i
    M lldb/include/lldb/API/SBError.h
    M lldb/include/lldb/API/SBValueList.h
    M lldb/include/lldb/Symbol/SymbolFile.h
    M lldb/include/lldb/Target/StackFrame.h
    M lldb/packages/Python/lldbsuite/test/builders/builder.py
    M lldb/packages/Python/lldbsuite/test/lldbtest.py
    M lldb/source/API/SBFrame.cpp
    M lldb/source/API/SBValueList.cpp
    M lldb/source/Commands/CommandObjectFrame.cpp
    M lldb/source/Core/IOHandlerCursesGUI.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
    M lldb/source/Symbol/Variable.cpp
    M lldb/source/Target/StackFrame.cpp
    M lldb/test/API/commands/frame/var/TestFrameVar.py
    M lldb/test/API/functionalities/archives/Makefile
    M lldb/test/API/functionalities/archives/TestBSDArchives.py

  Log Message:
  -----------
  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




More information about the All-commits mailing list