mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-09 05:27:47 +00:00
Unify context menu / hover tooltip code + UI improvements
This commit is contained in:
@@ -34,6 +34,14 @@ fn read_dwarf1_line_info() {
|
||||
insta::assert_debug_snapshot!(line_infos);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "ppc")]
|
||||
fn read_extab() {
|
||||
let diff_config = diff::DiffObjConfig::default();
|
||||
let obj = obj::read::parse(include_object!("data/ppc/NMWException.o"), &diff_config).unwrap();
|
||||
insta::assert_debug_snapshot!(obj);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "ppc")]
|
||||
fn diff_ppc() {
|
||||
|
||||
BIN
objdiff-core/tests/data/ppc/NMWException.o
Normal file
BIN
objdiff-core/tests/data/ppc/NMWException.o
Normal file
Binary file not shown.
521
objdiff-core/tests/snapshots/arch_ppc__read_extab.snap
Normal file
521
objdiff-core/tests/snapshots/arch_ppc__read_extab.snap
Normal file
@@ -0,0 +1,521 @@
|
||||
---
|
||||
source: objdiff-core/tests/arch_ppc.rs
|
||||
expression: obj
|
||||
---
|
||||
Object {
|
||||
arch: ArchPpc {
|
||||
extab: Some(
|
||||
{
|
||||
10: ExceptionInfo {
|
||||
eti_symbol: ExtabSymbolRef {
|
||||
original_index: 5,
|
||||
name: "@31",
|
||||
demangled_name: None,
|
||||
},
|
||||
etb_symbol: ExtabSymbolRef {
|
||||
original_index: 4,
|
||||
name: "@30",
|
||||
demangled_name: None,
|
||||
},
|
||||
data: ExceptionTableData {
|
||||
flag_val: 8200,
|
||||
has_elf_vector: false,
|
||||
large_frame: true,
|
||||
has_frame_pointer: false,
|
||||
saved_cr: false,
|
||||
fpr_save_range: 0,
|
||||
gpr_save_range: 4,
|
||||
et_field: 0,
|
||||
pc_actions: [],
|
||||
exception_actions: [],
|
||||
relocations: [],
|
||||
},
|
||||
dtors: [],
|
||||
},
|
||||
11: ExceptionInfo {
|
||||
eti_symbol: ExtabSymbolRef {
|
||||
original_index: 7,
|
||||
name: "@52",
|
||||
demangled_name: None,
|
||||
},
|
||||
etb_symbol: ExtabSymbolRef {
|
||||
original_index: 6,
|
||||
name: "@51",
|
||||
demangled_name: None,
|
||||
},
|
||||
data: ExceptionTableData {
|
||||
flag_val: 8200,
|
||||
has_elf_vector: false,
|
||||
large_frame: true,
|
||||
has_frame_pointer: false,
|
||||
saved_cr: false,
|
||||
fpr_save_range: 0,
|
||||
gpr_save_range: 4,
|
||||
et_field: 0,
|
||||
pc_actions: [
|
||||
PCAction {
|
||||
start_pc: 96,
|
||||
end_pc: 96,
|
||||
action_offset: 16,
|
||||
},
|
||||
],
|
||||
exception_actions: [
|
||||
ExceptionAction {
|
||||
action_offset: 16,
|
||||
action_type: DestroyLocal,
|
||||
action_param: 0,
|
||||
has_end_bit: true,
|
||||
bytes: [
|
||||
0,
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
],
|
||||
},
|
||||
],
|
||||
relocations: [
|
||||
Relocation {
|
||||
offset: 20,
|
||||
address: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
dtors: [
|
||||
ExtabSymbolRef {
|
||||
original_index: 12,
|
||||
name: "__dt__26__partial_array_destructorFv",
|
||||
demangled_name: Some(
|
||||
"__partial_array_destructor::~__partial_array_destructor()",
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
12: ExceptionInfo {
|
||||
eti_symbol: ExtabSymbolRef {
|
||||
original_index: 9,
|
||||
name: "@60",
|
||||
demangled_name: None,
|
||||
},
|
||||
etb_symbol: ExtabSymbolRef {
|
||||
original_index: 8,
|
||||
name: "@59",
|
||||
demangled_name: None,
|
||||
},
|
||||
data: ExceptionTableData {
|
||||
flag_val: 6152,
|
||||
has_elf_vector: false,
|
||||
large_frame: true,
|
||||
has_frame_pointer: false,
|
||||
saved_cr: false,
|
||||
fpr_save_range: 0,
|
||||
gpr_save_range: 3,
|
||||
et_field: 0,
|
||||
pc_actions: [],
|
||||
exception_actions: [],
|
||||
relocations: [],
|
||||
},
|
||||
dtors: [],
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
endianness: Big,
|
||||
symbols: [
|
||||
Symbol {
|
||||
name: "NMWException.cpp",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 0,
|
||||
kind: Unknown,
|
||||
section: None,
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "[.text]",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 0,
|
||||
kind: Section,
|
||||
section: Some(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "[extab]",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 0,
|
||||
kind: Section,
|
||||
section: Some(
|
||||
1,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "[extabindex]",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 0,
|
||||
kind: Section,
|
||||
section: Some(
|
||||
2,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "@30",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 8,
|
||||
kind: Object,
|
||||
section: Some(
|
||||
1,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "@31",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 12,
|
||||
kind: Object,
|
||||
section: Some(
|
||||
2,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "@51",
|
||||
demangled_name: None,
|
||||
address: 8,
|
||||
size: 24,
|
||||
kind: Object,
|
||||
section: Some(
|
||||
1,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "@52",
|
||||
demangled_name: None,
|
||||
address: 12,
|
||||
size: 12,
|
||||
kind: Object,
|
||||
section: Some(
|
||||
2,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "@59",
|
||||
demangled_name: None,
|
||||
address: 32,
|
||||
size: 8,
|
||||
kind: Object,
|
||||
section: Some(
|
||||
1,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "@60",
|
||||
demangled_name: None,
|
||||
address: 24,
|
||||
size: 12,
|
||||
kind: Object,
|
||||
section: Some(
|
||||
2,
|
||||
),
|
||||
flags: FlagSet(Local),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "__destroy_arr",
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
size: 120,
|
||||
kind: Function,
|
||||
section: Some(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(Global | HasExtra),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "__construct_array",
|
||||
demangled_name: None,
|
||||
address: 120,
|
||||
size: 248,
|
||||
kind: Function,
|
||||
section: Some(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(Global | HasExtra),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "__dt__26__partial_array_destructorFv",
|
||||
demangled_name: Some(
|
||||
"__partial_array_destructor::~__partial_array_destructor()",
|
||||
),
|
||||
address: 368,
|
||||
size: 184,
|
||||
kind: Function,
|
||||
section: Some(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(Global | Weak | HasExtra),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
Symbol {
|
||||
name: "__dl__FPv",
|
||||
demangled_name: Some(
|
||||
"operator delete(void*)",
|
||||
),
|
||||
address: 0,
|
||||
size: 0,
|
||||
kind: Unknown,
|
||||
section: None,
|
||||
flags: FlagSet(Global),
|
||||
align: None,
|
||||
virtual_address: None,
|
||||
},
|
||||
],
|
||||
sections: [
|
||||
Section {
|
||||
id: ".text-0",
|
||||
name: ".text",
|
||||
address: 0,
|
||||
size: 552,
|
||||
kind: Code,
|
||||
data: SectionData(
|
||||
552,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
10,
|
||||
),
|
||||
address: 516,
|
||||
target_symbol: 13,
|
||||
addend: 0,
|
||||
},
|
||||
],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: "extab-0",
|
||||
name: "extab",
|
||||
address: 0,
|
||||
size: 40,
|
||||
kind: Data,
|
||||
data: SectionData(
|
||||
40,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 28,
|
||||
target_symbol: 12,
|
||||
addend: 0,
|
||||
},
|
||||
],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: "extabindex-0",
|
||||
name: "extabindex",
|
||||
address: 0,
|
||||
size: 36,
|
||||
kind: Data,
|
||||
data: SectionData(
|
||||
36,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 0,
|
||||
target_symbol: 10,
|
||||
addend: 0,
|
||||
},
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 8,
|
||||
target_symbol: 4,
|
||||
addend: 0,
|
||||
},
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 12,
|
||||
target_symbol: 11,
|
||||
addend: 0,
|
||||
},
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 20,
|
||||
target_symbol: 6,
|
||||
addend: 0,
|
||||
},
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 24,
|
||||
target_symbol: 12,
|
||||
addend: 0,
|
||||
},
|
||||
Relocation {
|
||||
flags: Elf(
|
||||
1,
|
||||
),
|
||||
address: 32,
|
||||
target_symbol: 8,
|
||||
addend: 0,
|
||||
},
|
||||
],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".rela.text-0",
|
||||
name: ".rela.text",
|
||||
address: 0,
|
||||
size: 12,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".relaextab-0",
|
||||
name: ".relaextab",
|
||||
address: 0,
|
||||
size: 12,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".relaextabindex-0",
|
||||
name: ".relaextabindex",
|
||||
address: 0,
|
||||
size: 72,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".symtab-0",
|
||||
name: ".symtab",
|
||||
address: 0,
|
||||
size: 240,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".strtab-0",
|
||||
name: ".strtab",
|
||||
address: 0,
|
||||
size: 121,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".shstrtab-0",
|
||||
name: ".shstrtab",
|
||||
address: 0,
|
||||
size: 97,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
Section {
|
||||
id: ".comment-0",
|
||||
name: ".comment",
|
||||
address: 0,
|
||||
size: 164,
|
||||
kind: Unknown,
|
||||
data: SectionData(
|
||||
0,
|
||||
),
|
||||
flags: FlagSet(),
|
||||
relocations: [],
|
||||
line_info: {},
|
||||
virtual_address: None,
|
||||
},
|
||||
],
|
||||
split_meta: None,
|
||||
path: None,
|
||||
timestamp: None,
|
||||
}
|
||||
@@ -6,6 +6,7 @@ Object {
|
||||
arch: ArchPpc {
|
||||
extab: None,
|
||||
},
|
||||
endianness: Big,
|
||||
symbols: [
|
||||
Symbol {
|
||||
name: "IObj.cpp",
|
||||
|
||||
@@ -7,6 +7,7 @@ Object {
|
||||
bits: 32,
|
||||
endianness: Little,
|
||||
},
|
||||
endianness: Little,
|
||||
symbols: [
|
||||
Symbol {
|
||||
name: "objdiffstaticdebug.cpp",
|
||||
|
||||
Reference in New Issue
Block a user