Jump to page: 1 2
Thread overview
Has anyone had success debugging on OSX?
May 19, 2016
pineapple
May 19, 2016
pineapple
May 19, 2016
Jacob Carlborg
May 19, 2016
Jacob Carlborg
May 19, 2016
Guillaume Piolat
May 19, 2016
pineapple
May 20, 2016
Jacob Carlborg
May 20, 2016
pineapple
May 24, 2016
Vadim Lopatin
May 30, 2016
chmike
May 19, 2016
I've at least got my code running in windbg on Windows, but I'd also like to get a debugging environment set up in OSX. It looks as though gdb is probably my best option but I haven't been able work out how to get it to work with my compiled D programs.
May 19, 2016
Along the same lines, what about compiling and debugging in a ubuntu VM? I gave that a shot, too, but didn't get much of anywhere.
May 19, 2016
On 2016-05-19 13:02, pineapple wrote:
> I've at least got my code running in windbg on Windows, but I'd also
> like to get a debugging environment set up in OSX. It looks as though
> gdb is probably my best option but I haven't been able work out how to
> get it to work with my compiled D programs.

It depends on what features you need. I know you can get a stacktrace at least, with mangled names :)

-- 
/Jacob Carlborg
May 19, 2016
On 2016-05-19 13:02, pineapple wrote:
> I've at least got my code running in windbg on Windows, but I'd also
> like to get a debugging environment set up in OSX. It looks as though
> gdb is probably my best option but I haven't been able work out how to
> get it to work with my compiled D programs.

I also recommend asking in the learn forum/group, to make your post more visual.

-- 
/Jacob Carlborg
May 19, 2016
On Thursday, 19 May 2016 at 11:02:00 UTC, pineapple wrote:
> I've at least got my code running in windbg on Windows, but I'd also like to get a debugging environment set up in OSX. It looks as though gdb is probably my best option but I haven't been able work out how to get it to work with my compiled D programs.

I'm using lldb with both LDC and DMD. It works really well, you get stack-traces, source information, etc.
But names are mangled.
May 19, 2016
On Thursday, 19 May 2016 at 11:36:58 UTC, Guillaume Piolat wrote:
> I'm using lldb with both LDC and DMD. It works really well, you get stack-traces, source information, etc.
> But names are mangled.

Anything that helps me narrow down where this error "malloc: *** error for object 0x7ff34387e600: pointer being freed was not allocated" is actually occurring is a win in my book.

Ideally I'd like to be able to step through code in a visual environment and evaluate expressions like I do in tools like PyCharm's Python debugger, but for now I'm just trying to solve this specific problem and a stack trace would be very helpful.

Perhaps you could post a short guide on how to set up the tools you use for debugging?
May 20, 2016
On 2016-05-19 15:14, pineapple wrote:

> Anything that helps me narrow down where this error "malloc: *** error
> for object 0x7ff34387e600: pointer being freed was not allocated" is
> actually occurring is a win in my book.
>
> Ideally I'd like to be able to step through code in a visual environment
> and evaluate expressions like I do in tools like PyCharm's Python
> debugger,

You can debug your application in Xcode. You would need to create a dummy project:

1. File -> New -> Project
2. Other -> Empty -> Next
3. Type a name then choose where to create it
4. In the top left corner in the toolbar, click "No Scheme"
5. Click New Scheme
6. Type a name
7. In the right side, choose Run
8. In the middle, choose Info -> Executable -> Other and pick your application, then close the dialog
9. Now click the run button (the one looking like a play button) in the top left corner in the toolbar

When your application crashes it should open the debugger view. You might need to add your source files to the project to get a source mapping. Do that by dragging them to the left side in the Xcode window.

 but for now I'm just trying to solve this specific problem and
> a stack trace would be very helpful.

Just to get a stack trace it's enough to run your program through lldb: "lldb my_program". When it crashes, execute the "bt" (backtrace) command to print the stack trace.

> Perhaps you could post a short guide on how to set up the tools you use
> for debugging?



-- 
/Jacob Carlborg
May 20, 2016
On Friday, 20 May 2016 at 06:59:08 UTC, Jacob Carlborg wrote:
>
> You can debug your application in Xcode. You would need to create a dummy project:

Thanks for your answer!

May 24, 2016
On Thursday, 19 May 2016 at 11:02:00 UTC, pineapple wrote:
> I've at least got my code running in windbg on Windows, but I'd also like to get a debugging environment set up in OSX. It looks as though gdb is probably my best option but I haven't been able work out how to get it to work with my compiled D programs.

Did someone try to use LLDBMI2 debugger?

https://github.com/freedib/lldbmi2

It seems to be GDB/MI compatible frontend for LLDB debugger.

Should work with Eclipse/DDT
May 30, 2016
On Tuesday, 24 May 2016 at 06:14:49 UTC, Vadim Lopatin wrote:
> On Thursday, 19 May 2016 at 11:02:00 UTC, pineapple wrote:
>> I've at least got my code running in windbg on Windows, but I'd also like to get a debugging environment set up in OSX. It looks as though gdb is probably my best option but I haven't been able work out how to get it to work with my compiled D programs.
>
> Did someone try to use LLDBMI2 debugger?
>
> https://github.com/freedib/lldbmi2
>
> It seems to be GDB/MI compatible frontend for LLDB debugger.
>
> Should work with Eclipse/DDT

I have seen that there seam to be a problem with the debug source line info that confuses gdb when compiled with dmd. I have filed a bug about this in bugzilla.
Until this problem is solved, you might have a better chance with gdb when using ldc.




« First   ‹ Prev
1 2