Skip to content

the pre_debug_task stuck forever, or behaves unpredictably #307

@JXUCam

Description

@JXUCam

sublime-text build 4200,
G++-13 v13.3.0,
Linux, the issue exists on both Ubuntu 24.04LTS and Linux Mint 22.2.

I tried several sublime-project files, including the sample cpp.sublime-project (of course I've made sure to change clang++ to g++ to suit my system).

Here is one setup that works at a time, but not at other times:

{
"folders": [
{
"path": ".",
},
],
"debugger_tasks": [
{
"name": "Compile",
"working_dir": "${project_path}",
"shell_cmd": "g++ -g ${file_name} -o ${file_base_name}_debug",
"file_regex": "(..[^:]):([0-9]+):([0-9]+)?:? error: (.)",
},
],
"debugger_configurations":
[
{
"type": "lldb",
"request": "launch",
"name": "Run",
"pre_debug_task": "Compile",
"program": "${project_path}/${file_base_name}_debug",
"stdio": ["input.txt","output.txt"],
"args": [],
"cwd": "${project_path}"
},
],
}

I have pin'd down the problem is that pre_debug_task may complete successfully, or may not - its behavior seem hard to predict. In the debugger_tasks section, I tried to change all possible keys and values, for example,changing $file_name$ to ${project_path}/${file_base_name}.cpp, or making use of ${folder} variable, changing key "shell_cmd" to be "cmd", changing "working_dir" to be "cwd", ......, I even tried to hard-code the full cmd (or shell_cmd), to be like "/usr/bin/g++ -g /home/myuserid/mypath/mycode.cpp -o mydebug" (of course I adapt these path and file names to my actual case), that is even I do NOT use any environment variable at all, the compile pre_debug_task still behaves like a tempy girl, sometimes it works and most other times it stuck for ever. When it works I tried to clean the binary and repeat then it may not work. I even tried to clean up all .config/sublime-text/ folder and start it all over. And I have thoroughly read through the sublime build document at here https://www.sublimetext.com/docs/build_systems.html, and quite some document of this github project, for example, https://packagecontrol.io/packages/Debugger and https://github.com/daveleroy/SublimeDebugger/tree/master/examples/cpp

I even searched through these open issues, but can't see this has been mentioned any way, nor a solution is provided.

I tried to launch sublime from command line, so as to see any error messages (also searched .xsession-errors), but none. This means there is no error, it may be that "Compile" job failed to trigger, or waiting for some input somewhere and stuck. As I explained above I even tried not to use any variable but hard-code all my files and g++ binary, still no luck.

Does anyone here have a clue?

Final word, when it works, I really like its ease of use to help me debugging my code. Thank you Daveleroy for making this sublime debugger. Hope you can understand my frustration when it refuses to compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions