Add 'None' demangler option

This commit is contained in:
Luke Street 2025-09-22 23:31:57 -06:00
parent fe8e7029f6
commit 1866158092
3 changed files with 16 additions and 17 deletions

View File

@ -37,18 +37,23 @@
"name": "Auto", "name": "Auto",
"description": "Try to automatically guess the mangling format." "description": "Try to automatically guess the mangling format."
}, },
{
"value": "none",
"name": "None",
"description": "Disable demangling."
},
{ {
"value": "codewarrior", "value": "codewarrior",
"name": "CodeWarrior" "name": "CodeWarrior"
}, },
{
"value": "msvc",
"name": "MSVC"
},
{ {
"value": "itanium", "value": "itanium",
"name": "Itanium" "name": "Itanium"
}, },
{
"value": "msvc",
"name": "MSVC"
},
{ {
"value": "gnu_legacy", "value": "gnu_legacy",
"name": "GNU g++ (Legacy)", "name": "GNU g++ (Legacy)",
@ -312,26 +317,17 @@
{ {
"id": "mips", "id": "mips",
"name": "MIPS", "name": "MIPS",
"properties": [ "properties": ["mips.abi", "mips.instrCategory", "mips.registerPrefix"]
"mips.abi",
"mips.instrCategory",
"mips.registerPrefix"
]
}, },
{ {
"id": "ppc", "id": "ppc",
"name": "PowerPC", "name": "PowerPC",
"properties": [ "properties": ["ppc.calculatePoolRelocations", "analyzeDataFlow"]
"ppc.calculatePoolRelocations",
"analyzeDataFlow"
]
}, },
{ {
"id": "x86", "id": "x86",
"name": "x86", "name": "x86",
"properties": [ "properties": ["x86.formatter"]
"x86.formatter"
]
} }
] ]
} }

View File

@ -6,6 +6,7 @@ use crate::diff::Demangler;
impl Demangler { impl Demangler {
pub fn demangle(&self, name: &str) -> Option<String> { pub fn demangle(&self, name: &str) -> Option<String> {
match self { match self {
Demangler::None => None,
Demangler::Codewarrior => Self::demangle_codewarrior(name), Demangler::Codewarrior => Self::demangle_codewarrior(name),
Demangler::Msvc => Self::demangle_msvc(name), Demangler::Msvc => Self::demangle_msvc(name),
Demangler::Itanium => Self::demangle_itanium(name), Demangler::Itanium => Self::demangle_itanium(name),

View File

@ -20,7 +20,9 @@ pub fn demangle_window(
.selected_text(state.demangler.name().to_string()) .selected_text(state.demangler.name().to_string())
.show_ui(ui, |ui| { .show_ui(ui, |ui| {
for demangler in Demangler::variants() { for demangler in Demangler::variants() {
ui.selectable_value(&mut state.demangler, *demangler, demangler.name()); if *demangler != Demangler::None {
ui.selectable_value(&mut state.demangler, *demangler, demangler.name());
}
} }
}); });
ui.separator(); ui.separator();