ctaggart / rusty-vscode

Rust + VSCode + RustyCode on a Docker Image
MIT License
4 stars 3 forks source link

add Native Debug to image for Rust debugging #11

Closed ctaggart closed 8 years ago

ctaggart commented 8 years ago

https://github.com/saviorisdead/RustyCode/issues/37#issuecomment-218968530 https://marketplace.visualstudio.com/items?itemName=webfreak.debug current version is 0.8.1

ctaggart commented 8 years ago

shows it working, but setup issues with .gdbinit. https://github.com/saviorisdead/RustyCode/issues/143

ctaggart commented 8 years ago

https://packages.debian.org/jessie/gdb Debian Jessie packages 7.7.1 sudo apt-get install -y gdb

ctaggart commented 8 years ago

Debug Console

fwarning: Missing auto-load scripts referenced in section .debug_gdb_scripts
of file /home/vscode/demo/target/debug/demo
Use `info auto-load python-scripts [REGEXP]' to list them.
Running executable
warning: Error disabling address space randomization: Operation not permitted
Hello, world!

Literally run it in the VSCode Debug Console:

info auto-load python-scripts
not available
info auto-load python-scripts
Loaded  Script                                                                 
No      gdb_load_rust_pretty_printers.py
ctaggart commented 8 years ago

About the pretty printers: http://michaelwoerister.github.io/2015/03/27/rust-xxdb.html

ctaggart commented 8 years ago

12 added the extension

ctaggart commented 8 years ago

I'm testing this with #18 and https://github.com/nickel-org/nickel.rs/issues/346. I'd like to be able to break for http requests. The key to removing the pretty printer warnings was to use rust-gdb wrapper script which can be set with "gdbpath": "rust-gdb",.

Here is the full launch.json where gdbpath has been added and target modified:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "gdb",
            "gdbpath": "rust-gdb",
            "request": "launch",
            "target": "./target/debug/demo",
            "cwd": "${workspaceRoot}"
        }
    ]
}
ctaggart commented 8 years ago

It is able to hit breakpoints.