Affected IDA version:
Probably all of them starting from the very first version to include clang support and up to 9.2 beta 2.
Steps to reproduce.
- Compile the following C++ program (Windows, Linux, MacOS):
int main(){}
-
Open and decompile generated executable in IDA (any other executable will also do).
-
Under Options > Compiler choose:
- “Source parser”: clang (new or old does not matter);
- "Parser specific options” check “Apply tinfo to mangled names” (may not be relevant for this super simple example but important for real use-cases when mangled debug names are available in the executable).
- Do File > Load file > Parse C header file (Ctrl+F9) for the following header file:
struct SimpleStruct
{
int a; // Change type/name here then reparse (see step 6 below).
int b;
};
template<typename T>
struct TemplatedStruct
{
int a; // Change type/name here then reparse (see step 6 below).
T b;
};
using dummy = TemplatedStruct<int>; // This line forces IDA to create a Local Type for TemplatedStruct<int> in the IDA database.
-
Inspect “Local Types” window and observe created definitions for
SimpleStruct
andTemplatedStruct<int>
. -
Modify header file above, for ex. change
int a;
tochar aaa;
for bothSimpleStruct
andTemplatedStruct<int>
. -
Parse Ctrl+F9 modified header file again.
-
Inspect “Local Types” window and observe how the old definition for
SimpleStruct
is updated withchar aaa;
but the definition forTemplatedStruct<int>
is not updated.
Expected behaviour:
Reparsing header file automatically updates definition of TemplatedStruct<int>
in IDA Local Types analogous how it updated definition for SimpleStruct
.