Skip to content

Commit

Permalink
pyocd: update and refactor gdbserver started message.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Reed <flit@me.com>
  • Loading branch information
flit committed Jan 5, 2021
1 parent d086a89 commit 3d6f98f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static String[] getGdbServerCommandLineArray(ILaunchConfiguration configu
// Added as a marker, it is displayed if the configuration was processed
// properly.
lst.add("-c");
lst.add("echo \"Started by GNU MCU Eclipse\"");
lst.add("echo \"" + getGdbServerStartedMessage() + "\"");

return lst.toArray(new String[0]);
}
Expand Down Expand Up @@ -413,6 +413,10 @@ public static boolean getDoAddSemihostingConsole(ILaunchConfiguration config) th
&& config.getAttribute(ConfigurationAttributes.DO_GDB_SERVER_ALLOCATE_SEMIHOSTING_CONSOLE,
DefaultPreferences.DO_GDB_SERVER_ALLOCATE_SEMIHOSTING_CONSOLE_DEFAULT);
}

public static String getGdbServerStartedMessage() {
return "Started by Eclipse Embedded CDT";
}

// ------------------------------------------------------------------------
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,14 @@ public boolean canMatchStdErr() {
return true;
}

public boolean matchStdErrExpectedPattern(String line) {
if (line.indexOf("Started by GNU ARM Eclipse") >= 0 || line.indexOf("Started by GNU MCU Eclipse") >= 0) {
return true;
}
public boolean matchStdOutExpectedPattern(String line) {
String message = Configuration.getGdbServerStartedMessage();
return (line.indexOf(message) >= 0);
}

return false;
public boolean matchStdErrExpectedPattern(String line) {
String message = Configuration.getGdbServerStartedMessage();
return (line.indexOf(message) >= 0);
}

/**
Expand Down

0 comments on commit 3d6f98f

Please sign in to comment.