Added debugger attachment utilities to the engine, fixed crash when showing console variables, improvements to timeout handling and small cleanup (#3591)

* Added debugger attachment utilities to the engine, fixed crash when showing console variables

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Removed unused variables

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Removed unneded check

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Small fix for crashes/timeouts

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Removed unused variable, fixed compile error

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Fix compile

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Addressed esteban comments

* Addressed tom comments

Co-authored-by: Garcia Ruiz <aljanru@amazon.co.uk>
This commit is contained in:
AMZN-AlexOteiza
2021-08-31 09:27:14 +01:00
committed by GitHub
parent 9752fb009a
commit d784ff8c57
9 changed files with 210 additions and 38 deletions
+13
View File
@@ -401,6 +401,16 @@ inline namespace Commands
{
return static_cast<int>(GetIEditor()->GetEditorConfigPlatform());
}
bool PyAttachDebugger()
{
return AZ::Debug::Trace::AttachDebugger();
}
bool PyWaitForDebugger(float timeoutSeconds = -1.f)
{
return AZ::Debug::Trace::WaitForDebugger(timeoutSeconds);
}
}
namespace AzToolsFramework
@@ -448,6 +458,9 @@ namespace AzToolsFramework
addLegacyGeneral(behaviorContext->Method("start_process_detached", PyStartProcessDetached, nullptr, "Launches a detached process with an optional space separated list of arguments."));
addLegacyGeneral(behaviorContext->Method("launch_lua_editor", PyLaunchLUAEditor, nullptr, "Launches the Lua editor, may receive a list of space separate file paths, or an empty string to only open the editor."));
addLegacyGeneral(behaviorContext->Method("attach_debugger", PyAttachDebugger, nullptr, "Prompts for attaching the debugger"));
addLegacyGeneral(behaviorContext->Method("wait_for_debugger", PyWaitForDebugger, behaviorContext->MakeDefaultValues(-1.f), "Pauses this thread execution until the debugger has been attached"));
// this will put these methods into the 'azlmbr.legacy.checkout_dialog' module
auto addCheckoutDialog = [](AZ::BehaviorContext::GlobalMethodBuilder methodBuilder)
{