summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-06-20 23:40:21 +0000
committerEnrico Granata <egranata@apple.com>2013-06-20 23:40:21 +0000
commitaad8e480549bc3e23b172534c2b6b8ffcf0425a2 (patch)
treec27d6eec9d63c1fca281cb65811823c00f3da114 /lldb/source/Core/Debugger.cpp
parentd6c62b66b5eefc61d8891332b549cd2983ebfc13 (diff)
downloadbcm5719-llvm-aad8e480549bc3e23b172534c2b6b8ffcf0425a2.tar.gz
bcm5719-llvm-aad8e480549bc3e23b172534c2b6b8ffcf0425a2.zip
In thread and frame format strings, it is now allowed to use Python functions to generate part or all of the output text
Specifically, the ${target ${process ${thread and ${frame specifiers have been extended to allow a subkeyword .script:<fctName> (e.g. ${frame.script:FooFunction}) The functions are prototyped as def FooFunction(Object,unused) where object is of the respective SB-type (SBTarget for target.script, ... and so on) This has not been implemented for ${var because it would be akin to a Python summary which is already well-defined in LLDB llvm-svn: 184500
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 45c2b0578f2..2be1dbbafa0 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1801,6 +1801,24 @@ FormatPromptRecurse
}
}
}
+ else if (::strncmp(var_name_begin, "script:", strlen("script:")) == 0)
+ {
+ var_name_begin += ::strlen("script:");
+ std::string script_name(var_name_begin,var_name_end);
+ ScriptInterpreter* script_interpreter = process->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
+ if (script_interpreter)
+ {
+ std::string script_output;
+ Error script_error;
+ if (script_interpreter->RunScriptFormatKeyword(script_name.c_str(), process,script_output,script_error) && script_error.Success())
+ {
+ s.Printf("%s", script_output.c_str());
+ var_success = true;
+ }
+ else
+ s.Printf("<error: %s>",script_error.AsCString());
+ }
+ }
}
}
}
@@ -1870,6 +1888,24 @@ FormatPromptRecurse
}
}
}
+ else if (::strncmp(var_name_begin, "script:", strlen("script:")) == 0)
+ {
+ var_name_begin += ::strlen("script:");
+ std::string script_name(var_name_begin,var_name_end);
+ ScriptInterpreter* script_interpreter = thread->GetProcess()->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
+ if (script_interpreter)
+ {
+ std::string script_output;
+ Error script_error;
+ if (script_interpreter->RunScriptFormatKeyword(script_name.c_str(), thread,script_output,script_error) && script_error.Success())
+ {
+ s.Printf("%s", script_output.c_str());
+ var_success = true;
+ }
+ else
+ s.Printf("<error: %s>",script_error.AsCString());
+ }
+ }
}
}
}
@@ -1911,6 +1947,24 @@ FormatPromptRecurse
var_success = true;
}
}
+ else if (::strncmp(var_name_begin, "script:", strlen("script:")) == 0)
+ {
+ var_name_begin += ::strlen("script:");
+ std::string script_name(var_name_begin,var_name_end);
+ ScriptInterpreter* script_interpreter = target->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
+ if (script_interpreter)
+ {
+ std::string script_output;
+ Error script_error;
+ if (script_interpreter->RunScriptFormatKeyword(script_name.c_str(), target,script_output,script_error) && script_error.Success())
+ {
+ s.Printf("%s", script_output.c_str());
+ var_success = true;
+ }
+ else
+ s.Printf("<error: %s>",script_error.AsCString());
+ }
+ }
}
}
break;
@@ -2018,6 +2072,24 @@ FormatPromptRecurse
}
}
}
+ else if (::strncmp(var_name_begin, "script:", strlen("script:")) == 0)
+ {
+ var_name_begin += ::strlen("script:");
+ std::string script_name(var_name_begin,var_name_end);
+ ScriptInterpreter* script_interpreter = frame->GetThread()->GetProcess()->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
+ if (script_interpreter)
+ {
+ std::string script_output;
+ Error script_error;
+ if (script_interpreter->RunScriptFormatKeyword(script_name.c_str(), frame,script_output,script_error) && script_error.Success())
+ {
+ s.Printf("%s", script_output.c_str());
+ var_success = true;
+ }
+ else
+ s.Printf("<error: %s>",script_error.AsCString());
+ }
+ }
}
}
}
OpenPOWER on IntegriCloud