[lldb] Support debugging utility functions
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 24 Feb 2021 19:04:47 +0000 (11:04 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 24 Feb 2021 19:36:01 +0000 (11:36 -0800)
commit38dfb235db19caa1aaa58c1c8153a7464b932087
treec7d00bfe76e33f69a8df1e4e3e86562081d3e0ed
parent17b4e695ce0ef89eac4a37df2df49d4c0e700766
[lldb] Support debugging utility functions

LLDB uses utility functions to run code in the inferior for its own
internal purposes, such as reading classes from the Objective-C runtime
for example. Because these expressions should be transparent to the
user, we ignore breakpoints and unwind the stack on errors, which
makes them hard to debug.

This patch adds a new setting target.debug-utility-expression that, when
enabled, changes these options to facilitate debugging. It enables
breakpoints, disables unwinding and writes out the utility function
source code to disk so it shows up in the source view.

Differential revision: https://reviews.llvm.org/D97249
lldb/include/lldb/Expression/UtilityFunction.h
lldb/include/lldb/Target/Target.h
lldb/source/Expression/FunctionCaller.cpp
lldb/source/Expression/UtilityFunction.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Target/Target.cpp
lldb/source/Target/TargetProperties.td