Skip to content

Commit

Permalink
v1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
haneefdm committed Jan 1, 2022
1 parent d2d4b1b commit 10ea87a
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"tmp": true
},
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
"svg.preview.background": "transparent"
"svg.preview.background": "transparent",
"cortex-debug.registerUseNaturalFormat": false
}
20 changes: 12 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
ChangeLog

#V1.1.2
# V1.1.3
* Registers xPSR and CONTROL now have fields shown in the tooltip. This is in the VARIABLES Window
* Bugfix: There was a bug dealing with large integers (bigger than 32 bits) in tooltip generation. May have caused Register values to be not displayed at all.

# V1.1.2
* Multi-core debug: Syncronized launching/terminating working, Registers & Peripherals working. **Restart/Reset needs a bit more work**. The top level configuration has to be a `Launch` session but others can be `Launch` or `Attach`. Same will be available with `Attach` at the root of the chain -- `Attach` requires all the configuration to be duplicated, so we wanted to wait for a bit more maturity.
* Included with multi-core is multi-session where you can have multiple gdb-servers running at the same time. This is required for JLink where you may have one JLinkGDBServerCLExe connected to one core where as with OpenOCD and others, you will see the same GDB server shared for all the cores.
* With the above changes, you may see multiple `Debug Consoles`, `gdb-server` Terminals, multiple programs in the `Call Stack` window, multiple `Registers` and multiple `Peripherals`.
* DEPRECATION NOTICE: We are moving the registers window to the VARIABLES Panel (new category with Locals, Statics, Globals). As much as we liked having a separate panel for Registers, it was not possible (due to a VSCode limitation) for it to track the current Thread/Frame in the CALL STACK window. As such, you may have seen in accurate display. In the VARIABLES Panel, all values are in sync. with the CALL STACK window and it is also more efficient.
* SWO: The method of configuring SWO has changed. There is a new GDB-script that we encourage users to customize. Frequently, vendors are using non-standard addresses for ARM debug components (CoreSight) and hence it is not possibe for to detect or keep track. You can now customize the script yourself. See https://github.com/Marus/cortex-debug/blob/master/support/gdb-swo.init. Currently, only OpenOCD uses this script while the others are still using the old scripts that were not easily modifiable. Feedback, improvements welcome.
* OpenOCD requires additional configuration that is now done in a TCL script (config file in OpenOCD lingo). This is also user customizable as vendors are using non recommended ways of defining SWO/TPIU configuration. This is user configuratble. See https://github.com/Marus/cortex-debug/blob/master/support/openocd-helpers.tcl. This file also has what is required to configure for an RTOS as the previous hard-coded method does not work well for multi-core systems and for those who do not follow OpenOCD recommended naming conventions.

#V1.1.1
# V1.1.1
* For STLink Gdb-server and Cube-Programmer, set `LD_LIBRARY_PATH` on Linux and equivalent `DYLD_FALLBACK_LIBRARY_PATH` on MacOS
* STLink: We now use the `--halt` command-line option when launching the server unless `serverArgs` is used. If `serverArgs` is used, you can enable the `--halt` if that is the behavior you desire. Things may not work in the future without the `--halt` option.
* STLink: We no longer use `monitor reset halt` as that is not a supported reset option. We use the `--halt` command-line option instead.
* Experimental: `runToEntryPoint` is now supported for `Reset` and `Restart`. This was not possible/recommended before because of how VSCode handled breakpoints. Since `runToEntryPoint` works by setting a temporary breakpoint in the specified function, this may fail if your CPU has run out of breakpoints.
* Experimental (Unstable): Chained configurations for multi-core/multi-processor/multi-session debugging
* Bug fix: When using arm tools version 9+, some global variables were not being displayed

#V1.1.0
# V1.1.0
* Version numbering change. Now that VSCode extensions are allowed to publish pre-releases via the marketplace, we will be moving to a new version numbering schem. A version number is (following SemVer standard) major.minor.patch. The general SemVer standard also allows a suffix for alpha, beta, etc., but this is not supported by the marketplace. Instead, they recommend that ODD minor versions be pre-releases and EVEN ones for release versions. This versioning scheme may change in the future. See: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions
This will be the first pre-release coming to you direct from the marketplace.
* Issue #538: Fixed bug SVD internal debug verification. Not supposed to be for production but got released and caused false errors. This in turn resulted in SVD load failure.
* `launch.json` option `demangle` is removed. We always demangle. Its default value was true for quite some time. There is quite a bit of C++ now coming in and Rust as well. It appears there is no harm in always enabling it.
* Issue #539: Using GDB to get some symbol information for locals and globals. Hopefully, gives better performance for large executables. Most information still comes from `objdump` though.
* Issue #522: Qemu launch failed because it does not have a matching regular expression that indicated a start. It never does and code to handle that did not work. Fixed.

#V0.4.9
# V0.4.9
* Issue #536. Typo in code for os-specific paths

#V0.4.8
# V0.4.8
* Store register/peripheral settings in the appropriate folder instead of the first folder
* Kill gdb-server if the user kills/exits gdb without using the proper disconnect/Stop buttons/process/commands
* VSCode was terminating Cortex-Debug before it was done. st-util exit behavior was also not clean as it did not exit on a disconnect.
Expand All @@ -39,16 +43,16 @@ ChangeLog
* Issues #524 and #525
* Improved handling of J-Link RTOS option (file extension), added NuttX

