52 lines
1.1 KiB
Markdown
52 lines
1.1 KiB
Markdown
Come eseguire il debug
|
|
Compila:
|
|
|
|
|
|
make
|
|
|
|
Avvia GDB:
|
|
|
|
|
|
gdb debug/test_cpp_python.exe
|
|
|
|
|
|
in gdb
|
|
|
|
break test_cpp_python.cpp:14
|
|
run
|
|
source scripts/dump_vector.py
|
|
dump_to_json myVector
|
|
dump_to_csv myVector
|
|
|
|
|
|
Troverai output.json e output.csv nella root del progetto.
|
|
|
|
|
|
|
|
|
|
////////////////////////////
|
|
|
|
|
|
Reading symbols from C:\src\____GitProjects\cpp_python_debug\ws_luna\test_cpp_python\Debug\test_cpp_python.exe...
|
|
(gdb) b 25
|
|
Breakpoint 1 at 0x401740: file ../src/test_cpp_python.cpp, line 25.
|
|
(gdb) run
|
|
Starting program: C:\src\____GitProjects\cpp_python_debug\ws_luna\test_cpp_python\Debug\test_cpp_python.exe
|
|
[New Thread 6004.0x2004]
|
|
[New Thread 6004.0x2f04]
|
|
[New Thread 6004.0x21b4]
|
|
|
|
Thread 1 hit Breakpoint 1, main () at ../src/test_cpp_python.cpp:25
|
|
25 std::cout << "Break here" << std::endl; // <-- punto di stop
|
|
(gdb) source C:\src\____GitProjects\cpp_python_debug\cpp_python_debug\core\gdb_dumper.py
|
|
(gdb) dump_json myInt
|
|
START_JSON_OUTPUT
|
|
987
|
|
END_JSON_OUTPUT
|
|
(gdb) dump_json myDouble
|
|
START_JSON_OUTPUT
|
|
123.456
|
|
END_JSON_OUTPUT
|
|
(gdb) dump_json myStruct
|
|
START_JSON_OUTPUT
|
|
DEBUG_STRING_TRACE: _serializ |