Code::Blocks Forums

User forums => Help => Topic started by: visir on July 21, 2017, 04:53:37 pm

Title: [solved]debugger pop-up doesn't fit on screen
Post by: visir on July 21, 2017, 04:53:37 pm
Look how it's displayed, not all vertical space is used, pop-up goes beyond the screen border:

(https://thumb.ibb.co/gxYQc5/dontfit.jpg) (https://ibb.co/gxYQc5)

I updated to nightbuilds, and scrollbar is gone too.
Title: Re: debugger pop-up doesn't fit on screen
Post by: stahta01 on July 21, 2017, 09:17:53 pm
What Operating System? Name and version.
If Linux, what desktop? KDE, Unity, and etc.

Tim S.
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 21, 2017, 09:24:06 pm
Windows 7
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 22, 2017, 02:08:31 pm
I downloaded source code, where is the code for this pop-up?
Title: Re: debugger pop-up doesn't fit on screen
Post by: oBFusCATed on July 22, 2017, 02:09:40 pm
watchesdlg.cpp
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 28, 2017, 12:47:58 pm
pop-up is ValueTooltip in watchesdlg.cpp, correct?

Tried to place a breakpoint on ValueTooltip::ValueTooltip, doesn't seem to work. Don't know if I'm in debug or release mode, target just says "all". (It should have debug info, it's in the devel folder)

Where is the main() function?
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 28, 2017, 01:51:06 pm
This bit looks interesting.

void ValueTooltip::Fit()
{
    ::SetMinSize(m_grid);
    m_sizer->Fit(m_panel);
    wxPoint pos = GetScreenPosition();
    wxSize size = m_panel->GetScreenRect().GetSize();
    SetSize(pos.x, pos.y, size.x, size.y);
}

Can't really do anything with it till I figure out why breakpoints don't work.
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 28, 2017, 02:22:20 pm
Tried setting breakpoint on main.cpp/MainFrame::MainFrame(). Doesn't work. It works with other apps, but not when I try to debug codeblocks with codeblocks. I'm opening one in "devel" folder with one in "output" folder, so it should work.

Also I changed     SetSize(pos.x, pos.y, size.x, size.y); to     SetSize(pos.x, 0, size.x, size.y);, nothing changed either.
Title: Re: debugger pop-up doesn't fit on screen
Post by: BlueHazzard on July 28, 2017, 04:35:16 pm
Have you build codeblocks with debug symbols enabled?
You have to set the global variable "cb" to "-g"

Also, if you change something in a plugin you have to test it trough codeblocks or run the update script again, so all plugins get copied again
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 28, 2017, 04:39:56 pm
No, I didn't set it. Thank you for telling this.
Title: Re: debugger pop-up doesn't fit on screen
Post by: stahta01 on July 28, 2017, 06:45:55 pm
Have you build codeblocks with debug symbols enabled?
You have to set the global variable "cb" to "-g"

Also, if you change something in a plugin you have to test it trough codeblocks or run the update script again, so all plugins get copied again

Correction: You have to set the global variable "cb_release_type" to "-g".

Tim S.
Title: Re: debugger pop-up doesn't fit on screen
Post by: visir on July 29, 2017, 06:30:04 pm
Okay, I sort of fixed it.

everything is in src/watchesdlg.cpp

ValueTooltip::Fit now looks like this:

void ValueTooltip::Fit()
{
    ::SetMinSize(m_grid);
    m_sizer->Fit(m_panel);
    wxPoint pos = GetScreenPosition();
    //wxSize size = m_panel->GetScreenRect().GetSize();
    wxSize size = m_grid->GetScreenRect().GetSize();
    //SetSize(pos.x, pos.y, size.x, size.y);

    int max_y = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, m_grid->GetParent() );

    int y = pos.y;
    if (y + size.y > max_y) {
        y = max_y - size.y;
    }

    //SetSize(pos.x, 0, size.x, size.y);
    //SetSize(pos.x, 0, size.x, max_y);
    SetSize(pos.x, y, size.x, size.y);
}

In ValueTooltip::OnTimer, added Fit(); at the very end.

In SetMinSize, replaced this:

    int minWidth = (wxSystemSettings::GetMetric(wxSYS_SCREEN_X, grid->GetParent())*3)/2;
    int minHeight = (wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, grid->GetParent())*3)/2;

with this:

    int minWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, grid->GetParent()); //changed
    int minHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, grid->GetParent());

It now uses all of the screen. It probably goes under menu bar, but it's hidden for me anyway.
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: visir on July 29, 2017, 06:36:48 pm
Here are some structures if you want to check how this works.

