View mode: basic / threaded / horizontal-split · Log in · Help
November 21, 2006
A new debugger for Linux - would it work for D?
Hi,
I have written a Linux debugger (so far targeting C and C++) and from
conversations with Walter and Andrei Alexandrescu emerged the idea of adapting
it to support D.

The areas that might need some not-so-trivial effort are the stack unwinding
(as I understood from Walter, D sometimes uses stack frame layouts that may
not be compatible with C) and the expression interpreter.

Take a look, and if you think the investment in D is worthwhile I will give it
a shot.

Thank you,
Cristian Vlasceanu (http://www.zero-bugs.com)
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Cristian Vlasceanu wrote:
> Hi,
> I have written a Linux debugger (so far targeting C and C++) and from
> conversations with Walter and Andrei Alexandrescu emerged the idea of adapting
> it to support D.
> 
> The areas that might need some not-so-trivial effort are the stack unwinding
> (as I understood from Walter, D sometimes uses stack frame layouts that may
> not be compatible with C) and the expression interpreter.
> 
> Take a look, and if you think the investment in D is worthwhile I will give it
> a shot.
> 
> Thank you,
> Cristian Vlasceanu (http://www.zero-bugs.com)

That would be fantastic.
I'm primarily on Windows, but I'd probably fire up my VMWare Ubuntu 
install just to be able to use a decent D debugger.

Would this be for GDC only?  Or both DMD & GDC?

--bb
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Pardon my ignorance, what is GDC? The GNU implementation of D?

If that is the case, then the answer is that it depends on which side the work
will be done, i.e. it might be the case that the compiler need be tweaked to
generate DWARF to help the debugger, not just for the debugger to be extended to
understand D.

The way the debugger works to date is to look up for stack unwinding info
(generated for C++ exception unwinding), and, if not found, it falls back to the
"classical" linked list of frames approach, using the instruction pointer, stack
pointer and frame register.

I must admit I have not tried interoperating Zero and D, I just wanted to see if
there is enough interest in the community to justify the work.

Cristian
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Cristian Vlasceanu wrote:
> I must admit I have not tried interoperating Zero and D, I just wanted to see if
> there is enough interest in the community to justify the work.
> 
> Cristian

I'm thinking about getting into linux and would appreciate the work, of 
course. Can't speak for other people, but I suspect most would like a 
good debugger for D very much.

It seems like Zero is also designed for making it easier for other tools 
to use it, nice one.

Good luck with development, I hope you will decide to make the effort.
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Cristian Vlasceanu wrote:
> Pardon my ignorance, what is GDC? The GNU implementation of D?

GDC uses the GCC backend to generate code.
DMD uses the Digtal Mars backend to generate code.
GDC is out of date.
That's about all I know.

I don't know if they have different object formats or different formats 
for debug info.


--bb
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Bill Baxter escribió:
> Cristian Vlasceanu wrote:
>> Pardon my ignorance, what is GDC? The GNU implementation of D?
> 
> GDC uses the GCC backend to generate code.
> DMD uses the Digtal Mars backend to generate code.
> GDC is out of date.

Err... latest svn revision (41) puts gdc up with dmd 0.174...

> That's about all I know.
> 
> I don't know if they have different object formats or different formats 
> for debug info.
> 
> 
> --bb


-- 
Carlos Santander Bernal
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Carlos Santander wrote:
> Bill Baxter escribió:
>> Cristian Vlasceanu wrote:
>>> Pardon my ignorance, what is GDC? The GNU implementation of D?
>>
>> GDC uses the GCC backend to generate code.
>> DMD uses the Digtal Mars backend to generate code.
>> GDC is out of date.
> 
> Err... latest svn revision (41) puts gdc up with dmd 0.174...

Cool beans!  (Not sure how I was supposed to know that, though, given 
that there hasn't been an announcement here, AFAIK. But great news 
nonetheless.)

--bb
November 22, 2006
Re: A new debugger for Linux - would it work for D?
Cristian Vlasceanu wrote:

> Hi,
> I have written a Linux debugger (so far targeting C and C++) and from
> conversations with Walter and Andrei Alexandrescu emerged the idea of
> adapting it to support D.
> 
> The areas that might need some not-so-trivial effort are the stack
> unwinding (as I understood from Walter, D sometimes uses stack frame
> layouts that may not be compatible with C) and the expression interpreter.
> 
> Take a look, and if you think the investment in D is worthwhile I will
> give it a shot.
> 
> Thank you,
> Cristian Vlasceanu (http://www.zero-bugs.com)

You would totally be my hero.  I'm the one who wrote (and maintains) the GDB
D patches project... so far it only supports D symbol demangling, and not
even all that well.  I haven't done more since GDB is bloody impossible to
hack (as your website mentions.)

DMD's DWARF output is incomplete (outright wrong sometimes, actually see bug
#146) but GDB frequently can't even handle a lot of D stacks anyway.  I
think Walter will be much more inclined to add more DWARF support (and fix
the existing support) if someone is actually developing a debugging program
for D code and is willing to give him advice on the DWARF format (as I
recall, he wasn't particularly excited about learning DWARF to initially
implement the output.)

In short, if Zero were to get good (or even better- great) D support, I'm
pretty confident nearly every Linux D user would use it, and the Windows D
users would be very jelous.

BTW- I think Zero is a great idea.  I haven't read over the entire web site
yet, but I like it a lot.  GDB sucks!  Choice is great!

Good luck with D.  If you have any questions, I'm happy to answer them
personally or feel free to post to the newsgroups here.  The D community
tends to be very friendly and helpful.  You might also check out
dsource.org for some tutorials and interesting D projects.

-- 
~John Demme
me@teqdruid.com
http://www.teqdruid.com/
November 22, 2006
Re: A new debugger for Linux - would it work for D?
On Tue, 21 Nov 2006 15:50:30 -0800, Cristian Vlasceanu  
<cristian@zero-bugs.com> wrote:

> Hi,
> I have written a Linux debugger (so far targeting C and C++) and from
> conversations with Walter and Andrei Alexandrescu emerged the idea of  
> adapting
> it to support D.
>
> The areas that might need some not-so-trivial effort are the stack  
> unwinding
> (as I understood from Walter, D sometimes uses stack frame layouts that  
> may
> not be compatible with C) and the expression interpreter.
>
> Take a look, and if you think the investment in D is worthwhile I will  
> give it
> a shot.
>
> Thank you,
> Cristian Vlasceanu (http://www.zero-bugs.com)
>


There would be a lot of support for that.  Debuggers are an oft requested  
feature for D.

-JJR
November 22, 2006
Re: A new debugger for Linux - would it work for D?
On Tue, 21 Nov 2006 19:47:52 -0800, Carlos Santander  
<csantander619@gmail.com> wrote:

> Bill Baxter escribió:
>> Cristian Vlasceanu wrote:
>>> Pardon my ignorance, what is GDC? The GNU implementation of D?
>>  GDC uses the GCC backend to generate code.
>> DMD uses the Digtal Mars backend to generate code.
>> GDC is out of date.
>
> Err... latest svn revision (41) puts gdc up with dmd 0.174...
>

Are you sure?  The svn revision I have on my computer is 41 and it hasn't  
been updated for awhile now.  I keep doing an "svn update" and there are  
no changes.  Is there a different svn repository that I'm not aware of?

-JJR
« First   ‹ Prev
1 2 3 4
Top | Discussion index | About this forum | D home