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

Spurious newlines in semihosting debug output #192

Open
TomCrypto opened this issue Aug 5, 2019 · 1 comment
Open

Spurious newlines in semihosting debug output #192

TomCrypto opened this issue Aug 5, 2019 · 1 comment

Comments

@TomCrypto
Copy link

I'm not sure if this is the same as #115 (it certainly seems related) but any semihosting operation from the device seems to automatically append a newline in the debug output window regardless of whether or not a newline was requested. The result is that string interpolation code on the device e.g. string formatting that has to do multiple semihosting write calls end up producing output that's broken
up like
this
.

The problem doesn't arise with a normal GDB session so I think this is coming from the extension, and makes it very hard to parse debugging output at a glance from the debug output window.

@senorclean
Copy link

I've run into the same issue. I'm using J-Link as the server and when I run this all separately in two different terminals I get an output like I would expect. As an example:

X-axis: -0.0031738281

If I use this extension, I get this as an output:

X-axis: 
-
0.
00
31738281

After enough print statements, the output window basically becomes unreadable. This is my launch.json file:

{
  "name": "Cortex Debug",
  "cwd": "${workspaceRoot}",
  "executable": "${workspaceFolder}/stm32f4-rust",
  "device": "stm32f407vg",
  "request": "launch",
  "type": "cortex-debug",
  "servertype": "jlink",
  "interface": "swd",
  "runToMain": true,
  "postLaunchCommands": [
    "monitor semihosting enable",
    "monitor semihosting ioclient 2"
  ],
  "swoConfig": {
    "source": "probe",
    "enabled": true,
    "swoFrequency": 2000000,
    "cpuFrequency": 168000000,
    "decoders": [
      {
        "port": 0,
        "label": "ITM",
        "type": "console"
      }
    ]
  }
}
`

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

2 participants