This is a rework of my original patch which introduced a new class hierarchy into llvm-symbolizer. Now that DIContext has moved to a common layer, this patch simply uses DIContext, resulting in much nicer code in llvm-symbolizer.
Inline frames are not yet supported, so we fall back to just pretending like the option wasn't specified whenever a PDBContext is in use. Test program:
Here is some program output showing that it works:
d:\testexe>cat test.c
void foo() {
}
int main() {
foo();
}
d:\testexe>dumpbin /DISASM test.exe | grep "_foo:\|_main:" --after-context=1
_foo:
00401020: 55 push ebp
--
_main:
00401030: 55 push ebp
d:\testexe>d:\src\llvmbuild\ninja\bin\llvm-symbolizer.exe --obj test.exe
0x401020
_foo
d:\testexe\test.c:1:0
0x401030
_main
d:\testexe\test.c:4:0