News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

nested watches don't get cleared

Started by BlueHazzard, March 26, 2014, 09:25:22 PM

Previous topic - Next topic

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!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

#2
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:

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


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:

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:


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!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

full build log:
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:



c::b svn 9636

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

oBFusCATed

I'll bet on these:

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

It is better to put them in a file and then use the source command to execute it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

i putted it now in a seperate file, and the parsing error still exists:

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:


what is about the mi interface? Are there any plans for future work?

oBFusCATed

Can you try an official build of gdb also can you try without python printers?

About gdb/mi I've no time to work on this plugin at the moment.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]