From d6f351b689ed5fd91af94f695ab753ba6d8897d9 Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Thu, 5 May 2016 17:50:54 +1000 Subject: [PATCH] BareMetal: Fix broken remote setup After 62c6a07445414218ec4b8776893c084c08596cc8 BareMetalDebugSupport() object creates on stack and destroys on expression end. So, remote setup does not work. Simple create it on heap. It will be cleaned up when RunControl object destroys. Change-Id: I7565d22e27e158d57a4764111befe74892b64356 Reviewed-by: Orgad Shaneh Reviewed-by: hjk --- src/plugins/baremetal/baremetalruncontrolfactory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp index 6ca56bd9724..abe98cdb1d8 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp +++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp @@ -135,9 +135,8 @@ RunControl *BareMetalRunControlFactory::create( sp.remoteSetupNeeded = true; DebuggerRunControl *runControl = createDebuggerRunControl(sp, rc, errorMessage, mode); - if (runControl && sp.remoteSetupNeeded) { - (void) BareMetalDebugSupport(runControl); - } + if (runControl && sp.remoteSetupNeeded) + new BareMetalDebugSupport(runControl); return runControl; }