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

Add option to specify custom openocd.gdb conf file #287

Closed
andresv opened this issue May 7, 2020 · 4 comments
Closed

Add option to specify custom openocd.gdb conf file #287

andresv opened this issue May 7, 2020 · 4 comments

Comments

@andresv
Copy link

andresv commented May 7, 2020

It would be useful for example to enable semihosting in openocd.gdb:

target remote :3333
set print asm-demangle on
break DefaultHandler
break HardFault
break rust_begin_unwind
monitor arm semihosting enable
load
break main
continue

Related: rust-embedded/cortex-m-quickstart#85

@haneefdm
Copy link
Collaborator

haneefdm commented May 7, 2020

It sounds like you don't want to use this extension. It already does all of that automatically

And, there are tons of ways to customize it. Play with launch.json and use IntelliSense and there are a host of options customize. Even the default configuration you create in VSCode will probably suffice.

Setting your own breakpoints is not a good idea in VSCode because it manages all of them. Not even this extension.

@haneefdm haneefdm closed this as completed May 7, 2020
@andresv
Copy link
Author

andresv commented May 7, 2020

I found this: https://github.com/haneefdm/cortex-debug-samples/blob/master/blink2/.vscode/launch.json

And added those lines for enabling semihosting:

...
"postRestartCommands": [
    "monitor arm semihosting enable",
 ],
"showDevDebugOutput": true

I would have expected to see monitor arm semihosting enable somewhere in debug console:

0000000190: Launching GDB: "arm-none-eabi-gdb" "-q" "--interpreter=mi2"
0000000193: 1-gdb-set target-async on
0000000193: 2-interpreter-exec console "source /Users/andres/.vscode/extensions/marus25.cortex-debug-0.3.6/support/gdbsupport.init"
0000000193: 3-target-select extended-remote localhost:50000
0000000193: 4-interpreter-exec console "monitor reset halt"
0000000193: 5-target-download
0000000193: 6-interpreter-exec console "monitor reset halt"
0000000193: 7-enable-pretty-printing

@haneefdm
Copy link
Collaborator

haneefdm commented May 7, 2020

Yes, that is my github repo but it is old and for personal use when I was learning VSCode. Notice I was experimenting with multiple debuggers at the time, then decided this is a better extension for Cortex devices so I started contributing.

If you want it to add custom commands. with pre/post/override launch/attach/restart feel free.

You used post restart instead of launch.

@andresv
Copy link
Author

andresv commented May 7, 2020

Thanks. This did the trick.

            "postLaunchCommands": [
                "monitor arm semihosting enable",
            ],

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