D - Exceptions
- Sean L. Palmer (97/98) Oct 19 2002 Walter, your exception stuff shows up very wierd in the Visual Studio .N...
- Walter (11/28) Oct 21 2002 Hmm. Try windbg.exe with it (comes on the Digital Mars CD).
- Sean L. Palmer (14/44) Oct 21 2002 The -g switch helps alot. ;)
- Walter (4/10) Nov 12 2002 I have no idea. I just use regular printf's and redirect the output to a
- Sean L. Palmer (4/17) Nov 13 2002 So how do we redirect printf from inside the program? Is there a hook?
- Walter (3/22) Nov 13 2002 Not that I know of. I've always thought that was a curious bug in Window...
- Lloyd Dupont (3/30) Nov 13 2002 what about changing stdout with .. I don't remember but there is
- Richard Krehbiel (10/17) Nov 14 2002 What you want is freopen, for example freopen("redirect_stdout.txt","w",
- Sean L. Palmer (8/12) Nov 14 2002 I don't wanna send it to a file, I wanna send it to OutputDebugString so...
- Russ Lewis (6/6) Nov 14 2002 vsprintf, actually. Ugly :(
- Sean L. Palmer (15/16) Nov 14 2002 Right. Oops! Well that's the way I've always done it in C++ (Usually,
- Walter (5/23) Nov 21 2002 I rarely bother with stdio. I tend to use a different set of functions t...
- Sean L. Palmer (6/20) Nov 14 2002 Sounds like printf isn't all that, after all. ;(
- Walter (9/30) Nov 21 2002 I have my own that writes to a log file. Each line is flushed and the fi...
- Evan McClanahan (11/22) Oct 22 2002 I've thought of that solution myself, but I really think that it would
Walter, your exception stuff shows up very wierd in the Visual Studio .NET debugger. ;) Any chance you can insert some line number info inside of the app's D code? All I get is RTL stuff. ;) Lots of cleanup I see has been done to the Windows.d. Lots more left to do also. hehehe Do you want my winbase.d, wingdi.d, and winuser.d? They fill in a few holes in Win32 support. I'm sure nobody else wants to declare their own winapi stuff anymore than they have to. Until then I'm not sure what's crashing. I'll go poke around on the stack for a bit and see what I can come up with. If I can get a good D testbed going with good debugger integration I think I hate C++ lately so doing my own stuff in it seems like a chore. I'd rather code in D at this point I think. But D has a ways to go before it will be usable for my main line of work for a while. C++ is the only viable alternative for games work right now. Other languages sacrifice too much performance. <sigh> I hear some people want to hook up a C++ engine to a Python game core. I'd rather just write the whole thing in D, and I don't see why we can't come up with something that powerful. Sean TestVector.exe!_d_newclass(void * ci=0x00414f24) Line 82 + 0x17 C TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char * msg=0x0041544c) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x00031428) Line 256 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x00031428, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x69616d64) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316()TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char* msg=0x0041544c) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x00031850) Line 256 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x00031850, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x69616d64) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316() TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char * msg=0x0041544c) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x00031c78) Line 256 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x00031c78, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x69616d64) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316() TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char * msg=0x0041544c) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x000320a0) Line 256 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x000320a0, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x69616d64) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316() TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char * msg=0x0041544c) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x000324c8) Line 256 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x000324c8, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x69616d64) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316() TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char * msg=0x0041544c) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x000328f0) Line 256 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x000328f0, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x69616d64) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316() TestVector.exe!_d_create_exception_object(ClassInfo * ci=0x00415364, char * msg=0x0041545d) Line 222 + 0x8 C TestVector.exe!_d_translate_se_to_d_exception(_EXCEPTION_RECORD * exception_record=0x00032d18) Line 260 + 0xf C TestVector.exe!_d_framehandler(_EXCEPTION_RECORD * exception_record=0x00032d18, DEstablisherFrame * frame=0x0012ff74, _CONTEXT context={...}, void * dispatcher_context=0x00032ffc) Line 149 + 0x8 C NTDLL.DLL!77f8e440() NTDLL.DLL!77f8e4db() NTDLL.DLL!77fa0316() TestVector.exe!_Dmain(unsigned __int64 args=0x0012ff3800000001) Line 785 + 0x5 C TestVector.exe!main(int argc=0x00000001, void * argv=0x009213d8) Line 48 + 0x7 C TestVector.exe!_mainCRTStartup() + 0x8a KERNEL32.DLL!77e9ca90()
Oct 19 2002
"Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:aor2fk$111u$1 digitaldaemon.com...Walter, your exception stuff shows up very wierd in the Visual Studio .NET debugger. ;)Hmm. Try windbg.exe with it (comes on the Digital Mars CD).Any chance you can insert some line number info inside of the app's Dcode?All I get is RTL stuff. ;)Compile with -g and line number info should be inserted.Lots of cleanup I see has been done to the Windows.d. Lots more left todoalso. hehehe Do you want my winbase.d, wingdi.d, and winuser.d? Theyfillin a few holes in Win32 support. I'm sure nobody else wants to declare their own winapi stuff anymore than they have to. Until then I'm not sure what's crashing. I'll go poke around on the stack for a bit and see what I can come up with.Ok, but if there's a bug in D I need a test case so it can be fixed.If I can get a good D testbed going with good debugger integration I thinkIhate C++ lately so doing my own stuff in it seems like a chore. I'drathercode in D at this point I think. But D has a ways to go before it will be usable for my main line of work for a while. C++ is the only viable alternative for games work right now. Other languages sacrifice too much performance. <sigh>I can fix the bugs, but I need test cases!
Oct 21 2002
The -g switch helps alot. ;) Well this is a big improvement. Wish I had symbol info inside VS .NET though. I have a question... does printf show up in the Output log window (via OutputDebugString) if you don't have a console open? Sean "Walter" <walter digitalmars.com> wrote in message news:ap0ejq$g4k$1 digitaldaemon.com..."Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:aor2fk$111u$1 digitaldaemon.com....NETWalter, your exception stuff shows up very wierd in the Visual Studiostackdebugger. ;)Hmm. Try windbg.exe with it (comes on the Digital Mars CD).Any chance you can insert some line number info inside of the app's Dcode?All I get is RTL stuff. ;)Compile with -g and line number info should be inserted.Lots of cleanup I see has been done to the Windows.d. Lots more left todoalso. hehehe Do you want my winbase.d, wingdi.d, and winuser.d? Theyfillin a few holes in Win32 support. I'm sure nobody else wants to declare their own winapi stuff anymore than they have to. Until then I'm not sure what's crashing. I'll go poke around on thethinkfor a bit and see what I can come up with.Ok, but if there's a bug in D I need a test case so it can be fixed.If I can get a good D testbed going with good debugger integration IIreallybehate C++ lately so doing my own stuff in it seems like a chore. I'drathercode in D at this point I think. But D has a ways to go before it willmuchusable for my main line of work for a while. C++ is the only viable alternative for games work right now. Other languages sacrifice tooperformance. <sigh>I can fix the bugs, but I need test cases!
Oct 21 2002
"Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:ap0mft$o3g$1 digitaldaemon.com...The -g switch helps alot. ;) Well this is a big improvement. Wish I had symbol info inside VS .NET though. I have a question... does printf show up in the Output log window (via OutputDebugString) if you don't have a console open? SeanI have no idea. I just use regular printf's and redirect the output to a file. For a GUI app I have a printf that logs to a text file.
Nov 12 2002
So how do we redirect printf from inside the program? Is there a hook? Sean "Walter" <walter digitalmars.com> wrote in message news:aqrj7k$nee$1 digitaldaemon.com..."Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:ap0mft$o3g$1 digitaldaemon.com...The -g switch helps alot. ;) Well this is a big improvement. Wish I had symbol info inside VS .NET though. I have a question... does printf show up in the Output log window (via OutputDebugString) if you don't have a console open? SeanI have no idea. I just use regular printf's and redirect the output to a file. For a GUI app I have a printf that logs to a text file.
Nov 13 2002
Not that I know of. I've always thought that was a curious bug in Windows. "Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:aqt2bc$5jv$1 digitaldaemon.com...So how do we redirect printf from inside the program? Is there a hook? Sean "Walter" <walter digitalmars.com> wrote in message news:aqrj7k$nee$1 digitaldaemon.com..."Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:ap0mft$o3g$1 digitaldaemon.com...The -g switch helps alot. ;) Well this is a big improvement. Wish I had symbol info inside VS .NET though. I have a question... does printf show up in the Output log window (via OutputDebugString) if you don't have a console open? SeanI have no idea. I just use regular printf's and redirect the output to a file. For a GUI app I have a printf that logs to a text file.
Nov 13 2002
Walter wrote:Not that I know of. I've always thought that was a curious bug in Windows. "Sean L. Palmer" wrote in message news:aqt2bc$5jv$1 digitaldaemon.com...what about changing stdout with .. I don't remember but there is function for this...So how do we redirect printf from inside the program? Is there a hook? Sean "Walter" wrote in message news:aqrj7k$nee$1 digitaldaemon.com..."Sean L. Palmer" wrote in message news:ap0mft$o3g$1 digitaldaemon.com...The -g switch helps alot. ;) Well this is a big improvement. Wish I had symbol info inside VS .NET though. I have a question... does printf show up in the Output log window (via OutputDebugString) if you don't have a console open? SeanI have no idea. I just use regular printf's and redirect the output to a file. For a GUI app I have a printf that logs to a text file.
Nov 13 2002
What you want is freopen, for example freopen("redirect_stdout.txt","w", stdout); It's even in the C standard. (I'm kinda surprised you forgot about this, Walter.) "Lloyd Dupont" <lloyd galador.net> wrote in message news:aqv9cj$81f$1 digitaldaemon.com...Walter wrote:Windows.Not that I know of. I've always thought that was a curious bug in-- Richard Krehbiel, Arlington, VA, USA rich kastle.com (work) or krehbiel3 comcast.net (personal)"Sean L. Palmer" wrote in message news:aqt2bc$5jv$1 digitaldaemon.com...So how do we redirect printf from inside the program? Is there a hook?
Nov 14 2002
I don't wanna send it to a file, I wanna send it to OutputDebugString so it shows up in the debugger Output window. Is that so much to ask? I'm just gonna have to make my own printf function based on sprintf, aren't I? Windows is so screwed up. Sean "Richard Krehbiel" <rich kastle.com> wrote in message news:ar0gsi$1jg7$1 digitaldaemon.com...What you want is freopen, for example freopen("redirect_stdout.txt","w", stdout); It's even in the C standard. (I'm kinda surprised you forgot about this, Walter.)
Nov 14 2002
vsprintf, actually. Ugly :( -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Nov 14 2002
Right. Oops! Well that's the way I've always done it in C++ (Usually, "void DebugPrintf(const char*,...);"), why should D be any different? I thought Windows apps stubbed out the stdin/stdout/stderr handles; I wasn't aware you could redirect to a file. Good to know. Still it seems to make sense to me that if you don't have a console, the output should go somewhere useful (OutputDebugString) instead of to dev/nul. Otherwise newbies will printf a bunch of stuff and wonder why it doesn't show up anywhere. Maybe someone could make a redirector that dumps all of stdin to OutputDebugString, and pipe the app to that. Sounds easy enough but it seems like there might be a process boundary issue. Only one way to find out! Sean "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message news:3DD4169B.BFD7E96E deming-os.org...vsprintf, actually. Ugly :(
Nov 14 2002
I rarely bother with stdio. I tend to use a different set of functions that call Windows directly. "Richard Krehbiel" <rich kastle.com> wrote in message news:ar0gsi$1jg7$1 digitaldaemon.com...What you want is freopen, for example freopen("redirect_stdout.txt","w", stdout); It's even in the C standard. (I'm kinda surprised you forgot about this, Walter.) "Lloyd Dupont" <lloyd galador.net> wrote in message news:aqv9cj$81f$1 digitaldaemon.com...hook?Walter wrote:Windows.Not that I know of. I've always thought that was a curious bug in"Sean L. Palmer" wrote in message news:aqt2bc$5jv$1 digitaldaemon.com...So how do we redirect printf from inside the program? Is there a-- Richard Krehbiel, Arlington, VA, USA rich kastle.com (work) or krehbiel3 comcast.net (personal)
Nov 21 2002
Sounds like printf isn't all that, after all. ;( Sean "Walter" <walter digitalmars.com> wrote in message news:aqua4e$283n$2 digitaldaemon.com...Not that I know of. I've always thought that was a curious bug in Windows. "Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:aqt2bc$5jv$1 digitaldaemon.com...aSo how do we redirect printf from inside the program? Is there a hook? SeanI have no idea. I just use regular printf's and redirect the output to(viafile. For a GUI app I have a printf that logs to a text file.I have a question... does printf show up in the Output log windowOutputDebugString) if you don't have a console open? Sean
Nov 14 2002
I have my own that writes to a log file. Each line is flushed and the file closed, so that it is uptodate before the program crashes. I find it invaluable <g>, and not just for windows. I've used it for shared dlls under linux, too, where I had no control over stdout. "Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:aqvkt8$khi$1 digitaldaemon.com...Sounds like printf isn't all that, after all. ;( Sean "Walter" <walter digitalmars.com> wrote in message news:aqua4e$283n$2 digitaldaemon.com...Windows.Not that I know of. I've always thought that was a curious bug inhook?"Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message news:aqt2bc$5jv$1 digitaldaemon.com...So how do we redirect printf from inside the program? Is there atoSeanI have no idea. I just use regular printf's and redirect the outputa(viafile. For a GUI app I have a printf that logs to a text file.I have a question... does printf show up in the Output log windowOutputDebugString) if you don't have a console open? Sean
Nov 21 2002
Sean L. Palmer wrote:If I can get a good D testbed going with good debugger integration I think I hate C++ lately so doing my own stuff in it seems like a chore. I'd rather code in D at this point I think. But D has a ways to go before it will be usable for my main line of work for a while. C++ is the only viable alternative for games work right now. Other languages sacrifice too much performance. <sigh> I hear some people want to hook up a C++ engine to a Python game core. I'd rather just write the whole thing in D, and I don't see why we can't come up with something that powerful.I've thought of that solution myself, but I really think that it would be lacking in speed, and have a ton of integration issues, as there isn't a clean, automatic way at the moment to integrate python and C++. I'm also in the D games camp (if the d community ever grows large enough for SIGs). I plan, if the tools stabilize quickly enough, to write my next game demo (sample source and what have you) in D. While it's in C++ at the moment, I feel that porting what i have to D will be easy enough, once the tools fall into place, and will also result in a nice readability and code size improvement at the same time. Evan
Oct 22 2002