Crash handler with stack trace

Jeremie Pelletier jeremiep at gmail.com
Sat Sep 19 22:25:30 PDT 2009


Tom S Wrote:

> Jeremie Pelletier wrote:
> > I've been asked for my runtime crash handler with it's CodeView reader earlier in digitalmars.D so here it is:
> > 
> > http://jump.fm/UVYHG
> > 
> > It includes the runtime handler, a PE reader, CodeView reader and crash report window.
> > 
> > So far it supports Windows and some bits are already done for posix platforms. It does a register dump, stack trace with resolved symbol names with their declaration file and line, as well as a listing of all loaded modules.
> > 
> > Sorry for the lack of phobos/tango support, this is part of a runtime project I'm building which should hopefully be released to dsource in a few months. I'm releasing it now so if someone wants to implement a phobos or tango port they're free to do it.
> 
> Thanks a lot, Jeremie! The code looks really good. I think I'll be 
> stealing the PE && CV parsing parts for Tango :)

I'm glad to hear that! Just keep my name in the credits and I'll be happy :)

> I'm curious about the runtime project of yours :o Can you shed a bit of 
> the secret? How will it compare to druntime? What's the target audience? 
> Does it have anything to do with 'meshes and textures'? ;)

Well it started a bit over two years ago, back then there was no druntime, I was digging into phobos to learn more about the language and decided it would be a fun and challenging task to write my own runtime. Then once I had it running stable I found out druntime had been created in the meantime!

In any ways, I learned quite a bit of the language's internals and ABI while coding and debugging it; I began by removing all default paths and libraries from dmd (both in sc.ini and compiling with "--defaultlib= --debuglib=--") and made an empty object.d and built my way up until there was no more compiler crashes (dmd is quite whiny about not having its "intrinsic" symbols declared, mostly the typeinfo's) and all unresolved symbols were added.

Since then the runtime was ported to D2 and kept up to date with every new release, I've been using it for these two years and it works great.

I don't really know how it will compare to druntime, I'm not out there to compete with them really. I use DMD on both windows and posix platforms (Win7 and Ubuntu respectively) so its the only supported compiler right now, haven't tested 64-bit support either. It would be able to support libraries such as phobos and tango with a few changes to the places that call into the compiler runtime or memory manager.

Right now the target audience is me. I haven't really considered who the target audience might be since I touch a bit of everything. I try and make it as generic and as modular as I can, so if someone doesn't need a package they can remove it from their build without getting tons of compile errors. I myself am focusing towards GUI application development with unified 2D/3D rendering and custom controls on top of that rendering as part of the runtime library, among many other things.

So you could say it has to do with meshes and textures, although I haven't gotten to making interfaces for that part yet. The most I did on that level with my runtime was to write a reader for Blizzard's MPQ archives and extract model and texture data to render it in opengl, but apart from the MPQ reader it was all pretty ugly mixing win32 and gl code along with other stuff in the same routine to get the model on screen as fast as possible ;)

I really am just beginning to notice people are interested in my project, I don't know when I'll put it on dsource and/or sourceforge. And given that D2 is still under heavy development it wouldn't be practical right now. I don't mind releasing bits and pieces of it but I would much rather see the first public release of it to be an usable one, although the compiler implementation part is pretty much stable at this point, if there's enough demand for it I might begin with that.

Jeremie


More information about the Digitalmars-d-announce mailing list