diff options
author | hjk <hjk@theqtcompany.com> | 2016-06-13 16:39:37 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2016-07-12 09:34:55 +0000 |
commit | 16501665527b5107843828e783f0ae27f92390b2 (patch) | |
tree | 40ae7295aa76c641ac20c173805971de0a9805be /src/plugins/debugger/gdb/remotegdbserveradapter.cpp | |
parent | 2c698dff86ac81e720db7e09295ee76ebc934499 (diff) |
Debugger: Expand variables and send extra attach commands in one go
No need to split them on the Creator side.
Change-Id: Ie23b12c537a7375b3bfae56a30291e5971e03e81
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/debugger/gdb/remotegdbserveradapter.cpp')
-rw-r--r-- | src/plugins/debugger/gdb/remotegdbserveradapter.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index d9806d19da..c279a0a9f4 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -278,11 +278,9 @@ void GdbRemoteServerEngine::handleTargetRemote(const DebuggerResponse &response) // gdb server will stop the remote application itself. showMessage("INFERIOR STARTED"); showMessage(msgAttachedToStoppedInferior(), StatusBar); - QString postAttachCommands = stringSetting(GdbPostAttachCommands); - if (!postAttachCommands.isEmpty()) { - foreach (const QString &cmd, postAttachCommands.split(QLatin1Char('\n'))) - runCommand({cmd, NoFlags}); - } + QString commands = expand(stringSetting(GdbPostAttachCommands)); + if (!commands.isEmpty()) + runCommand({commands, NoFlags}); handleInferiorPrepared(); } else { // 16^error,msg="hd:5555: Connection timed out." @@ -296,11 +294,9 @@ void GdbRemoteServerEngine::handleTargetExtendedRemote(const DebuggerResponse &r if (response.resultClass == ResultDone) { showMessage("ATTACHED TO GDB SERVER STARTED"); showMessage(msgAttachedToStoppedInferior(), StatusBar); - QString postAttachCommands = stringSetting(GdbPostAttachCommands); - if (!postAttachCommands.isEmpty()) { - foreach (const QString &cmd, postAttachCommands.split(QLatin1Char('\n'))) - runCommand({cmd, NoFlags}); - } + QString commands = expand(stringSetting(GdbPostAttachCommands)); + if (!commands.isEmpty()) + runCommand({commands, NoFlags}); if (runParameters().attachPID > 0) { // attach to pid if valid // gdb server will stop the remote application itself. runCommand({"attach " + QString::number(runParameters().attachPID), |