Author Topic: The 21 July 2012 build (8150) is out.  (Read 96389 times)

Offline Agetian

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 21 July 2012 build (8150) is out.
« Reply #60 on: August 25, 2012, 06:41:33 am »
For some reason, code completion won't fire (in C++) if I try to define a variable inside a function that has a "throw" specifier in its definition. For instance:

1) This works fine (no throw specifier) - code completion fires OK for "m"
Code
std::string MyClass::TestCase()
{
    std::string m;
    m.  
}

2) This doesn't work (throw specifier added) - code completion does not fire for "m"
Code
std::string MyClass::TestCase() throw(std::exception)
{
    std::string m;
    m.
}

Code::Blocks SVN 8150
Windows Vista 32bit
GNU GCC v4.7.1 (Mingw)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 21 July 2012 build (8150) is out.
« Reply #61 on: August 25, 2012, 05:35:24 pm »
For some reason, code completion won't fire (in C++) if I try to define a variable inside a function that has a "throw" specifier in its definition. For instance:

1) This works fine (no throw specifier) - code completion fires OK for "m"
Code
std::string MyClass::TestCase()
{
    std::string m;
    m.  
}

2) This doesn't work (throw specifier added) - code completion does not fire for "m"
Code
std::string MyClass::TestCase() throw(std::exception)
{
    std::string m;
    m.
}

Code::Blocks SVN 8150
Windows Vista 32bit
GNU GCC v4.7.1 (Mingw)

This should be a bug, can you report the the official site: http://developer.berlios.de/bugs/?group_id=5358 , so this does not get lost in the forum.
I think the CC's parser does not handle the "throw(std::exception)" correctly, so it does not recognize those code as a function body.
Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Agetian

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 21 July 2012 build (8150) is out.
« Reply #62 on: August 25, 2012, 06:15:30 pm »

This should be a bug, can you report the the official site: http://developer.berlios.de/bugs/?group_id=5358 , so this does not get lost in the forum.
I think the CC's parser does not handle the "throw(std::exception)" correctly, so it does not recognize those code as a function body.
Thanks.


Done and done. :) Thanks!

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: The 21 July 2012 build (8150) is out.
« Reply #63 on: August 25, 2012, 09:19:24 pm »
By the way: parser also doesn't recognize: const, volatile, final and override.

Offline nenin

  • Almost regular
  • **
  • Posts: 202
Re: The 21 July 2012 build (8150) is out.
« Reply #64 on: August 26, 2012, 04:20:12 pm »
Dear ollydbg and xunxun, looks like I found source of the problems with gdb. Subjected PC has installed software with hardcore copyright protection (kind of system driver). And looks like any debugging acts which may touch external calls (function from dlls) leads to troubles for gdb. I had similar issue few year ago, but in previous case gdb can not work at all.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 21 July 2012 build (8150) is out.
« Reply #65 on: August 26, 2012, 04:21:25 pm »
By the way: parser also doesn't recognize: const, volatile, final and override.
Hi, I'm not sure what the exact problem you have, can you give a simple example? Or, you can fire a bug report in BerliOS too, thanks.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 21 July 2012 build (8150) is out.
« Reply #66 on: August 26, 2012, 04:28:59 pm »
Dear ollydbg and xunxun, looks like I found source of the problems with gdb. Subjected PC has installed software with hardcore copyright protection (kind of system driver). And looks like any debugging acts which may touch external calls (function from dlls) leads to troubles for gdb. I had similar issue few year ago, but in previous case gdb can not work at all.
Good to hear you solve the problem. :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: The 21 July 2012 build (8150) is out.
« Reply #67 on: August 26, 2012, 04:53:16 pm »
@ollydbg:
Code
struct B
{
virtual void c( int argument ) = 0;
virtual void d( int argument ) = 0;
};
struct A : B
{
void a( int argument ) const
{

}
void b( int argument ) volatile
{

}
void c( int argument ) override
{

}
void d( int argument ) final
{
}

int member;
};
Parser doesn't see 'argument' inside those bodies.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 21 July 2012 build (8150) is out.
« Reply #68 on: August 26, 2012, 05:18:11 pm »
@ollydbg:
Code
struct B
{
virtual void c( int argument ) = 0;
virtual void d( int argument ) = 0;
};
struct A : B
{
void a( int argument ) const
{

}
void b( int argument ) volatile
{

}
void c( int argument ) override
{

}
void d( int argument ) final
{
}

int member;
};
Parser doesn't see 'argument' inside those bodies.
Ok, thanks, this should be another kind of bug, can you fire another bug report in BerliOS?
I just read the parser's source code in: plugins\codecompletion\parser\parserthread.cpp, maybe you can have a try to run the cc_test.cbp project to see how the logic goes in the parser. Believe me, it is quite simple, our parser does not do very complex analysis.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nenin

  • Almost regular
  • **
  • Posts: 202
Re: The 21 July 2012 build (8150) is out.
« Reply #69 on: August 26, 2012, 05:34:56 pm »
Dear ollydbg and xunxun, looks like I found source of the problems with gdb. Subjected PC has installed software with hardcore copyright protection (kind of system driver). And looks like any debugging acts which may touch external calls (function from dlls) leads to troubles for gdb. I had similar issue few year ago, but in previous case gdb can not work at all.
Good to hear you solve the problem. :)
Thank you for support. But really good is that problem was not problem of gdb or mingw or C::B.  :)