Skip to content

Conversation

@interfiberschool
Copy link
Collaborator

About

Keeping the debugger active in any sort during competition is not the best idea due to the extra computation cost incured by the debug server and various debug macros such as $expose.

Solution

stub.py reads in source code files and finds usages of // stub: lines to generate empty versions of the macro or function. When the debugger is disable by defining V5DBG_DISABLE the stubbed versions are compiled instead. Note that symbols for functions and classes will still be compiled but will remain unusued and potentially stripped.

Example stub output

#pragma once
/// Stubbed version of normal $function, automatically generated
#define $function()
/// Stubbed version of normal $expose, automatically generated
#define $expose(target)
/// Stubbed version of normal $break, automatically generated
#define $break()
/// Stubbed version of normal $cbreak, automatically generated
#define $cbreak(value)
/// Stubbed version of normal $ntask, automatically generated
#define $ntask()

@interfiberschool interfiberschool added the enhancement New feature or request label Nov 18, 2025
@interfiberschool
Copy link
Collaborator Author

Once I add commits from my local copy in about 40 minutes, this can be merged into master.

Summary:

  • restub cleans object files and regenerates stub information. This is required to be called every time the config is updated, might rename this to cfgrebuild

@Interfiber Interfiber merged commit a8cd78d into master Nov 20, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants