Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VsCode: Debug Breakpoint Log Message #1087

Open
NINI1988 opened this issue Feb 3, 2025 · 0 comments
Open

VsCode: Debug Breakpoint Log Message #1087

NINI1988 opened this issue Feb 3, 2025 · 0 comments

Comments

@NINI1988
Copy link

NINI1988 commented Feb 3, 2025

Describe the bug
When adding a debug breakpoint in VsCode and setting a Log Message it says: Expressions within {} are interpolated.
But doing so will result either in:

Log Message: Hello {logStoreLocation.startAddress}

-> =breakpoint-modified,bkpt={number="2",type="dprintf",disp="keep",enabled="y",addr="0x08033152",func="MainProcess_init",file="general/MainProcess.c",fullname="/workspaces/general/MainProcess.c",line="78",thread-groups=["i1"],times="1",script={"printf \"Hello\",{logStoreLocation.startAddress}"},original-location="/workspaces/general/MainProcess.c:78"}
-> &"Wrong number of arguments for specified format-string\n"
Wrong number of arguments for specified format-string

Log Message: Hello {logStoreLocation.startAddress} ,address: {logStoreLocation.startAddress}

-> =breakpoint-modified,bkpt={number="2",type="dprintf",disp="keep",enabled="y",addr="0x08033152",func="MainProcess_init",file="general/MainProcess.c",fullname="/workspaces/general/MainProcess.c",line="78",thread-groups=["i1"],times="1",script={"printf \"Hello\",{logStoreLocation.startAddress},,address:,{logStoreLocation.startAddress}"},original-location="/workspaces/general/MainProcess.c:78"}
-> &"A syntax error in expression, near `,address:,{logStoreLocation.startAddress}'.\n"
A syntax error in expression, near `,address:,{logStoreLocation.startAddress}'.

I already saw in #542 that the format in Log message must be like :"Hello %d\n" 123, but this is not obvious for anyone using VsCode.

To Reproduce
Steps to reproduce the behavior:

  1. Create breakpoint and select Log Message and enter Hello {123}
  2. Start debug session
  3. See issue in Debug console

Expected behavior

The log message should be printed.

Screenshots

Image

Environment (please complete the following information):

  • Cortex-Debug Version (this extension) 1.12.1
  • OS: Linux ubuntu:22.04 devcontainer
  • GDB Version: STMicroelectronics ST-LINK GDB server. Version 7.8.0
  • Compiler Toolchain Version: arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614

Please include launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug ST-LINK application",
            "cwd": "${workspaceFolder}",
            "executable": "debug/App.elf",
            "preLaunchTask": "build application",
            "request": "launch",
            "type": "cortex-debug",
            // "runToEntryPoint": "main",
            // "breakAfterReset": false,
            "servertype": "external",
            "showDevDebugOutput": "raw",
            "gdbPath": "arm-none-eabi-gdb",
            "gdbTarget": "IP:61234",
            "overrideLaunchCommands": ["load", "monitor reset hardware"],
            "overrideRestartCommands": ["load", "monitor reset hardware"],
            "overrideResetCommands": ["monitor reset hardware"],
            "svdFile": "../bootloader/stm32h7driver/Common/STM32H7x5_CM4.svd",
            "device": "",
        },
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant