User forums > General (but related to Code::Blocks)

nested watches don't get cleared

(1/2) > >>

BlueHazzard:
Hi,
if you restart a debugging session the watches for nested variables don't get deleted, you can see it in the screenshot.

i think latest svn and Windows 7 but i think this doesn't matter ;)



greetings

oBFusCATed:
Simple source and steps to reproduce please!

BlueHazzard:
i try to reproduce the bug, but it is not simple to recreate a small project with the same conditions...

anyway i have found a other bug:

--- Code: ---#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;
}

--- End code ---

if you add a watch for *tt and add a breakpoint in the line with cout << tt->b; i don't get any output in the watches. If i make a step, the output works. You have to restart the debugger to get the first breakpoint in this line. so exact steps:
1) Add breakpoint at the line "cout << tt->b;"
2) run debugger
3) if debugger stops add watch for "*tt"
4) Stop debugger
5) Start debugger

My debug log:

--- Code: ---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:

--- End code ---

for my first bug, i will try to create a test project, but i think that there is some property grid clear missing somewhere...

greetings

oBFusCATed:
It seems that the output has gotten out-of-sync. Can you post the full log?
What versions of c::b, gdb, gcc are you using?

I cannot reproduce the problem on linux with gdb 7.7-r1!

BlueHazzard:
full build log:

--- Code: ---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:


--- End code ---

c::b svn 9636

the "catch catch" in the options seems to make some trouble or?

Navigation

[0] Message Index

[#] Next page

Go to full version