Bug Tracker – Bug 905

Debugging issues

Last modified: 2019-12-22 22:00:03 UTC
Bug 905 - Debugging issues
Summary: Debugging issues
Status: NEW
Alias: None
Product: Odamex
Classification: Unclassified
Component: Client (show other bugs)
Version: (old) 0.6.x
Hardware: All Windows (Any)
: P1 normal
Assignee: Odamex Bug Reporter
Depends on:
Reported: 2012-09-15 23:43 UTC by Russell Rice
Modified: 2019-12-22 22:00 UTC (History)
2 users (show)

See Also:


Add an attachment (proposed patch, testcase, etc.)

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 UTC
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: http://www.koders.com/c/fid992E7EC1F2CEFBFF12A5BF1B2734262183CC0B16.aspx?s=%22sam%22#L2

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 UTC
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 UTC
Manc is also in favor of this, you missed his favorable reply in IRC by a few hours.
Comment 3 HeX_Vulture 2019-12-22 22:00:03 UTC
Was anything ever done with this?