microsoft / microsoft/vscode-cpptools
[J-Link] Debug session doesn't stop in breakpoint after flash is erased
Open
@benmcmorran is already working on this.
Since May 1, 2023.
debugger
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Windows, Linux
- VS Code: 1.77
- C/C++ extension: v1.14.5
- OS and version of remote machine (if applicable): N/A
- GDB version: any
Bug Summary and Steps to Reproduce
Bug Summary:
[J-Link] Debug session doesn't stop in breakpoint after flash is erased.
Steps to reproduce:
- Connect a Segger J-Link Probe to a NXP LPCXPRESSO55S69 board.
- Open a terminal in the project folder and erase the flash by issuing the following command:
"C:\Program Files\SEGGER\JLink\JLink.exe" -if SWD -speed auto -commanderscript script.jlink -device LPC55S69_M33_0 - Debug the attached project from VS Code.
Result: Target doesn't stop at main. From the logs, it seems that the target actually stops, but cppdbg tells it to continue execution. If the debug session is done without erasing the flash first it stops at main as expected.
Debugger Configurations
launch.json:
{
"configurations": [
{
"type": "cppdbg",
"name": "Debug project configuration",
"request": "launch",
"cwd": "c:\\Bug\\lpcxpresso55s69_hello_world",
"MIMode": "gdb",
"program": "c:\\Bug\\lpcxpresso55s69_hello_world\\armgcc\\debug\\hello_world.elf",
"miDebuggerPath": "c:\\gdb\\bin\\arm-none-eabi-gdb.exe",
"debugServerPath": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe",
"miDebuggerServerAddress": "localhost:2330",
"postRemoteConnectCommands": [
{
"text": "monitor reset"
},
{
"text": "load"
},
{
"text": "tbreak main"
},
{
"text": "monitor semihosting enable"
},
{
"text": "monitor exec SetRestartOnClose=1"
},
{
"text": "monitor reset"
}
],
"debugServerArgs": "-nosilent -swoport 2331 -telnetport 2332 -singlerun -endian little -noir -speed auto -port 2330 -vd -device LPC55S69_M33_0 -if SWD -halt -reportuseraction",
"serverStarted": "Connected to target",
"unknownBreakpointHandling": "stop"
}
]
}
Debugger Logs
Debug log attached.
debug.log
Other Extensions
No response
Additional Information
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.