1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-05-28 08:41:30 +00:00

fixed debugging in listing view

This commit is contained in:
Steven Hugg 2019-06-01 21:14:52 -04:00
parent ed7f5fb7a6
commit fcc358a1ab
4 changed files with 9 additions and 10 deletions

View File

@ -155,9 +155,6 @@ TODO:
- support projects with subdirectories, file list?
- emulator needs reset shortcut for nes
- switching platform of a repo?
- z80
- can't single step on PUSH insns in listings?
- order of acheader.s
- ctrl+alt+l on ubuntu locks screen
WEB WORKER FORMAT

View File

@ -492,10 +492,11 @@ export class ListingView extends DisassemblerView implements ProjectView {
refreshListing() {
// lookup corresponding assemblyfile for this file, using listing
var lst = current_project.getListingForFile(this.path);
if (lst && lst.assemblyfile && lst.assemblyfile !== this.assemblyfile) {
// TODO?
if (lst && lst.assemblyfile) {
this.assemblyfile = lst.assemblyfile;
}
else if (lst && lst.sourcefile && lst.sourcefile !== this.assemblyfile) {
else if (lst && lst.sourcefile) {
this.assemblyfile = lst.sourcefile;
}
}

View File

@ -1273,7 +1273,7 @@ function linkSDLDZ80(step:BuildStep)
if (fn.endsWith('.lst')) {
var rstout = FS.readFile(fn.replace('.lst','.rst'), {encoding:'utf8'});
// 0000 21 02 00 [10] 52 ld hl, #2
var asmlines = parseListing(rstout, /^\s*([0-9A-F]+)\s+([0-9A-F][0-9A-F r]*[0-9A-F])\s+\[([0-9 ]+)\]\s+(\d+) (.*)/i, 4, 1, 2);
var asmlines = parseListing(rstout, /^\s*([0-9A-F]{4})\s+([0-9A-F][0-9A-F r]*[0-9A-F])\s+(\[[0-9 ]+\])?\s+(\d+) (.*)/i, 4, 1, 2);
var srclines = parseSourceLines(rstout, /^\s+\d+ ;<stdin>:(\d+):/i, /^\s*([0-9A-F]{4})/i);
putWorkFile(fn, rstout);
// TODO: you have to get rid of all source lines to get asm listing

View File

@ -11,15 +11,15 @@ export interface SourceLine {
export class SourceFile {
lines: SourceLine[];
text: string;
offset2line: {[offset:number]:number};
line2offset: {[line:number]:number};
offset2line: Map<number,number>; //{[offset:number]:number};
line2offset: Map<number,number>; //{[line:number]:number};
constructor(lines:SourceLine[], text?:string) {
lines = lines || [];
this.lines = lines;
this.text = text;
this.offset2line = {};
this.line2offset = {};
this.offset2line = new Map();
this.line2offset = new Map();
for (var info of lines) {
if (info.offset >= 0) {
this.offset2line[info.offset] = info.line;
@ -32,6 +32,7 @@ export class SourceFile {
for (var i=0; i<=lookbehind; i++) {
var line = this.offset2line[PC];
if (line >= 0) {
//console.log(this.lines.length, PC.toString(16), line);
return line;
}
PC--;