microsoft / microsoft/vscode-cpptools

Feature request: allow running setup commands after loading executable

Open
#2,517 1 comment 1 reaction 1 assignee View on GitHub

@pieandcakes is already working on this.

Since Sep 21, 2018.

debugger Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Debugger

Describe the bug

  • OS and Version: macOS 10.12.6
  • VS Code Version: 1.27.2
  • C/C++ Extension Version: 0.18.1
  • Other extensions you installed (and if the issue persists after disabling them): Auto Comment Blocks, Better TOML, Bookmarks, CodeLLDB, EditorConfig, Git Blame, Go, hexdump, Markdown TOC, Monokai Pro, Ruby, Ruby Solargraph, Rust (rls), SpellChecker

My application makes extensive use of POSIX signals to interrupt system calls (see siginterrupt()). I would like to have the debugger ignore these signals. In lldb this can be done with:

process handle -n false -p true -s false SIGUSR1

One caveat is that this must be run after the executable has been loaded by lldb, not before. But there seems to be no way to tell cpptools to automatically run the above for me after loading the executable. I've already tried setupCommands, but that only runs stuff before loading the executable.

To Reproduce
Please include a code sample and launch.json configuration.

{
    "name": "(lldb) Launch CxxTestMain",
    "type": "cppdbg",
    "request": "launch",
    "program": "${workspaceFolder}/buildout/test/cxx/main",
    "args": ["-g", "Core_ApplicationPool_PoolTest:3"],
    "stopAtEntry": true,
    "cwd": "${workspaceFolder}/test",
    "environment": [],
    "logging": {
        "moduleLoad": false,
        "trace": true,
        "traceResponse": true
    },
    "MIMode": "lldb",
    "osx": {
        "MIMode": "lldb",
        "setupCommands": [
            { "text": "settings set target.x86-disassembly-flavor intel" },
            { "text": "b malloc_error_break" },
            { "text": "b Passenger::breakpoint" },
            { "text": "process handle -n false -p true -s false SIGPIPE" },
            { "text": "process handle -n false -p true -s false SIGUSR1" }
        ]
    }
},

The process handle setupCommands have no effect: lldb still breaks on SIGPIPE and SIGUSR1.

Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json

https://gist.github.com/FooBarWidget/c5e000a32ebf74e0b64972fc56067e45

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.