Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddebug submodule update #614

Merged
merged 10 commits into from
Oct 5, 2024
Merged

Conversation

winterheart
Copy link
Collaborator

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

This PR refactors and unifies ddebug submodule to use SDL_assert() for all platforms. Since SDL_assert() implements own debug_break functionality, bundled version is redundant. Synced DMFC macros with ddebug since there was some compatibility issues. Error handling (pserror.h) is also moved from misc submodule to ddebug.

Related Issues

Screenshots (if applicable)

SDL_assert window on Linux
SDL_assert

SDL_assert window on Windows
Descent-new-debug-break

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

Additional Comments

This function is stubbed and does nothing.
Reworked ASSERT() and Int3() macros to use SDL_assert(). SDL_assert() allows to debug break from user decision.

Major reorganizing platform-dependent code to make it platform-independent.
if (DebugBreak_callback_resume) \
(*DebugBreak_callback_resume)(); \
} while (0)

// Does a DEBUG_BREAK() if debugging is turned on.
#define Int3() \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we're renaming stuff, we should also rename Int3 to something like abort (you can suggest a better name), Int3 is an assembly instruction without much semantic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There too much Int3() usage, PR would be much wider. If this OK, I'd propose ABORT()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with ABORT

ddebug/pserror.h Outdated Show resolved Hide resolved
ddebug/pserror.h Outdated Show resolved Hide resolved
Copy link
Member

@Lgt2x Lgt2x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tested on Linux Debug & Release builds

@Lgt2x Lgt2x merged commit 7ca92bd into DescentDevelopers:main Oct 5, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants