News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Bad completion of destructor

Started by Folco, November 29, 2010, 06:50:47 PM

Previous topic - Next topic

Folco

I think I get a real issue this time ^^
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 ©

Jenna

Quote from: Folco on November 29, 2010, 06:50:47 PM
I think I get a real issue this time ^^
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.

Folco

Oops, forgotten to say that I get that with Kubuntu 64b, svn debugger branch compiled today.
Kernel Extremist - PedroM power ©

ollydbg

Quote from: jens on November 29, 2010, 07:25:13 PM
Quote from: Folco on November 29, 2010, 06:50:47 PM
I think I get a real issue this time ^^
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:
Abc::~A|<------------caret  here
backward search from the caret just stop after the "~", so this is the same as:
   A|<------------caret  here
So, as you said:
Quoteit 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?
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.

Jenna

Quote from: jens on November 29, 2010, 07:25:13 PM
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.

Folco

#5
Quote@Folco:
What is the exact step?
You use use the ctrl+space at the caret below?
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".
Kernel Extremist - PedroM power ©

Jenna

Quote from: Folco 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?
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 ?

ollydbg

Quote from: Folco 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?
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.

Folco

#8
QuoteDou 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.
Kernel Extremist - PedroM power ©