Skip to content

Commit 3b26d72

Browse files
committed
0.4.7-pre3
1 parent 34c5337 commit 3b26d72

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ ChangeLog
33
#V0.4.7
44
* Fixed a regression for STLink gdbserver. It was in fact accidentally working in prior releases. The real bug is now fixed
55
* 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
6+
* 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.
7+
* `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
68

79
#V0.4.6
810
* 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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.4.7-pre2",
2+
"version": "0.4.7-pre3",
33
"activationEvents": [
44
"onDebugResolve:cortex-debug"
55
],

src/frontend/swo/decoders/console.ts

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ export class SWOConsoleProcessor implements SWORTTDecoder {
7676
}
7777

7878
private pushOutput(str: string) {
79-
if (this.useTerminal) {
80-
if (this.ptyTerm) {
81-
this.ptyTerm.write(str);
79+
if (str) {
80+
if (this.useTerminal) {
81+
if (this.ptyTerm) {
82+
this.ptyTerm.write(str);
83+
}
84+
} else {
85+
this.output.append(str);
8286
}
83-
} else {
84-
this.output.append(str);
8587
}
8688
}
8789

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

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

101-
if (this.useTerminal) {
102-
if (this.ptyTerm) {
103-
this.ptyTerm.writeWithHeader(letters, this.createDateHeaderUs());
104-
}
105-
return;
106-
}
107-
108-
// Following stuff will be deprecated soon
109103
for (const letter of letters) {
110104
if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; }
111105

112106
if (letter === '\n') {
113107
this.pushOutput('\n');
114108
this.position = 0;
115-
return;
109+
continue;
116110
}
117111

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

125-
if (this.position >= 80) {
126-
this.pushOutput('\n');
127-
this.position = 0;
128-
}
129-
else {
119+
if (this.timestamp && (this.position > 0)) {
120+
if (this.timeout) {
121+
clearTimeout(this.timeout)
122+
}
130123
this.timeout = setTimeout(() => {
131124
this.pushOutput('\n');
132125
this.position = 0;

0 commit comments

Comments
 (0)