User forums > General (but related to Code::Blocks)

show debugger tip under curser when ctrl key is pressed

(1/8) > >>

ollydbg:
Due to some unavoidable feature of gdb, such as:

1, under windows, When I use gdb with python supported, when showing a local uninitialized variable, such as a vector<string>, the gdb will crash.

2, when debugging, when I select some piece of code, the debugger plugin try to evaluate the "whole piece of the code", this will always cause gdb to crash.

So, can some devs to add an option that when the user hold the "ctrl" key, and the caret hover event send, then the debugger plugin just send the expression to gdb.

any ideas?

Both Loaden and I have just modify the code to:


--- Code: ---void DebuggerGDB::OnValueTooltip(CodeBlocksEvent& event)
{
    event.Skip();
    if (!m_pProcess || !IsStopped())
        return;
    if (!Manager::Get()->GetConfigManager(_T("debugger"))->ReadBool(_T("eval_tooltip"), false))
        return;

    if (!wxGetKeyState(WXK_CONTROL))  // does not work!!!!!
        return;

--- End code ---

But the code does not work.

wxGetKeyState(WXK_CONTROL) this function always get false.

any comments about this?
why I can't query the ctrl key information???

thanks.

Edit:
In this post: one more years ago.
http://forums.codeblocks.org/index.php/topic,10616.msg72724.html


--- Quote ---By the way, I want to use "CTRL" key while mouse hovering some text to get the ValueTooltip shown.

So, I try to add the code:
Code:

+//    if (!wxGetKeyState(WXK_CONTROL))
+//        return;


But it didn't works as I expect. Can you give me some suggestions?

Thanks
--- End quote ---

oBFusCATed:
I've just tested it and it works as expected... (tested on linux).

ollydbg:

--- Quote from: oBFusCATed on December 17, 2010, 08:22:19 am ---I've just tested it and it works as expected... (tested on linux).

--- End quote ---
thanks for the test. but it definitely does not work under windows,  :( can some windows guys test for me. thanks.

eranif:
Hi,

I think I tried it once (to show debugger event only when CTRL is down) however, the problem was that under Windows I did not receive the 'dwell' events from scintilla if CONTROL is down - so I dropped it.

Do you get the dwell event when control key is down? (Windows)

Eran

ollydbg:

--- Quote from: eranif on December 17, 2010, 09:58:49 am ---Hi,

I think I tried it once (to show debugger event only when CTRL is down) however, the problem was that under Windows I did not receive the 'dwell' events from scintilla if CONTROL is down - so I dropped it.

Do you get the dwell event when control key is down? (Windows)

Eran

--- End quote ---
You are right, I just find this.


from the file: F:\cb\codeblocks_trunk\src\sdk\wxscintilla\src\wxscintilla.cpp
I think it is the point where this message sent.

--- Code: ---    case SCN_DWELLSTART:
        evt.SetEventType (wxEVT_SCI_DWELLSTART);
        evt.SetX(scn.x);
        evt.SetY(scn.y);
        break;

    case SCN_DWELLEND:
        evt.SetEventType (wxEVT_SCI_DWELLEND);
        evt.SetX(scn.x);
        evt.SetY(scn.y);
        break;

--- End code ---

but not sure the key value is already saved here:

--- Code: ---void wxScintilla::NotifyParent (SCNotification* _scn)
{
    SCNotification& scn = *_scn;
    wxScintillaEvent evt (0, GetId());

    evt.SetEventObject(this);
    evt.SetPosition(scn.position);
    evt.SetKey(scn.ch);
    evt.SetModifiers(scn.modifiers);

    switch (scn.nmhdr.code) {
--- End code ---

Can we use the evt.GetKey???

Navigation

[0] Message Index

[#] Next page

Go to full version