Browse Source

Worked on IDE to get GDB debugger working.

wes 4 years ago
parent
commit
772495225c
4 changed files with 38 additions and 4 deletions
  1. 28 0
      .vscode/launch.json
  2. 2 1
      .vscode/settings.json
  3. 3 1
      Makefile
  4. 5 2
      ToDo/ToDo.txt

+ 28 - 0
.vscode/launch.json

@@ -0,0 +1,28 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "(gdb) Launch",
+            "type": "cppdbg",
+            "request": "launch",
+            "program": "${workspaceFolder}/${fileBasenameNoExtension}/${fileBasenameNoExtension}.exe",
+            "args": [],
+            "stopAtEntry": false,
+            "cwd": "${workspaceFolder}",
+            "environment": [],
+            "externalConsole": false,
+            "MIMode": "gdb",
+            "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
+            "setupCommands": [
+                {
+                    "description": "Enable pretty-printing for gdb",
+                    "text": "-enable-pretty-printing",
+                    "ignoreFailures": true
+                }
+            ]
+        }
+    ]
+}

+ 2 - 1
.vscode/settings.json

@@ -1,3 +1,4 @@
 {
-    "files.eol": "\n"
+    "files.eol": "\n",
+    "terminal.integrated.scrollback": 50000
 }

+ 3 - 1
Makefile

@@ -33,4 +33,6 @@ libharuEXMP.exe : libharuEXMP.cpp libharuEXMP/libpng16.dll libharuEXMP/libhpdf.d
 cleanPDFtest.exe : cleanPDFtest.cpp cleanPDFtest/libpng16.dll cleanPDFtest/libhpdf.dll
 	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
 BasicImageAndText.exe pdfHummusTest1.exe PauseAndContinue.exe :  
-	g++ -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include $(@:.exe=.cpp) -L C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/objs -lall -o $(basename $@)/$@
+	g++ -g -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include $(@:.exe=.cpp) -L C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/objs -lall -o $(basename $@)/$@
+#  also make the object file for debugging reasons
+#	g++ -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include -c $(@:.exe=.cpp) -o $(basename $@)/$(@:.exe=.o)

+ 5 - 2
ToDo/ToDo.txt

@@ -5,6 +5,9 @@ The text could be getting overwritten. The image resource or any resources loade
 Make sure logme files are put into GitIGNORE or other text files we dont want.
 
 30April20
-Figure out this error message for pdfHummusTest1.exe:
+1) Figure out this error message for pdfHummusTest1.exe:
     terminate called after throwing an instance of 'std::bad_alloc'
-    what():  std::bad_alloc
+    what():  std::bad_alloc 
+segmentation fault was found on line 99 of the code.
+2) Debugger only seems to work if we use the -g command when compiling to include debug inside of executable. Find out if we can do this another way or if we need to 
+turn that on and off, manually. This may lead to another task of addding this to all other targets in the makefile.