#include <iostream>
#include <vector>
using namespace std;
struct test_1
{
int k;
vector<int> vec;
int e;
};
struct test_2
{
int a;
test_1 mm;
int b;
};
int main()
{
cout << "Hello world!" << endl;
test_2* tt = new test_2;
tt->b = 10;
cout << tt->b;
tt->mm.vec.push_back(22);
tt->mm.vec.push_back(33);
tt->mm.vec.push_back(44);
tt->mm.vec.push_back(55);
delete tt;
return 0;
}
At E:\Programmieren\gdb-test\main.cpp:27
[debug]> info locals
[debug] eip = 0x4013de in main (######\main.cpp:27); saved eip 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args:
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug] ebx at 0x28ff0c, ebp at 0x28ff18, esi at 0x28ff10, edi at 0x28ff14, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:tt = 0x6911c0
[debug]> info args
[debug]>>>>>>cb_gdb:
[debug]> whatis *tt
[debug]No arguments.
[debug]>>>>>>cb_gdb:type = test_2
[debug]> output *tt
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]{
[debug] a = -1163005939,
[debug] mm = {
[debug] k = -1163005939,
[debug] vec = std::vector of length 0, capacity 0,
[debug] e = -1163005939
[debug] },
[debug] b = 10
[debug]}>>>>>>cb_gdb:#0 main () at ######main.cpp:27
[debug]> x/32xb 0x0
[debug]>>>>>>cb_gdb:
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: ####\gdb-test\
Adding source dir: ####\gdb-test\
Adding file: ####\gdb-test\bin\Debug\gdb-test.exe
Changing directory to: ####/gdb-test/.
Set variable: PATH=.;#####
[debug]Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args ####/gdb-test/bin/Debug/gdb-test.exe
[debug]Working dir : ####\gdb-test
Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args ####/gdb-test/bin/Debug/gdb-test.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from ####\gdb-test\bin\Debug\gdb-test.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5.50.20130204-cvs
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5.50.20130204-cvs
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> python
import sys
import gdb
import wx
sys.path.insert(0, 'C:\MinGW\share\gcc-4.7.1\python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
set print pretty 1
catch catch
[debug]>>>>>>>
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:Catchpoint 2 (catch)
[debug]> directory ####/gdb-test/
[debug]>>>>>>cb_gdb:
[debug]> break "####/gdb-test/main.cpp:29"
[debug]Source directories searched: ####/gdb-test;$cdir;$cwd
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4013f9: file ####\gdb-test\main.cpp, line 29.
Source directories searched: ####/gdb-test;$cdir;$cwd
[debug]> run
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Starting program: ####\gdb-test\bin\Debug\gdb-test.exe
Child process PID: 13688
[debug][New Thread 13688.0x3604]
[debug]Breakpoint 3, main () at ####\gdb-test\main.cpp:29
[debug]####\gdb-test\main.cpp:29:335:beg:0x4013f9
[debug]>>>>>>cb_gdb:Stack level 0, frame at 0x28ff30:
At ####\gdb-test\main.cpp:29
[debug]> info locals
[debug] eip = 0x4013f9 in main (####\gdb-test\main.cpp:29); saved eip 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args:
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug] ebx at 0x28ff0c, ebp at 0x28ff18, esi at 0x28ff10, edi at 0x28ff14, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:tt = 0x6711c0
[debug]> info args
[debug]ii = {
[debug] k = 44,
[debug] vec = std::vector of length 0, capacity 0,
[debug] e = 2686728
[debug]}
[debug]>>>>>>cb_gdb:No arguments.
[debug]> whatis *tt
[debug]>>>>>>cb_gdb:
[debug]> output *tt
[debug]type = test_2
[debug]>>>>>>cb_gdb:{
[debug]> bt 30
[debug] a = -1163005939,
[debug] mm = {
[debug] k = -1163005939,
[debug] vec = std::vector of length 0, capacity 0,
[debug] e = -1163005939
[debug] },
[debug] b = 10
[debug]}>>>>>>cb_gdb:#0 main () at ####\gdb-test\main.cpp:29
[debug]> x/32xb 0x0
[debug]>>>>>>cb_gdb:
[debug]Cannot access memory at address 0x0
[debug]0x0: >>>>>>cb_gdb:
python
import sys
import gdb
import wx
sys.path.insert(0, 'C:\MinGW\share\gcc-4.7.1\python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
set print pretty 1
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: ####\gdb-test\
Adding source dir: ####\gdb-test\
Adding file: ####\gdb-test\bin\Debug\gdb-test.exe
Changing directory to: ####/gdb-test/.
Set variable: PATH=#####
[debug]Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args ####/gdb-test/bin/Debug/gdb-test.exe
[debug]Working dir : ####\gdb-test
Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args ####/gdb-test/bin/Debug/gdb-test.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from ####\gdb-test\bin\Debug\gdb-test.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5.50.20130204-cvs
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5.50.20130204-cvs
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source c:\MinGW\bin\gdb_init.txt
[debug]Catchpoint 2 (catch)
[debug]>>>>>>cb_gdb:Catchpoint 3 (catch)
[debug]> directory ####/gdb-test/
[debug]>>>>>>cb_gdb:
[debug]> break "####/gdb-test/main.cpp:28"
[debug]Source directories searched: ####/gdb-test;$cdir;$cwd
[debug]>>>>>>cb_gdb:Breakpoint 4 at 0x4013ef: file ####\gdb-test\main.cpp, line 28.
Source directories searched: ####/gdb-test;$cdir;$cwd
[debug]> run
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Starting program: ####\gdb-test\bin\Debug\gdb-test.exe
Child process PID: 1948
[debug][New Thread 1948.0x105c]
[debug]Breakpoint 4, main () at ####\gdb-test\main.cpp:28
[debug]####\gdb-test\main.cpp:28:318:beg:0x4013ef
[debug]>>>>>>cb_gdb:Stack level 0, frame at 0x28ff30:
At ####\gdb-test\main.cpp:28
[debug]> info locals
[debug] eip = 0x4013ef in main (####\gdb-test\main.cpp:28); saved eip 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args:
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug] ebx at 0x28ff0c, ebp at 0x28ff18, esi at 0x28ff10, edi at 0x28ff14, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:tt = 0x6711c0
[debug]> info args
[debug]ii = {
[debug] k = 44,
[debug] vec = {
[debug] <std::_Vector_base<int, std::allocator<int> >> = {
[debug] _M_impl = {
[debug] <std::allocator<int>> = {
[debug] <__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>},
[debug] members of std::_Vector_base<int, std::allocator<int> >::_Vector_impl:
[debug] _M_start = 0x0,
[debug] _M_finish = 0x0,
[debug] _M_end_of_storage = 0x0
[debug] }
[debug] }, <No data fields>},
[debug] e = 2686728
[debug]}
[debug]>>>>>>cb_gdb:No arguments.
[debug]> whatis *tt
[debug]>>>>>>cb_gdb:
[debug]> output *tt
[debug]type = test_2
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]{
[debug] a = -1163005939,
[debug] mm = {
[debug] k = -1163005939,
[debug] vec = {
[debug] <std::_Vector_base<int, std::allocator<int> >> = {
[debug] _M_impl = {
[debug] <std::allocator<int>> = {
[debug] <__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>},
[debug] members of std::_Vector_base<int, std::allocator<int> >::_Vector_impl:
[debug] _M_start = 0x0,
[debug] _M_finish = 0x0,
[debug] _M_end_of_storage = 0x0
[debug] }
[debug] }, <No data fields>},
[debug] e = -1163005939
[debug] },
[debug] b = -1163005939
[debug]}>>>>>>cb_gdb:#0 main () at ####\gdb-test\main.cpp:28
[debug]> x/32xb 0x0
[debug]>>>>>>cb_gdb:
[debug]Cannot access memory at address 0x0
[debug]0x0: >>>>>>cb_gdb: