Skip to content

Commit

Permalink
0.4.7-pre3
Browse files Browse the repository at this point in the history
  • Loading branch information
haneefdm committed Sep 30, 2021
1 parent 34c5337 commit 3b26d72
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ChangeLog
#V0.4.7
* Fixed a regression for STLink gdbserver. It was in fact accidentally working in prior releases. The real bug is now fixed
* We may have **finally** found a way to exit OpenOCD without having to kill it and OpenOCD not hanging around after the session ends. This is of course dependent on OpenOCD behaving as documented. Thanks to #482 and @bohdan-tymkiv for a solution
* Timestamps for RTT and SWO have been standardized to be of the form `[ISO-Date-Time, +NNNNNNms]` where the first part is the date/time of day and the NNNNNNms is the number of milliseconds elapsed since the debug session began.
* `timestamp` is now an option for SWO console decoders. Default is `false`. A timestamp is output only when a newline is received or a timeout of 5 seconds

#V0.4.6
* Bugfix: Issue #493 In the previous release, we were trying to end OpenOCD using a SIGINT first and then SIGTERM. The way VSCode works, this did not work in production releases. Reverting back to the previous method of just using SIGTERM. Unfortunately. Still looking for a better method to end OpenOCD.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.4.7-pre2",
"version": "0.4.7-pre3",
"activationEvents": [
"onDebugResolve:cortex-debug"
],
Expand Down
31 changes: 12 additions & 19 deletions src/frontend/swo/decoders/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ export class SWOConsoleProcessor implements SWORTTDecoder {
}

private pushOutput(str: string) {
if (this.useTerminal) {
if (this.ptyTerm) {
this.ptyTerm.write(str);
if (str) {
if (this.useTerminal) {
if (this.ptyTerm) {
this.ptyTerm.write(str);
}
} else {
this.output.append(str);
}
} else {
this.output.append(str);
}
}

Expand All @@ -98,21 +100,13 @@ export class SWOConsoleProcessor implements SWORTTDecoder {

const letters = packet.data.toString(this.encoding);

if (this.useTerminal) {
if (this.ptyTerm) {
this.ptyTerm.writeWithHeader(letters, this.createDateHeaderUs());
}
return;
}

// Following stuff will be deprecated soon
for (const letter of letters) {
if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; }

if (letter === '\n') {
this.pushOutput('\n');
this.position = 0;
return;
continue;
}

if (this.position === 0) {
Expand All @@ -122,11 +116,10 @@ export class SWOConsoleProcessor implements SWORTTDecoder {
this.pushOutput(letter);
this.position += 1;

if (this.position >= 80) {
this.pushOutput('\n');
this.position = 0;
}
else {
if (this.timestamp && (this.position > 0)) {
if (this.timeout) {
clearTimeout(this.timeout)
}
this.timeout = setTimeout(() => {
this.pushOutput('\n');
this.position = 0;
Expand Down

0 comments on commit 3b26d72

Please sign in to comment.