Sublime Forum

New plugin: SublimeGDB

#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

#21

Thanks for the info, I should have said i’m already using it in a project file and it doesn’t seem to be working, would you mind posting that portion of your project file so I can see if i’m doing it correctly?

Many Thanks.

0 Likes

#22

Must say that I was thinking of SublimeClang whole time but SublimeGDB shouldn’t be different. My project file is something like this:

[code]{
“folders”:

	{
		"path": "desktop"
	}
],
"settings":
{
	"sublimeclang_options":
	
		"-Wall",
		"-Wno-switch",
		"-Wno-unused-parameter",
		"-Wno-format-y2k",
		"-Wno-parentheses",
		"-Wno-newline-eof",
		"-Wno-unknown-pragmas",
		"-Wno-microsoft",
		"-fshort-wchar",
		"-fno-exceptions",
		"-Wno-non-virtual-dtor",
		"-Wno-write-strings",
		"-Wno-overloaded-virtual",
		"-Ic:/workspace/desktop",
	]
}

}
[/code]

0 Likes

#23

Nice plugin!

I’m trying to use it for embedded development. Often this involves issuing several commands, e.g erase the memory, load the binary, reset etc etc.

So it would be ‘nice’ if exec_cmd could also be a list of commands, rather than having to put all the commands in one string.

0 Likes

#24

[quote=“badger”]Nice plugin!

I’m trying to use it for embedded development. Often this involves issuing several commands, e.g erase the memory, load the binary, reset etc etc.

So it would be ‘nice’ if exec_cmd could also be a list of commands, rather than having to put all the commands in one string.[/quote]

Same here. Great idea badger!

0 Likes