aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorJason Molenda <jason@molenda.com>2023-06-29 17:01:16 -0700
committerJason Molenda <jason@molenda.com>2023-06-29 17:02:54 -0700
commitad451146e8f59de76e393094d3aafc97a854c40b (patch)
tree158fa9a5053b8c88d73d920db2a5ed5283a947b3 /lldb/source/Commands/CommandObjectTarget.cpp
parent09ea692d166af42cda43bd24d42a6c67a12cce5a (diff)
downloadllvm-ad451146e8f59de76e393094d3aafc97a854c40b.zip
llvm-ad451146e8f59de76e393094d3aafc97a854c40b.tar.gz
llvm-ad451146e8f59de76e393094d3aafc97a854c40b.tar.bz2
Add 'target dump section-load-list' for lldb debugging
A command to dump the Target's SectionLoadList, to debug possible issues with the table. Differential Revision: https://reviews.llvm.org/D154169
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 81a2fe4..2204594 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -5123,6 +5123,29 @@ protected:
}
};
+#pragma mark CommandObjectTargetDumpSectionLoadList
+
+/// Dumps the SectionLoadList of the selected Target.
+class CommandObjectTargetDumpSectionLoadList : public CommandObjectParsed {
+public:
+ CommandObjectTargetDumpSectionLoadList(CommandInterpreter &interpreter)
+ : CommandObjectParsed(
+ interpreter, "target dump section-load-list",
+ "Dump the state of the target's internal section load list. "
+ "Intended to be used for debugging LLDB itself.",
+ nullptr, eCommandRequiresTarget) {}
+
+ ~CommandObjectTargetDumpSectionLoadList() override = default;
+
+protected:
+ bool DoExecute(Args &command, CommandReturnObject &result) override {
+ Target &target = GetSelectedTarget();
+ target.GetSectionLoadList().Dump(result.GetOutputStream(), &target);
+ result.SetStatus(eReturnStatusSuccessFinishResult);
+ return result.Succeeded();
+ }
+};
+
#pragma mark CommandObjectTargetDump
/// Multi-word command for 'target dump'.
@@ -5133,10 +5156,13 @@ public:
: CommandObjectMultiword(
interpreter, "target dump",
"Commands for dumping information about the target.",
- "target dump [typesystem]") {
+ "target dump [typesystem|section-load-list]") {
LoadSubCommand(
"typesystem",
CommandObjectSP(new CommandObjectTargetDumpTypesystem(interpreter)));
+ LoadSubCommand("section-load-list",
+ CommandObjectSP(new CommandObjectTargetDumpSectionLoadList(
+ interpreter)));
}
~CommandObjectTargetDump() override = default;