1

I installed flatpak Visual Studio Code on Linux Mint. I'm trying to debug the "Hello world app" from the Rust book in VS Code.

src/main.rs:

fn main() {
  println!("Hello, world!");
}

launch.json:

{
 "version": "0.2.0",
 "configurations": [
   {
    "name": "Debug program",
    "type": "gdb",
    "request": "launch",
    "target": "../target/debug/hello",
    "cwd": "${workspaceRoot}"
  }
 ]
}

When I cargo build the program and try to debug it, I get this error in Debug console:

warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/gorn/nextcloud/viptrader/rust/target/debug/hello.
Use `info auto-load python-scripts [REGEXP]' to list them.
Running executable
warning: Error disabling address space randomization: Operation not permitted

I have installed these extensions:

gorn
  • 5,042
  • 7
  • 31
  • 46

1 Answers1

1

The real problem is the Error disabling address space randomization: Operation not permitted. The Missing auto-load script warning you can usually ignore.

The problem is likely caused by virtualization.

Try adding set disable-randomization off into the .gdbinit.

You might also follow this flatpak issue 1301.

ArtemGr
  • 11,684
  • 3
  • 52
  • 85
  • Parto of the error seems to disappear when I put the `.gdbinit` into home directory, however the debugign still does not work - the script gets executed, but for example breakpoints are not functional etc. – gorn Aug 14 '18 at 16:34
  • Okay, let's hope `flatpak` users will stop by and add more. Are you using [`--devel`](http://docs.flatpak.org/en/latest/debugging.html)? – ArtemGr Aug 14 '18 at 20:18