summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRainer Schuetze <r.sagitario@gmx.de>2021-12-10 14:59:47 (GMT)
committerGitHub <noreply@github.com>2021-12-10 14:59:47 (GMT)
commit7919a6249cc6efa12a1a3b710c8d12cca79398eb (patch)
treedffc6e6b6aff4ae45c7fdcf8e4dd1f66fc57d587 /src/main.cpp
parent9e0795af0123ea890c43805d956ada5eae8b30d8 (diff)
parent13a21e913a1bdeaba5eeba4c66f7ae08e0596a1a (diff)
downloadcv2pdb-7919a6249cc6efa12a1a3b710c8d12cca79398eb.zip
cv2pdb-7919a6249cc6efa12a1a3b710c8d12cca79398eb.tar.gz
cv2pdb-7919a6249cc6efa12a1a3b710c8d12cca79398eb.tar.bz2
Merge pull request #69 from neerajsi-msft/dwarf5
Add support for Dwarf5 as emitted by gcc-11.2
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ced7aac..91b300a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,6 +21,8 @@ double
#define T_strcpy wcscpy
#define T_strcat wcscat
#define T_strstr wcsstr
+#define T_strncmp wcsncmp
+#define T_strtoul wcstoul
#define T_strtod wcstod
#define T_strrchr wcsrchr
#define T_unlink _wremove
@@ -34,6 +36,8 @@ double
#define T_strcpy strcpy
#define T_strcat strcat
#define T_strstr strstr
+#define T_strncmp strncmp
+#define T_strtoul strtoul
#define T_strtod strtod
#define T_strrchr strrchr
#define T_unlink unlink
@@ -120,7 +124,7 @@ int T_main(int argc, TCHAR* argv[])
{
double Dversion = 2.072;
const TCHAR* pdbref = 0;
- bool debug = false;
+ DebugLevel debug = DebugLevel{};
CoInitialize(nullptr);
@@ -138,8 +142,15 @@ int T_main(int argc, TCHAR* argv[])
demangleSymbols = false;
else if (argv[0][1] == 'e')
useTypedefEnum = true;
- else if (argv[0][1] == 'd' && argv[0][2] == 'e' && argv[0][3] == 'b') // deb[ug]
- debug = true;
+ else if (!T_strncmp(&argv[0][1], TEXT("debug"), 5)) // debug[level]
+ {
+ debug = (DebugLevel)T_strtoul(&argv[0][6], 0, 0);
+ if (!debug) {
+ debug = DbgBasic;
+ }
+
+ fprintf(stderr, "Debug set to %x\n", debug);
+ }
else if (argv[0][1] == 's' && argv[0][2])
dotReplacementChar = (char)argv[0][2];
else if (argv[0][1] == 'p' && argv[0][2])
@@ -182,9 +193,8 @@ int T_main(int argc, TCHAR* argv[])
img = &dbg;
}
- CV2PDB cv2pdb(*img);
+ CV2PDB cv2pdb(*img, debug);
cv2pdb.Dversion = Dversion;
- cv2pdb.debug = debug;
cv2pdb.initLibraries();
TCHAR* outname = argv[1];