Skip to content

Commit ea949b9

Browse files
authored
Merge pull request mozilla#20845 from calixteman/new_debugger
Update the internal viewer to use a new debugger.
2 parents d8a40d9 + 2381ac6 commit ea949b9

4 files changed

Lines changed: 3350 additions & 302 deletions

File tree

src/core/internal_viewer_utils.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const InternalViewerUtils = {
5656
const refs = Array.isArray(contentsVal) ? contentsVal : [contentsVal];
5757
const rawContents = [];
5858
const tokens = [];
59+
const rawBytesArr = [];
5960
for (const rawRef of refs) {
6061
if (rawRef instanceof Ref) {
6162
rawContents.push({ num: rawRef.num, gen: rawRef.gen });
@@ -64,10 +65,21 @@ const InternalViewerUtils = {
6465
if (!(stream instanceof BaseStream)) {
6566
continue;
6667
}
67-
tokens.push(...this.tokenizeStream(stream, xref));
68+
rawBytesArr.push(stream.getString());
69+
stream.reset();
70+
for (const token of this.tokenizeStream(stream, xref)) {
71+
tokens.push(token);
72+
}
6873
}
74+
const rawBytes = rawBytesArr.join("\n");
6975
const { instructions, cmdNames } = this.groupIntoInstructions(tokens);
70-
return { contentStream: true, instructions, cmdNames, rawContents };
76+
return {
77+
contentStream: true,
78+
instructions,
79+
cmdNames,
80+
rawContents,
81+
rawBytes,
82+
};
7183
},
7284

7385
// Lazily-built reverse map: OPS numeric id → property name string.

0 commit comments

Comments
 (0)