Vscode-cpptools: Linux Debugger overrides setup command options

Created on 20 Mar 2019  路  8Comments  路  Source: microsoft/vscode-cpptools

Type: Debugger

  • OS and Version: Debian 9
  • VS Code Version: 1.32.3
  • C/C++ Extension Version: 0.21.0

I work with applications which have dependencies on a large number of shared libraries. Usually, when using gdb outside of VSCode, I use "set auto-solib-add off" so that the software attaches faster.

I added the following snippet in my launch.json -

"setupCommands":[
{"text": "set auto-solib-add off",
"description": "Turn off solib add",
"ignoreFailures": true
}]

It seems when vscode launches gdb, it runs this command and then automatically overrides it with "set auto-solib-add on".

To Reproduce

  1. Create an attach configuration
  2. add setupcommands as above

Additional Info
Snippet from log -
1: (838) <-1001-gdb-set target-async on
1: (839) ->1001^done
1: (839) ->(gdb)
1: (840) 1001: elapsed time 2
1: (847) <-1002-enable-pretty-printing
1: (848) ->1002^done
1: (848) ->(gdb)
1: (848) 1002: elapsed time 0
1: (849) <-1003-interpreter-exec console "set auto-solib-add off"
1: (849) ->1003^done
1: (850) ->(gdb)
1: (850) 1003: elapsed time 0
1: (850) <-1004-interpreter-exec console "set pagination off"
1: (850) ->=cmd-param-changed,param="pagination",value="off"
1: (851) ->1004^done
1: (851) ->(gdb)
1: (851) 1004: elapsed time 0
1: (851) <-1005-gdb-set auto-solib-add on
1: (851) ->1005^done
1: (851) ->(gdb)
1: (851) 1005: elapsed time 0

Feature Request debugger fixed (release pending)

Most helpful comment

Without the ability to add set auto-solib-add off in my .gdbinit starting up our software in the debugger becomes painfully slow. It can reach on the order of over a minute or two making the edit-debug-test cycle painfully slow. Please consider adding this.

Facing exactly the same issue here. Hopefully this will be added soon.

All 8 comments

We have the capabilities for that in MIEngine at the moment, but is not available through the VS Code extension.

Work for this would be adding the following to our launch.json and have AD7 send it to MIEngine.

boolean SymbolInfoLoadAll 
string[] SymbolInfoExceptionList 

We have the capabilities for that in MIEngine at the moment, but is not available through the VS Code extension.

Work for this would be adding the following to our launch.json and have AD7 send it to MIEngine.

boolean SymbolInfoLoadAll 
string[] SymbolInfoExceptionList 

Is there plans to support this in a future release?

Without the ability to add set auto-solib-add off in my .gdbinit starting up our software in the debugger becomes painfully slow. It can reach on the order of over a minute or two making the edit-debug-test cycle painfully slow. Please consider adding this.

Without the ability to add set auto-solib-add off in my .gdbinit starting up our software in the debugger becomes painfully slow. It can reach on the order of over a minute or two making the edit-debug-test cycle painfully slow. Please consider adding this.

Facing exactly the same issue here. Hopefully this will be added soon.

Thanks @WardenGnaw !

Fixed with 0.26.0.

I'm running version 1.1.3 and have the same issue
This is my config

"configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/browser/build/browser",
            "args": [""],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true,
                },
                {
                    "description": "Disable loading symbols of shared libraries",
                    "text": "set auto-solib-add off",
                    "ignoreFailures": true,
                }
            ]
        }
]

Adding set auto-solib-add off to my .gdbinit file works though. Could this be broken again?

Was this page helpful?
0 / 5 - 0 ratings