-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Add code from rgbds-live patch #1604
Comments
I'd be happy to include rgbds-live support directly in rgbds (they're both gbdev projects, after all), but I don't think this would work out well. Say that rgbds tag |
hmmm, good point added value is that patching would have "anchor point in git" so changes in rgbds would not causing need for changes in rgbds.patch |
the code could be:
#ifdef DEBUG_SYMBOLS
Symbol *sym_AddDebugSymbol();
#else
#define sym_AddDebugSymbol()
#endif
#ifdef DEBUG_SYMBOLS
Symbol *sym_AddDebugSymbol() {
static uint64_t debugSymbolCounter = 1;
std::shared_ptr<FileStackNode> fstk = fstk_GetFileStack();
while (fstk->type == NODE_REPT) {
fstk = fstk->parent;
}
char valueBuf[64];
snprintf(
valueBuf,
sizeof(valueBuf),
"~~DEB~%" PRIx64 "~%" PRIx32 "~",
debugSymbolCounter ++,
lexer_GetLineNo()
);
std::string name = valueBuf;
name += fstk->name();
Symbol *sym = &createSymbol(name);
sym->type = SYM_LABEL;
sym->data = static_cast<int32_t>(sect_GetSymbolOffset());
sym->isExported = true;
sym->section = sect_GetSymbolSection();
updateSymbolFilename(*sym);
return sym;
}
#endif generated code would have case 26: // $@2: %empty
#line 506 "src/asm/parser.y"
{ sym_AddDebugSymbol(); }
#line 1209 "src/asm/parser.cpp"
break; with |
hmmm,we could even push it further and make those symbols a general debugging symbols for every instruction |
rgbds-live deploys its current Plus, this would spread the " |
Now building rgbds-live requires applying patch ... What if we would add this code CONDITIONALLY (
#ifdef DEBUG_SYMBOLS
) to the rgbds itselfTask to do:
-DDEBUG_SYMBOLS
to test build! this is important - so if someone modify the api used in rgbds-live code test would failThe text was updated successfully, but these errors were encountered: