Bug Tracker – Bug 905

Debugging issues

Last modified: 2012-09-23 15:26:43 CDT
Bug 905 - (ARRAY(0x63824d8)) Debugging issues
Debugging issues
Status: NEW
Product: Odamex
Classification: Unclassified
Component: Client
All Windows (Any)
: P1 normal
Depends on:
  Show dependency tree
Reported: 2012-09-15 23:43:59 CDT by Russell Rice
Modified: 2012-09-23 15:26 CDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Russell Rice 2012-09-15 23:43:59 CDT
Finally figured this out..

When exiting the client on windows in a gdb session doesn't cause it to shut down, this is because we link with the SDLmain library which does some funky-ass shit (the real issue: using atexit() on sdl functions which in turn call system video shutdown functions (ie directx or gdi) = baaaad since the crt doesn't know shit about this stuff)

Here is the file in question that does this: ﷒0﷓

We can remove the library, but then we'd have to do one of the following:
1) Need to write our own WinMain function, which then requires us to write out own command line parsing routine to translate lpCmdLine to the argv/argc style of arguments so the rest of the code remains unaffected, DArgs has a SetArgs function to handle this kind of "tokenized" command line
2) Leave the code intact, but you'd need to compile as a console application. This means we get a hideous console window appear behind the main window, sure just call FreeConsole().. but then you'd get a console window appear/disappear suddenly

Removing this library will also let the OS decide on how to use stdout/err rather than just dumping it to a text file

Opinions on this?
Comment 1 Alexander Mayfield 2012-09-21 00:03:08 CDT
I don't see a reason why not to move forward with it, as long as it doesn't break any platforms in some horrific way.
Comment 2 Alexander Mayfield 2012-09-23 15:26:43 CDT
Manc is also in favor of this, you missed his favorable reply in IRC by a few hours.