Sublime Forum

New plugin: SublimeGDB

#1

A plugin that integrates the GNU Debugger with Sublime Text 2.
github.com/quarnster/SublimeGDB


0 Likes

#2

I don’t do C programming, but I wanted to +1 for what looks like a really nice clean plugin that I can dive in to to learn about outputting to different view areas - I’d like to do to the same with my NodeJS plugin for ST2, so hopefully I can use some of your code to base the improvement off.

0 Likes

#3

Looks awesome!

If anybody could do the same for the PHP xdebug sigh :smile:

0 Likes

#4

Awesome work! Now here’s to hoping someone will fork this to work with DBGp :smiley:

0 Likes

#5

[quote=“highend”]Looks awesome!

If anybody could do the same for the PHP xdebug sigh :smile:[/quote]

Here is an implementation of an xdebug plugin for VIM and is written in python :smile: maybe someone could integrate it (I’m not good with python though)

vim.org/scripts/script.php?script_id=1929

I would love to debug PHP in Sublime Text.

0 Likes

#6

Hi,

XDebug seems to be compatible with GDBP clients: xdebug.org/docs-dbgp.php
However I did not manage to make it work with SublimeGDB. This is a bit new for me, so I wanted to know if you see an obvious compatibility issue before I start to dig further…

Do you think both tools may be compatible in their current states?

0 Likes

#7

[quote=“real34”]Hi,

XDebug seems to be compatible with GDBP clients: xdebug.org/docs-dbgp.php
However I did not manage to make it work with SublimeGDB. This is a bit new for me, so I wanted to know if you see an obvious compatibility issue before I start to dig further…

Do you think both tools may be compatible in their current states?[/quote]

xDebug is compatible with DBGp, not GDB. GDBP does not exist.

0 Likes

#8

If anyone make xdebug work with sublime, can please post the solution? I’m also interested in this (and i bet there are many others!)

thanks!

0 Likes

#9

I second this request!

0 Likes

#10

Can you do remote debugging of a Linux machine from a Windows machine with this plugin?

0 Likes

#11

As long as you put the GDB binary in mi interpreter mode so that it understands what GDB is telling it you can do anything you want. I’m remotely debugging Android from an OS X host as an example.

0 Likes

#12

Thanks for this plugin!

How can I hide the debugger views after finishing a debugging session? Now they are there permanently.

0 Likes

#13

Menu item View->Layout->Single. Or ctrl+alt+1/cmd+alt+1.

0 Likes

#14

Thanks!

0 Likes

#15

Hi,

My build system outputs different executables depending if i’m on Mac or Windows so:-

Mac

"sublimegdb_commandline": "gdb --interpreter=mi ./test/build/Debug/game.app/Contents/MacOS/game"

Windows

"sublimegdb_commandline": "gdb --interpreter=mi ./test/build/Debug/game.exe"

The questions is how can I set these depending on the platform, I have tried wrapping platform checks such as the following but it doesnt seem to work?

"osx": 
{
      sublimegdb_.....
},

"windows":
{
      sublimegdb_.....
}

Any help much appreciated

Thanks.

0 Likes

#16

Why not have the settings nested under a JSON object in the settings?
So instead of { "settings": { "sublimegdb_workingdir": "${folder:${project_path:your_executable_name}}", "sublimegdb_commandline": "gdb --interpreter=mi ./your_executable_name" } } it could be { "settings": { "sublimegdb": { "workingdir": "${folder:${project_path:your_executable_name}}", "commandline": "gdb --interpreter=mi ./your_executable_name" } } }
Just thinking out loud for organization sake.

0 Likes

#17

Thanks but the path will be completely different on OSX vs Windows

as in OSX will be

game.app/Contents/MacOS/game

vs

game.exe

Unless i’m not understanding?

I want to have a consistent project settings without having to set the path all the time to the executable?

Thanks

0 Likes

#18

Yeah nesting also doesn’t seem to work on build 2218. :frowning:

{ "settings": { "sublimegdb": { "workingdir": "${folder:${project_path:your_executable_name}}", "commandline": "gdb --interpreter=mi ./your_executable_name" } } }

0 Likes

#19

My comment above was only a suggestion for the developer, not as a yet-available user option.

0 Likes

#20

[quote=“captainspank”]Hi,

My build system outputs different executables depending if i’m on Mac or Windows so:-

The questions is how can I set these depending on the platform, I have tried wrapping platform checks such as the following but it doesnt seem to work?[/quote]

I think you can have platform user settings file overriding user one.
Maybe try overriding these settings for Mac in /User/Preferences (OSX).sublime-settings ?

If that won’t work then another suggestion is to put these setting in the project file. This will work because I’m using it like this.

0 Likes