Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Making use of backtrace?

Name: Anonymous 2010-09-01 6:00

Incoming wall of text.

I want to be able to make use of the backtrace function in order to ease debugging when my application crashes for a user. I found an implementation which seems to work on MinGW, so on the target platforms I can pretty much use SEH or signals to catch a crash, get a backtrace and do something with it (I also realize that sometimes, I won't be able to do anything good in the handler due to the state of the application. I'm willing to take that risk.)

The problem is, I don't know where to begin. I of course need the debugging information to be on a server of sorts, but I'm not even sure what I should do to get this information. How do I generate it? I know gdb can determine what line of code an address is, and I'm guessing gdb is using embedded debug info - but I can't find any reasonable sources of information for the format or how I could do this without the information embedded (although I have a feeling i could just extract and strip, it sounds redundant to me.) I'm also not sure how, using signals, I would get the backtrace, since I'm pretty sure signal handlers get a different thread. (But hell if I know. I've never actually done one.)

I saw Google Breakpad, but this is an awful solution. I checked everything out from source and it seems it doesn't really work on Windows without hacking around, and definitely not with MinGW. It might be useful for reference, but i don't think it is actually helpful in my case. Too many dependencies, not enough docs, no MinGW support... not worth it.

Any advice? I'm new here, but I'm hoping unlike /g/ people here actually know their stuff. I'm primarily concerned with MinGW right now, since I bet this will be much simpler under Linux and etc.

Name: Anonymous 2010-09-02 14:51

>>37
He does have a kind of point, in that more people can manage memory by hand shittily, than can tune a garbage collector properly.

Name: Anonymous 2010-09-02 15:10

>>41
Well, garbage collection is one way to manage memory. When you are writing a general-purpose interpreter for general-purpose interactive programming you'd probably implement garbage collection. If you were doing something different, you'd compile a subset of your language to some other representation and not use garbage collection, or only use it on certain things, etc.

Here's the simple problem: you want a language that is low enough for you to twiddle bits, but high enough so that not everything is bit twiddling. This will never happen because there's too many platforms for bit-twiddling which the higher-level stuff just doesn't give a shit about, but for which some assumptions do have to be made. One day, though, one man said to himself, "Bullshit, I am smart. I can do it." He failed, and the result of that failure is C++, in which many buggy pseudo-interpreters for shitty, underspecified languages are made every day.

Name: Anonymous 2011-01-31 20:55

<-- check em dubz

Name: Anonymous 2011-02-03 0:52

Name: Anonymous 2011-02-03 6:33


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List