Author Topic: Bad completion of destructor  (Read 13938 times)

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Bad completion of destructor
« on: November 29, 2010, 06:50:47 pm »
I think I get a real issue this time ^^
Code
class Abc
{
    Abc ();
    ~Abc ();
};

Abc::~|
In the completion box, if I select ~Abc, then the line is "Abc::~~Abc". It would be better to have "Abc::~Abc".
Kernel Extremist - PedroM power ©

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Bad completion of destructor
« Reply #1 on: November 29, 2010, 07:25:13 pm »
I think I get a real issue this time ^^
Code
class Abc
{
    Abc ();
    ~Abc ();
};

Abc::~|
In the completion box, if I select ~Abc, then the line is "Abc::~~Abc". It would be better to have "Abc::~Abc".
Confirmed on linux, it only works correctly, if cc kicks in after the second colon and you chose ~Abc.
If I cancel cc and type ~ cc does not kick in and if I force it with Ctrl+Space, it does not show me the correct choice, if I force cc after typing Abc::~A, it shows only the class Abc (and some other tokens, that begin with "a" or "A"), not the constructor or destructor.

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Bad completion of destructor
« Reply #2 on: November 29, 2010, 10:43:17 pm »
Oops, forgotten to say that I get that with Kubuntu 64b, svn debugger branch compiled today.
Kernel Extremist - PedroM power ©

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bad completion of destructor
« Reply #3 on: November 30, 2010, 01:54:26 am »
I think I get a real issue this time ^^
Code
class Abc
{
    Abc ();
    ~Abc ();
};

Abc::~|
In the completion box, if I select ~Abc, then the line is "Abc::~~Abc". It would be better to have "Abc::~Abc".
Confirmed on linux, it only works correctly, if cc kicks in after the second colon and you chose ~Abc.
If I cancel cc and type ~ cc does not kick in and if I force it with Ctrl+Space, it does not show me the correct choice, if I force cc after typing Abc::~A, it shows only the class Abc (and some other tokens, that begin with "a" or "A"), not the constructor or destructor.
True, the reason is:
Code
Abc::~A|<------------caret  here
backward search from the caret just stop after the "~", so this is the same as:
Code
   A|<------------caret  here
So, as you said:
Quote
it shows only the class Abc (and some other tokens, that begin with "a" or "A")

It seems Folco's problem is not the same as jens.
@Folco:
What is the exact step?
You use use the ctrl+space at the caret below?
Code
Abc::~|<-----------caret here


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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Bad completion of destructor
« Reply #4 on: November 30, 2010, 07:35:47 am »
If I cancel cc and type ~ cc does not kick in and if I force it with Ctrl+Space, it does not show me the correct choice
in this case it shows only tokens from the global namespace, nneither the constructor or destructor nor the class itself.
So it seems the tilde is not recognized correctly (after it is typed).
The token itself is known, because cc kicks in correctly after the second colon and shows Abc and ~Abc.
If cc is not cancelled after typing the colon and you type the tilde (~), the selection in the cc-box jumps correctly to ~Abc, but if you now hit enter it comes to the error described by Folco.

I think it's the same cause for both issues.

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Bad completion of destructor
« Reply #5 on: November 30, 2010, 01:44:10 pm »
Quote
@Folco:
What is the exact step?
You use use the ctrl+space at the caret below?
Code
Abc::~|<-----------caret here
No. The completion box appears automatically after I type the second colon. When I select "~Abc" in this box, I get "Abc::~~Abc".
« Last Edit: November 30, 2010, 01:45:47 pm by Folco »
Kernel Extremist - PedroM power ©

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Bad completion of destructor
« Reply #6 on: November 30, 2010, 01:48:35 pm »
Quote
@Folco:
What is the exact step?
You use use the ctrl+space at the caret below?
Code
Abc::~|<-----------caret here
No. The completion box appears automatically after I type the second colon. When I select "~Abc" in this box, I get "Abc::~~Abc".
Dou you get the double tilde, if you select ~Abc before typing the tilde in the source or after typing it ?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bad completion of destructor
« Reply #7 on: November 30, 2010, 03:14:55 pm »
Quote
@Folco:
What is the exact step?
You use use the ctrl+space at the caret below?
Code
Abc::~|<-----------caret here
No. The completion box appears automatically after I type the second colon. When I select "~Abc" in this box, I get "Abc::~~Abc".
I just follow your steps, and there is no double tilde. (windows, latest debugger branch)
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 Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Bad completion of destructor
« Reply #8 on: November 30, 2010, 06:40:02 pm »
Quote
Dou you get the double tilde, if you select ~Abc before typing the tilde in the source or after typing it ?
I get it after typing it.

In these two cases, the chars in the line are typed by hand, and the completion box appears automatically.
First case :
I get a correct behaviour when I hit Enter.


Second case :
If I hit Enter, I get a double tilde.


I got these shots under Win XP SP3, latest dbg branch too.
« Last Edit: November 30, 2010, 09:50:14 pm by Folco »
Kernel Extremist - PedroM power ©