typedef struct client_static_s
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    int k;
    int l;
    int m;
    int n;
    int o;
    int p;
    int q;
    int r;
    int s;
    int t;
    int u;
    int v;
    int w;
    int x;
    int y;
    int z;
    int a1;
    int b1;
    int c1;
    int d1;
    int e1;
    int f1;
    int g1;
    int h1;
    int i1;
    int k1;
    int l1;
    int m1;
    int n1;
    int o1;
    int p1;
    int q1;
    int r1;
    int s1;
    int t1;
    int u1;
    int v1;
    int w1;
    int x1;
    int y1;
    int z1;
        int a2;
    int b2;
    int c2;
    int d2;
    int e2;
    int f2;
    int g2;
    int h2;
    int i2;
    int k2;
    int l2;
    int m2;
    int n2;
    int o2;
    int p2;
    int q2;
    int r2;
    int s2;
    int t2;
    int u2;
    int v2;
    int w2;
    int x2;
    int y2;
    int z2;
        int a3;
    int b3;
    int c3;
    int d3;
    int e3;
    int f3;
    int g3;
    int h3;
    int i3;
    int k3;
    int l3;
    int m3;
    int n3;
    int o3;
    int p3;
    int q3;
    int r3;
    int s3;
    int t3;
    int u3;
    int v3;
    int w3;
    int x3;
    int y3;
    int z3;
        int a4;
    int b4;
    int c4;
    int d4;
    int e4;
    int f4;
    int g4;
    int h4;
    int i4;
    int k4;
    int l4;
    int m4;
    int n4;
    int o4;
    int p4;
    int q4;
    int r4;
    int s4;
    int t4;
    int u4;
    int v4;
    int w4;
    int x4;
    int y4;
    int z4;
}
client_static_t;

typedef struct small_client_static_s
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    int k;
    int l;
    int m;
    int n;
    int o;
    int p;
    int q;
    int r;
    int s;
    int t;
    int u;
    int v;
    int w;
    int x;
    int y;
    int z;
}
small_client_static_t;

client_static_t   cls;

small_client_static_t scls;
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: visir on July 29, 2017, 06:42:08 pm
Ideally it should check window size instead of screen size. It's the same thing in my case though.
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: oBFusCATed on July 29, 2017, 06:58:12 pm
Please provide a patch which could be applied.
See here for details: http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)

p.s. And please use code tags (the little # button) when posting log pastes...
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: Filipe on July 29, 2017, 11:13:50 pm
Here are some structures if you want to check how this works.

typedef struct client_static_s
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    int k;
    int l;
    int m;
    int n;
    int o;
    int p;
    int q;
    int r;
    int s;
    int t;
    int u;
    int v;
    int w;
    int x;
    int y;
    int z;
    int a1;
    int b1;
    int c1;
    int d1;
    int e1;
    int f1;
    int g1;
    int h1;
    int i1;
    int k1;
    int l1;
    int m1;
    int n1;
    int o1;
    int p1;
    int q1;
    int r1;
    int s1;
    int t1;
    int u1;
    int v1;
    int w1;
    int x1;
    int y1;
    int z1;
        int a2;
    int b2;
    int c2;
    int d2;
    int e2;
    int f2;
    int g2;
    int h2;
    int i2;
    int k2;
    int l2;
    int m2;
    int n2;
    int o2;
    int p2;
    int q2;
    int r2;
    int s2;
    int t2;
    int u2;
    int v2;
    int w2;
    int x2;
    int y2;
    int z2;
        int a3;
    int b3;
    int c3;
    int d3;
    int e3;
    int f3;
    int g3;
    int h3;
    int i3;
    int k3;
    int l3;
    int m3;
    int n3;
    int o3;
    int p3;
    int q3;
    int r3;
    int s3;
    int t3;
    int u3;
    int v3;
    int w3;
    int x3;
    int y3;
    int z3;
        int a4;
    int b4;
    int c4;
    int d4;
    int e4;
    int f4;
    int g4;
    int h4;
    int i4;
    int k4;
    int l4;
    int m4;
    int n4;
    int o4;
    int p4;
    int q4;
    int r4;
    int s4;
    int t4;
    int u4;
    int v4;
    int w4;
    int x4;
    int y4;
    int z4;
}
client_static_t;

typedef struct small_client_static_s
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    int k;
    int l;
    int m;
    int n;
    int o;
    int p;
    int q;
    int r;
    int s;
    int t;
    int u;
    int v;
    int w;
    int x;
    int y;
    int z;
}
small_client_static_t;

client_static_t   cls;

small_client_static_t scls;

No need to use 2 structures, data to declare the same variables is not give difficult to realize that the statements of the second structures are contained in the first and the typedef is not applied correctly

  First sequence     >>  a,   b,   c,   d,  e,   f,   g,   h,  i,   k,   l,   m,   n,  o,   p,   q,   r,   s,   t,  u,   v,   w,   x,   y,  z;
  Second sequence >>  1, 2, 3 , 4;


Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: oBFusCATed on July 29, 2017, 11:27:27 pm
Filipe: This is probably some sample code to exaggerate the problem.
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: visir on July 30, 2017, 08:54:34 am
Yep, to test the ValueTooltip. "exaggerate the problem", can you care less? It made it unusable.

Anyway, anyone knows how to get position and size of main window? Something like main_window->GetScreenRect()

Right now, scrolling with mouse wheel scrolls window behind ValueTooltip, not ValueTooltip itself. Kinda annoying, but I can live with it.
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: visir on July 30, 2017, 09:00:54 am
Also, shouldn't there be type info in the third column? It's only displayed for structure itself.

(https://thumb.ibb.co/e4nQ4k/bla.png) (https://image.ibb.co/iR89VQ/bla.png)
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: BlueHazzard on July 30, 2017, 11:51:28 am
You can enable full debugger loging:
Settings->Debugger->Enable ful log

An look if the debugger sends the type information from single elements (in the debugger log tab). If this is the case then there seems to be a bug.

Thank you for your investigative work!
Title: Re: [solved]debugger pop-up doesn't fit on screen
Post by: oBFusCATed on July 30, 2017, 01:25:55 pm
No, it doesn't. The type is available for the main object. For the rest we need gdb/mi as always.