Author Topic: [resolved]why CB+GDB unable see last variable alter?  (Read 2858 times)

Offline kextvizi

  • Single posting newcomer
  • *
  • Posts: 6
[resolved]why CB+GDB unable see last variable alter?
« on: June 20, 2013, 11:10:57 pm »
#include <iostream>
int main(void)
{
    int a = 3, b = 4;
    decltype(a) c = a;
    decltype((b)) d = a;
    ++c;
    ++d;//unable see a or d become 4?
}
//my english not very good,I hope I can say clear.

GDB-Version:GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu

CB-Version:

Edit: Removed large image, please use image hosting services for large images to save forum space and our bandwidth. Thank you.

2013-8-6,23:02:26 add:

by supply a  -gstabs+ option to gcc,then this problem is resolved.
« Last Edit: August 06, 2013, 05:09:20 pm by kextvizi »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12228
    • Travis build status
Re: why CB+GDB unable see last variable alter?
« Reply #1 on: June 20, 2013, 11:37:17 pm »
Because it gets out of scope at the '}'. This is problem of gdb or feature. Talk to its developers. C::B is just a wrapper.
(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!]

Offline kextvizi

  • Single posting newcomer
  • *
  • Posts: 6
Re: why CB+GDB unable see last variable alter?
« Reply #2 on: June 22, 2013, 12:34:09 pm »
Because it gets out of scope at the '}'. This is problem of gdb or feature. Talk to its developers. C::B is just a wrapper.

seem GDB no forum?(I english not not very good,I do not find)
how find to GDB forum or other methods discuss for GDB?
« Last Edit: June 22, 2013, 12:36:38 pm by kextvizi »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6765
    • My Best Post
Re: why CB+GDB unable see last variable alter?
« Reply #3 on: June 22, 2013, 03:21:15 pm »
Because it gets out of scope at the '}'. This is problem of gdb or feature. Talk to its developers. C::B is just a wrapper.

seem GDB no forum?(I english not not very good,I do not find)
how find to GDB forum or other methods discuss for GDB?

Start here http://www.gnu.org/software/gdb/mailing-lists/

NOTE: Do NOT waste their time talking about Code::Blocks!
Verify the problem exists using the gdb command line.
Then report the problem using the gdb command line as how to duplicate the issue.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline kextvizi

  • Single posting newcomer
  • *
  • Posts: 6
Re: why CB+GDB unable see last variable alter?
« Reply #4 on: June 22, 2013, 07:28:01 pm »
Because it gets out of scope at the '}'. This is problem of gdb or feature. Talk to its developers. C::B is just a wrapper.

seem GDB no forum?(I english not not very good,I do not find)
how find to GDB forum or other methods discuss for GDB?

Start here http://www.gnu.org/software/gdb/mailing-lists/

NOTE: Do NOT waste their time talking about Code::Blocks!
Verify the problem exists using the gdb command line.
Then report the problem using the gdb command line as how to duplicate the issue.

Tim S.

Thank you for reminding,I now fell I should before report Peruse  GDB documentation to confirm whether problems from own.