mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Add -B/--backtrace option to RGBASM and RGBLINK (#1787)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "platform.hpp"
|
||||
|
||||
#include "link/assign.hpp"
|
||||
#include "link/fstack.hpp"
|
||||
#include "link/main.hpp"
|
||||
#include "link/section.hpp"
|
||||
#include "link/symbol.hpp"
|
||||
@@ -280,7 +281,7 @@ void sdobj_ReadFile(FileStackNode const &src, FILE *file, std::vector<Symbol> &f
|
||||
// The following is required for fragment offsets to be reliably predicted
|
||||
for (FileSection &entry : fileSections) {
|
||||
if (!strcmp(token, entry.section->name.c_str())) {
|
||||
fatalAt(where, "Area \"%s\" already defined earlier", token);
|
||||
fatalAt(where, "Area \"%s\" already defined", token);
|
||||
}
|
||||
}
|
||||
char const *sectName = token; // We'll deal with the section's name depending on type
|
||||
@@ -422,14 +423,14 @@ void sdobj_ReadFile(FileStackNode const &src, FILE *file, std::vector<Symbol> &f
|
||||
|| (symbolSection && !symbolSection->isAddressFixed)) {
|
||||
sym_AddSymbol(symbol); // This will error out
|
||||
} else if (otherValue != symbolValue) {
|
||||
errorNoDump(
|
||||
"\"%s\" is defined as %" PRId32 " at ", symbol.name.c_str(), symbolValue
|
||||
fatalTwoAt(
|
||||
symbol,
|
||||
*other,
|
||||
"\"%s\" is defined as %" PRId32 ", but was already defined as %" PRId32,
|
||||
symbol.name.c_str(),
|
||||
symbolValue,
|
||||
otherValue
|
||||
);
|
||||
symbol.src->dump(symbol.lineNo);
|
||||
fprintf(stderr, ", but as %" PRId32 " at ", otherValue);
|
||||
other->src->dump(other->lineNo);
|
||||
putc('\n', stderr);
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
// Add a new definition
|
||||
|
||||
Reference in New Issue
Block a user