objdiff-wasm 3.0.0-beta.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,20 @@
25
25
  }
26
26
  ]
27
27
  },
28
+ {
29
+ "id": "analyzeDataFlow",
30
+ "type": "boolean",
31
+ "default": false,
32
+ "name": "(Experimental) Perform data flow analysis",
33
+ "description": "Use data flow analysis to display known information about register contents where possible"
34
+ },
35
+ {
36
+ "id": "showDataFlow",
37
+ "type": "boolean",
38
+ "default": true,
39
+ "name": "Show data flow",
40
+ "description": "Show data flow analysis results in place of register name where present"
41
+ },
28
42
  {
29
43
  "id": "spaceBetweenArgs",
30
44
  "type": "boolean",
@@ -264,7 +278,8 @@
264
278
  "id": "ppc",
265
279
  "name": "PowerPC",
266
280
  "properties": [
267
- "ppc.calculatePoolRelocations"
281
+ "ppc.calculatePoolRelocations",
282
+ "analyzeDataFlow"
268
283
  ]
269
284
  },
270
285
  {
@@ -1,10 +1,46 @@
1
1
  /** @module Interface objdiff:core/diff **/
2
- export function runDiff(left: Object | undefined, right: Object | undefined, config: DiffConfig): DiffResult;
2
+ export function runDiff(left: Object | undefined, right: Object | undefined, config: DiffConfig, mapping: MappingConfig): DiffResult;
3
3
  export interface MappingConfig {
4
4
  mappings: Array<[string, string]>,
5
5
  selectingLeft?: string,
6
6
  selectingRight?: string,
7
7
  }
8
+ export type SymbolRef = number;
9
+ /**
10
+ * # Variants
11
+ *
12
+ * ## `"unknown"`
13
+ *
14
+ * ## `"function"`
15
+ *
16
+ * ## `"object"`
17
+ *
18
+ * ## `"section"`
19
+ */
20
+ export type SymbolKind = 'unknown' | 'function' | 'object' | 'section';
21
+ export interface SymbolFlags {
22
+ global?: boolean,
23
+ local?: boolean,
24
+ weak?: boolean,
25
+ common?: boolean,
26
+ hidden?: boolean,
27
+ hasExtra?: boolean,
28
+ sizeInferred?: boolean,
29
+ ignored?: boolean,
30
+ }
31
+ export interface SymbolInfo {
32
+ id: SymbolRef,
33
+ name: string,
34
+ demangledName?: string,
35
+ address: bigint,
36
+ size: bigint,
37
+ kind: SymbolKind,
38
+ section?: number,
39
+ sectionName?: string,
40
+ flags: SymbolFlags,
41
+ align?: number,
42
+ virtualAddress?: bigint,
43
+ }
8
44
  export interface DiffResult {
9
45
  left?: ObjectDiff,
10
46
  right?: ObjectDiff,
@@ -30,5 +66,6 @@ export class ObjectDiff {
30
66
  * This type does not have a public constructor.
31
67
  */
32
68
  private constructor();
33
- findSymbol(name: string, sectionName: string | undefined): number | undefined;
69
+ findSymbol(name: string, sectionName: string | undefined): SymbolInfo | undefined;
70
+ getSymbol(id: number): SymbolInfo | undefined;
34
71
  }
@@ -1,15 +1,16 @@
1
1
  /** @module Interface objdiff:core/display **/
2
2
  export function displaySections(diff: ObjectDiff, filter: SymbolFilter, config: DisplayConfig): Array<SectionDisplay>;
3
- export function displaySymbol(diff: ObjectDiff, symbol: SectionDisplaySymbol): SymbolDisplay;
4
- export function displayInstructionRow(diff: ObjectDiff, symbol: SectionDisplaySymbol, rowIndex: number, config: DiffConfig): InstructionDiffRow;
5
- export function symbolContext(diff: ObjectDiff, symbol: SectionDisplaySymbol): Array<ContextItem>;
6
- export function symbolHover(diff: ObjectDiff, symbol: SectionDisplaySymbol): Array<HoverItem>;
7
- export function instructionContext(diff: ObjectDiff, symbol: SectionDisplaySymbol, rowIndex: number, config: DiffConfig): Array<ContextItem>;
8
- export function instructionHover(diff: ObjectDiff, symbol: SectionDisplaySymbol, rowIndex: number, config: DiffConfig): Array<HoverItem>;
3
+ export function displaySymbol(diff: ObjectDiff, symbol: SymbolRef): SymbolDisplay;
4
+ export function displayInstructionRow(diff: ObjectDiff, symbol: SymbolRef, rowIndex: number, config: DiffConfig): InstructionDiffRow;
5
+ export function symbolContext(diff: ObjectDiff, symbol: SymbolRef): Array<ContextItem>;
6
+ export function symbolHover(diff: ObjectDiff, symbol: SymbolRef): Array<HoverItem>;
7
+ export function instructionContext(diff: ObjectDiff, symbol: SymbolRef, rowIndex: number, config: DiffConfig): Array<ContextItem>;
8
+ export function instructionHover(diff: ObjectDiff, symbol: SymbolRef, rowIndex: number, config: DiffConfig): Array<HoverItem>;
9
9
  export type Object = import('./objdiff-core-diff.js').Object;
10
10
  export type ObjectDiff = import('./objdiff-core-diff.js').ObjectDiff;
11
11
  export type DiffConfig = import('./objdiff-core-diff.js').DiffConfig;
12
- export type SymbolRef = number;
12
+ export type SymbolInfo = import('./objdiff-core-diff.js').SymbolInfo;
13
+ export type SymbolRef = import('./objdiff-core-diff.js').SymbolRef;
13
14
  export interface DisplayConfig {
14
15
  showHiddenSymbols: boolean,
15
16
  showMappedSymbols: boolean,
@@ -19,49 +20,15 @@ export interface SymbolFilter {
19
20
  regex?: string,
20
21
  mapping?: SymbolRef,
21
22
  }
22
- export interface SectionDisplaySymbol {
23
- symbol: SymbolRef,
24
- isMappingSymbol: boolean,
25
- }
26
23
  export interface SectionDisplay {
27
24
  id: string,
28
25
  name: string,
29
26
  size: bigint,
30
27
  matchPercent?: number,
31
- symbols: Array<SectionDisplaySymbol>,
32
- }
33
- /**
34
- * # Variants
35
- *
36
- * ## `"unknown"`
37
- *
38
- * ## `"function"`
39
- *
40
- * ## `"object"`
41
- *
42
- * ## `"section"`
43
- */
44
- export type SymbolKind = 'unknown' | 'function' | 'object' | 'section';
45
- export interface SymbolFlags {
46
- global?: boolean,
47
- local?: boolean,
48
- weak?: boolean,
49
- common?: boolean,
50
- hidden?: boolean,
51
- hasExtra?: boolean,
52
- sizeInferred?: boolean,
53
- ignored?: boolean,
28
+ symbols: Uint32Array,
54
29
  }
55
30
  export interface SymbolDisplay {
56
- name: string,
57
- demangledName?: string,
58
- address: bigint,
59
- size: bigint,
60
- kind: SymbolKind,
61
- section?: number,
62
- flags: SymbolFlags,
63
- align?: number,
64
- virtualAddress?: bigint,
31
+ info: SymbolInfo,
65
32
  targetSymbol?: SymbolRef,
66
33
  matchPercent?: number,
67
34
  diffScore?: [bigint, bigint],
@@ -179,7 +146,7 @@ export interface DiffTextSpacing {
179
146
  export interface DiffTextEol {
180
147
  tag: 'eol',
181
148
  }
182
- export type DiffTextColor = DiffTextColorNormal | DiffTextColorDim | DiffTextColorBright | DiffTextColorReplace | DiffTextColorDelete | DiffTextColorInsert | DiffTextColorRotating;
149
+ export type DiffTextColor = DiffTextColorNormal | DiffTextColorDim | DiffTextColorBright | DiffTextColorReplace | DiffTextColorDataFlow | DiffTextColorDelete | DiffTextColorInsert | DiffTextColorRotating;
183
150
  export interface DiffTextColorNormal {
184
151
  tag: 'normal',
185
152
  }
@@ -192,6 +159,9 @@ export interface DiffTextColorBright {
192
159
  export interface DiffTextColorReplace {
193
160
  tag: 'replace',
194
161
  }
162
+ export interface DiffTextColorDataFlow {
163
+ tag: 'data-flow',
164
+ }
195
165
  export interface DiffTextColorDelete {
196
166
  tag: 'delete',
197
167
  }
Binary file