aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorJason Molenda <jason@molenda.com>2020-08-25 20:53:01 -0700
committerJason Molenda <jason@molenda.com>2020-08-25 20:53:59 -0700
commit99d187a003c9bd4bdc42c17e5563bd80f4e159e9 (patch)
tree9ab83114301f5d8ef95fff725ad03152920c51c5 /lldb/source/Commands/CommandObjectTarget.cpp
parent72bdb41a06a27b5453bf966a0ffecfa6f5fae1a6 (diff)
downloadllvm-99d187a003c9bd4bdc42c17e5563bd80f4e159e9.zip
llvm-99d187a003c9bd4bdc42c17e5563bd80f4e159e9.tar.gz
llvm-99d187a003c9bd4bdc42c17e5563bd80f4e159e9.tar.bz2
Update UnwindPlan dump to list if it is a trap handler func; also Command
Update the "image show-unwind" command output to show if the function being shown is listed as a user-setting or platform trap handler. Update the individual UnwindPlan dumps to show whether the unwind plan is registered as a trap handler.
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index b6af481..30fdaf9 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -3421,10 +3421,35 @@ protected:
continue;
result.GetOutputStream().Printf(
- "UNWIND PLANS for %s`%s (start addr 0x%" PRIx64 ")\n\n",
+ "UNWIND PLANS for %s`%s (start addr 0x%" PRIx64 ")\n",
sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(),
funcname.AsCString(), start_addr);
+ Args args;
+ target->GetUserSpecifiedTrapHandlerNames(args);
+ size_t count = args.GetArgumentCount();
+ for (size_t i = 0; i < count; i++) {
+ const char *trap_func_name = args.GetArgumentAtIndex(i);
+ if (strcmp(funcname.GetCString(), trap_func_name) == 0)
+ result.GetOutputStream().Printf(
+ "This function is "
+ "treated as a trap handler function via user setting.\n");
+ }
+ PlatformSP platform_sp(target->GetPlatform());
+ if (platform_sp) {
+ const std::vector<ConstString> trap_handler_names(
+ platform_sp->GetTrapHandlerSymbolNames());
+ for (ConstString trap_name : trap_handler_names) {
+ if (trap_name == funcname) {
+ result.GetOutputStream().Printf(
+ "This function's "
+ "name is listed by the platform as a trap handler.\n");
+ }
+ }
+ }
+
+ result.GetOutputStream().Printf("\n");
+
UnwindPlanSP non_callsite_unwind_plan =
func_unwinders_sp->GetUnwindPlanAtNonCallSite(*target, *thread);
if (non_callsite_unwind_plan) {