print precompiled source name & line number in stacktraces
This commit is contained in:
parent
0c88263659
commit
452a117818
@ -20,7 +20,8 @@
|
|||||||
#error "Cannot use USE_REPLXX_IO without USE_REPLXX"
|
#error "Cannot use USE_REPLXX_IO without USE_REPLXX"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
STATIC_GLOBAL B replPath, replName;
|
STATIC_GLOBAL B replPath;
|
||||||
|
GLOBAL B replName; // used in vm.c
|
||||||
STATIC_GLOBAL Scope* gsc;
|
STATIC_GLOBAL Scope* gsc;
|
||||||
STATIC_GLOBAL bool repl_initialized = false;
|
STATIC_GLOBAL bool repl_initialized = false;
|
||||||
|
|
||||||
|
|||||||
5
src/vm.c
5
src/vm.c
@ -1334,6 +1334,7 @@ void popCatch() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern GLOBAL B replName; // from main.c
|
||||||
NOINLINE B vm_fmtPoint(B src, B prepend, B path, usz cs, usz ce) { // consumes prepend
|
NOINLINE B vm_fmtPoint(B src, B prepend, B path, usz cs, usz ce) { // consumes prepend
|
||||||
SGetU(src)
|
SGetU(src)
|
||||||
usz srcL = IA(src);
|
usz srcL = IA(src);
|
||||||
@ -1346,8 +1347,8 @@ NOINLINE B vm_fmtPoint(B src, B prepend, B path, usz cs, usz ce) { // consumes p
|
|||||||
i64 ln = 1;
|
i64 ln = 1;
|
||||||
for (usz i = 0; i < srcS; i++) if(o2cG(GetU(src, i))=='\n') ln++;
|
for (usz i = 0; i < srcS; i++) if(o2cG(GetU(src, i))=='\n') ln++;
|
||||||
B s = prepend;
|
B s = prepend;
|
||||||
if (isArr(path) && (IA(path)==0 || IGetU(path,0).u!=m_c32('(').u)) AFMT("%R:%l:\n ", path, ln);
|
if (!isArr(path) || path.u==replName.u) AFMT("at ");
|
||||||
else AFMT("at ");
|
else AFMT("%R:%l:\n ", path, ln);
|
||||||
i64 padEnd = (i64)IA(s);
|
i64 padEnd = (i64)IA(s);
|
||||||
i64 padStart = padEnd;
|
i64 padStart = padEnd;
|
||||||
SGetU(s)
|
SGetU(s)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user