mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-05-28 08:41:30 +00:00
worker: debuginfo passed thru to link step
This commit is contained in:
parent
c9e75ae77d
commit
75fb2a8e5c
|
@ -223,7 +223,10 @@ export abstract class BasePlatform {
|
||||||
return inspectSymbol((this as any) as Platform, sym);
|
return inspectSymbol((this as any) as Platform, sym);
|
||||||
}
|
}
|
||||||
getDebugTree() : {} {
|
getDebugTree() : {} {
|
||||||
return this.saveState();
|
var o : any = { };
|
||||||
|
o.state = this.saveState();
|
||||||
|
if (this.debugSymbols.debuginfo) o.debuginfo = this.debugSymbols.debuginfo;
|
||||||
|
return o;
|
||||||
}
|
}
|
||||||
readFile(path: string) : FileData {
|
readFile(path: string) : FileData {
|
||||||
return this.internalFiles[path];
|
return this.internalFiles[path];
|
||||||
|
|
|
@ -1410,7 +1410,6 @@ export class EntityScope implements SourceLocated {
|
||||||
if (action.critical) this.inCritical--;
|
if (action.critical) this.inCritical--;
|
||||||
if (!this.inCritical && codeeval.isSubroutineSized(eventcode)) {
|
if (!this.inCritical && codeeval.isSubroutineSized(eventcode)) {
|
||||||
let normcode = this.normalizeCode(eventcode, action);
|
let normcode = this.normalizeCode(eventcode, action);
|
||||||
// TODO: label rewriting messes this up
|
|
||||||
let estats = this.eventCodeStats[normcode];
|
let estats = this.eventCodeStats[normcode];
|
||||||
if (!estats) {
|
if (!estats) {
|
||||||
estats = this.eventCodeStats[normcode] = new EventCodeStats(
|
estats = this.eventCodeStats[normcode] = new EventCodeStats(
|
||||||
|
@ -1730,4 +1729,10 @@ export class EntityManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getDebugTree() : {} {
|
||||||
|
let scopes = this.topScopes;
|
||||||
|
let components = this.components;
|
||||||
|
let systems = this.systems;
|
||||||
|
return { scopes, components, systems };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ export function assembleECS(step: BuildStep): BuildStepResult {
|
||||||
putWorkFile(destpath, outtext);
|
putWorkFile(destpath, outtext);
|
||||||
var listings: CodeListingMap = {};
|
var listings: CodeListingMap = {};
|
||||||
listings[destpath] = {lines:[], text:outtext} // TODO
|
listings[destpath] = {lines:[], text:outtext} // TODO
|
||||||
|
var debuginfo = compiler.em.getDebugTree();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof ECSError) {
|
if (e instanceof ECSError) {
|
||||||
compiler.addError(e.message, e.$loc);
|
compiler.addError(e.message, e.$loc);
|
||||||
|
@ -33,12 +34,13 @@ export function assembleECS(step: BuildStep): BuildStepResult {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
nexttool: "ca65",
|
||||||
|
path: destpath,
|
||||||
|
args: [destpath],
|
||||||
|
files: [destpath].concat(step.files),
|
||||||
|
listings,
|
||||||
|
debuginfo
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return {
|
|
||||||
nexttool: "ca65",
|
|
||||||
path: destpath,
|
|
||||||
args: [destpath],
|
|
||||||
files: [destpath].concat(step.files),
|
|
||||||
listings
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,6 +424,7 @@ export interface BuildStep extends WorkerBuildStep {
|
||||||
code?
|
code?
|
||||||
prefix?
|
prefix?
|
||||||
maxts?
|
maxts?
|
||||||
|
debuginfo?
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -511,6 +512,11 @@ class Builder {
|
||||||
}
|
}
|
||||||
if (step.result) {
|
if (step.result) {
|
||||||
(step.result as any).params = step.params; // TODO: type check
|
(step.result as any).params = step.params; // TODO: type check
|
||||||
|
if (step.debuginfo) {
|
||||||
|
let r = step.result as any; // TODO
|
||||||
|
if (!r.debuginfo) r.debuginfo = {};
|
||||||
|
Object.assign(r.debuginfo, step.debuginfo);
|
||||||
|
}
|
||||||
// errors? return them
|
// errors? return them
|
||||||
if ('errors' in step.result && step.result.errors.length) {
|
if ('errors' in step.result && step.result.errors.length) {
|
||||||
applyDefaultErrorPath(step.result.errors, step.path);
|
applyDefaultErrorPath(step.result.errors, step.path);
|
||||||
|
@ -522,6 +528,7 @@ class Builder {
|
||||||
}
|
}
|
||||||
// combine files with a link tool?
|
// combine files with a link tool?
|
||||||
if ('linktool' in step.result) {
|
if ('linktool' in step.result) {
|
||||||
|
// add to existing link step
|
||||||
if (linkstep) {
|
if (linkstep) {
|
||||||
linkstep.files = linkstep.files.concat(step.result.files);
|
linkstep.files = linkstep.files.concat(step.result.files);
|
||||||
linkstep.args = linkstep.args.concat(step.result.args);
|
linkstep.args = linkstep.args.concat(step.result.args);
|
||||||
|
@ -533,6 +540,7 @@ class Builder {
|
||||||
args:step.result.args
|
args:step.result.args
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
linkstep.debuginfo = step.debuginfo; // TODO: multiple debuginfos
|
||||||
}
|
}
|
||||||
// process with another tool?
|
// process with another tool?
|
||||||
if ('nexttool' in step.result) {
|
if ('nexttool' in step.result) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user