mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-08-08 07:40:39 -09:00
Merge remote-tracking branch 'origin/GP-7106_ghizard_Improve_MDMang_extended_data_types'
This commit is contained in:
@@ -352,19 +352,19 @@ public class MDDataTypeParser {
|
||||
dt = new MDArrayBasicType(dmang);
|
||||
break;
|
||||
case 'P':
|
||||
dt = new MDUnknownPExtendedDataType(dmang);
|
||||
dt = new MDAutoDataType(dmang);
|
||||
break;
|
||||
case 'Q':
|
||||
dt = new MDChar8DataType(dmang);
|
||||
break;
|
||||
case 'R':
|
||||
dt = new MDUnknownRExtendedDataType(dmang);
|
||||
dt = new MDAngleUnknownDataType(dmang);
|
||||
break;
|
||||
case 'S':
|
||||
dt = new MDChar16DataType(dmang);
|
||||
break;
|
||||
case 'T':
|
||||
dt = new MDUnknownTExtendedDataType(dmang);
|
||||
dt = new MDDecltypeAutoDataType(dmang);
|
||||
break;
|
||||
case 'U':
|
||||
dt = new MDChar32DataType(dmang);
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -18,11 +18,11 @@ package mdemangler.datatype.extended;
|
||||
import mdemangler.MDMang;
|
||||
|
||||
/**
|
||||
* This class represents an _R Extended data type within a Microsoft mangled symbol.
|
||||
* This class represents an "<unknown>" data type within a Microsoft mangled symbol.
|
||||
*/
|
||||
public class MDUnknownRExtendedDataType extends MDExtendedType {
|
||||
public class MDAngleUnknownDataType extends MDExtendedType {
|
||||
|
||||
public MDUnknownRExtendedDataType(MDMang dmang) {
|
||||
public MDAngleUnknownDataType(MDMang dmang) {
|
||||
super(dmang);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -18,16 +18,16 @@ package mdemangler.datatype.extended;
|
||||
import mdemangler.MDMang;
|
||||
|
||||
/**
|
||||
* This class represents an _P Extended data type within a Microsoft mangled symbol.
|
||||
* This class represents an "auto" data type within a Microsoft mangled symbol.
|
||||
*/
|
||||
public class MDUnknownPExtendedDataType extends MDExtendedType {
|
||||
public class MDAutoDataType extends MDExtendedType {
|
||||
|
||||
public MDUnknownPExtendedDataType(MDMang dmang) {
|
||||
public MDAutoDataType(MDMang dmang) {
|
||||
super(dmang);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "UNKNOWN";
|
||||
return "auto";
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -18,16 +18,16 @@ package mdemangler.datatype.extended;
|
||||
import mdemangler.MDMang;
|
||||
|
||||
/**
|
||||
* This class represents an _T Extended data type within a Microsoft mangled symbol.
|
||||
* This class represents a "decltype(auto)" data type within a Microsoft mangled symbol.
|
||||
*/
|
||||
public class MDUnknownTExtendedDataType extends MDExtendedType {
|
||||
public class MDDecltypeAutoDataType extends MDExtendedType {
|
||||
|
||||
public MDUnknownTExtendedDataType(MDMang dmang) {
|
||||
public MDDecltypeAutoDataType(MDMang dmang) {
|
||||
super(dmang);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "UNKNOWN";
|
||||
return "decltype(auto)";
|
||||
}
|
||||
}
|
||||
@@ -1615,11 +1615,19 @@ public class MDMangBaseTest extends AbstractGenericTest {
|
||||
@Test
|
||||
public void testExtendedTypes__P() throws Exception {
|
||||
mangled = "?Name@@3_PA";
|
||||
msTruth = "UNKNOWN Name";
|
||||
msTruth = "auto Name";
|
||||
mdTruth = msTruth;
|
||||
demangleAndTest();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedTypes__P_1() throws Exception {
|
||||
mangled = "?a@@YA?A_PXZ";
|
||||
msTruth = "auto __cdecl a(void)";
|
||||
mdTruth = msTruth;
|
||||
demangleAndTest16Bit();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedTypes__Q() throws Exception {
|
||||
mangled = "?Name@@3_QA";
|
||||
@@ -1636,6 +1644,14 @@ public class MDMangBaseTest extends AbstractGenericTest {
|
||||
demangleAndTest();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedTypes__R_1() throws Exception {
|
||||
mangled = "?a@@YA?A_RXZ";
|
||||
msTruth = "<unknown> __cdecl a(void)";
|
||||
mdTruth = msTruth;
|
||||
demangleAndTest16Bit();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedTypes__S() throws Exception {
|
||||
mangled = "?Name@@3_SA";
|
||||
@@ -1647,11 +1663,19 @@ public class MDMangBaseTest extends AbstractGenericTest {
|
||||
@Test
|
||||
public void testExtendedTypes__T() throws Exception {
|
||||
mangled = "?Name@@3_TA";
|
||||
msTruth = "UNKNOWN Name";
|
||||
msTruth = "decltype(auto) Name";
|
||||
mdTruth = msTruth;
|
||||
demangleAndTest();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedTypes__T_1() throws Exception {
|
||||
mangled = "?a@@YA?A_TXZ";
|
||||
msTruth = "decltype(auto) __cdecl a(void)";
|
||||
mdTruth = msTruth;
|
||||
demangleAndTest16Bit();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedTypes__U() throws Exception {
|
||||
mangled = "?Name@@3_UA";
|
||||
|
||||
Reference in New Issue
Block a user