#V0.4.7
# V0.4.7
* Fixed a regression for STLink gdbserver. It was in fact accidentally working in prior releases. The real bug is now fixed. Issue #494
* 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
# 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.

#V0.4.5
# V0.4.5
* Support for resume/suspend after Launch/Attach. With new UI features added to VSCode, the Stop button (after `Launch`) can now also be used for a Disconnect using keyboard shortcuts. The reverse is true when using an `Attach` type session. But this requires co-operation from the gdb-server to comply. Certain versions of OpenOCD do comply, JLink always seems to resume (see issue $481). Provided the gdb-server cooperates, the expected behavior now when you end a debug session is:
* `Stop` will leave the program in a halted state
* `Disconnect` will let the program continue
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": "1.1.2",
"version": "1.1.3",
"preview": false,
"activationEvents": [
"onDebugResolve:cortex-debug",
Expand Down
28 changes: 21 additions & 7 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,27 +436,41 @@ export function parseHexOrDecInt(str: string): number {
return str.startsWith('0x') ? parseInt(str.substring(2), 16) : parseInt(str, 10);
}

export function toStringDecHexOctBin(val: number): string {
export function toStringDecHexOctBin(val: number/* should be an integer*/): string {
if (Number.isNaN(val)) {
return 'NaN: Not a number';
}
if (!Number.isSafeInteger(val)) {
// TODO: Handle big nums. We eventually have to. We need to use bigint as javascript
// looses precision beyond 53 bits
return 'Big Num: ' + val.toString() + '\nother-radix values not yet available. Sorry';
}

let ret = `dec: ${val}`;
if (val < 0) {
val = -val;
val = ((val ^ 0xffffffff) + 1) >>> 0;
val = (~(val >>> 0) + 1) >>> 0;
}
let str = val.toString(16);
str = '0x' + '0'.repeat(8 - str.length) + str;
str = '0x' + '0'.repeat(Math.max(0, 8 - str.length)) + str;
ret += `\nhex: ${str}`;

str = val.toString(8);
str = '0'.repeat(12 - str.length) + str;
str = '0'.repeat(Math.max(0, 12 - str.length)) + str;
ret += `\noct: ${str}`;

str = val.toString(2);
str = '0'.repeat(32 - str.length) + str;
str = str.substr(0, 8) + ' ' + str.substr(8, 8) + ' ' + str.substr(16, 8) + ' ' + str.substr(24, 8);
ret += `\nbin: ${str}`;
str = '0'.repeat(Math.max(0, 32 - str.length)) + str;
let tmp = '';
while (true) {
if (str.length <= 8) {
tmp = str + tmp;
break;
}
tmp = ' ' + str.slice(-8) + tmp;
str = str.slice(0, -8);
}
ret += `\nbin: ${tmp}`;
return ret ;
}

Expand Down
28 changes: 25 additions & 3 deletions src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from 'vscode-debugadapter';
import { DebugProtocol } from 'vscode-debugprotocol';
import { MI2 } from './backend/mi2/mi2';
import { hexFormat } from './frontend/utils';
import { extractBits, hexFormat } from './frontend/utils';
import { Breakpoint, Variable, VariableObject, MIError, DataBreakpoint } from './backend/backend';
import {
TelemetryEvent, ConfigurationArguments, StoppedEvent, GDBServerController,
Expand Down Expand Up @@ -2111,9 +2111,31 @@ export class GDBDebugSession extends DebugSession {
value: val,
variablesReference: 0
};
if ((/^0x[0-9a-f]+/i.test(val)) || /^[-]?[0-9]+/.test(val)) {
if (!/^[sd][0-9]/i.test(reg) && ((/^0x[0-9a-f]+/i.test(val)) || /^[-]?[0-9]+/.test(val))) {
// No hints for floating point stuff
const intval = parseInt(val.toLowerCase());
res.type = `Register: ${reg} Thread#${threadId}, Frame#${frameId}\n` + toStringDecHexOctBin(intval);
res.type = `Register: $${reg} Thread#${threadId}, Frame#${frameId}\n` + toStringDecHexOctBin(intval);
const field = (nm: string, offset: number, width: number): string => {
const v = extractBits(intval, offset, width);
return `\n ${nm}: ${v.toString()}`;
};
// TODO: someday, fake these registers as a struct to VSCode
if (reg.toLowerCase() === 'xpsr') {
res.type += field('Negative Flag (N)', 31, 1);
res.type += field('Zero Flag (Z)', 30, 1);
res.type += field('Carry or borrow flag (C)', 29, 1);
res.type += field('Overflow Flag (V)', 28, 1);
res.type += field('Saturation Flag (Q)', 27, 1);
res.type += field('GE', 16, 4);
res.type += field('Interrupt Number', 0, 8);
res.type += field('ICI/IT', 25, 2);
res.type += field('ICI/IT', 10, 6);
res.type += field('Thumb State (T)', 24, 1);
} else if (reg.toLowerCase() === 'control') {
res.type += field('FPCA', 2, 1);
res.type += field('SPSEL', 1, 1);
res.type += field('nPRIV', 0, 1);
}
}
registers.push(res);
}
Expand Down

0 comments on commit 10ea87a

Please sign in to comment.