Author Topic: Splitting debugger in two - specific debugger and common GUI  (Read 430732 times)

Offline tomjnx

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #615 on: January 23, 2012, 12:34:55 am »
obFus: In class GdbCmd_AddBreakpoint method ParseOutput, the Backtrace dialog is reloaded. I would have expected to reload the Breakpoints dialog. Am I missing something here?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #616 on: January 23, 2012, 01:36:56 am »
Yes, it should be fixed in the branch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #617 on: January 29, 2012, 02:15:48 pm »
I got another feature request:
When you compile C::B against wx 2.9.x and then debug into it using C::B you get tons of debugger warnings like:
warning: In file ../../src/msw/window.cpp at line 581: 'SetFocus' failed with error 0x00000057 (wrong parameter.).
...or:
warning: In file ..\..\include/wx/msw/private.h at line 379: 'GetWindowRect' failed with error 0x00000578 (invalid window handle).

This would be OK, but these are so many, that after roughly 30 seconds GDB and the C::B you are debugging from freezes completely. You have to kill the debugger (gdb) (not the debugee - this does not work) to get the "mother instance" of C::B back. This makes it basically impossible to debug into C::B which is compiled against wx 2.9.x.
Do you see a chance just to ignore a set of warnings, maybe even a pattern? It's done in the compiler plugin: You can skip messages with a certain pattern completely.
Alternatively: Maybe one can set a "debug log level", so that all stuff that starts with "warning" is hidden.

What do you think?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #618 on: January 29, 2012, 02:35:36 pm »
Who is printing the warnings? GDB or wxWidgets?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #619 on: January 29, 2012, 02:48:57 pm »
Who is printing the warnings? GDB or wxWidgets?
Good question. They appear in the debug log with the prefix "[debug]". So you tell me... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #620 on: January 29, 2012, 02:53:27 pm »
They look like wx ones, probably wx calls OutputDebugString or something like that. Can you try to disable the debugging of wxwidgets?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #621 on: January 29, 2012, 05:21:51 pm »
They look like wx ones, probably wx calls OutputDebugString or something like that. Can you try to disable the debugging of wxwidgets?
How do I do that? You mean *not* using --verbose? I am using the release version of the wxWidgets library btw...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #622 on: January 29, 2012, 05:26:25 pm »
I'm not really sure, but in 2.9+ they've change the debugging stuff for wx, probably you should check their docs, how to enable/disable debugging.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #623 on: January 29, 2012, 05:27:28 pm »
How do I do that? You mean *not* using --verbose? I am using the release version of the wxWidgets library btw...
OK, I tried not using --verbose.
Now I get tons of messages like:
[debug]warning: ../../src/common/menucmn.cpp(976): assert "item" failed in Enable(): attempt to enable an item which doesn't exist

That's basically the error I am after. However, the freeze just encounters later and I cannot make this stupid message stop, because it's created permanently on every UpdateUI loop. So this is not a solution. It basically does not allow me to debug C::B using C::B. :-(
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #624 on: January 29, 2012, 05:37:27 pm »
Take a look here: http://docs.wxwidgets.org/2.9.3/overview_debugging.html

You can try to set wxDEBUG_LEVEL==0 or provide a null assert handler.

If this doesn't help, you can try to skip the warning line in the GDB_driver::ParseOutput

Put something like this
Code
if (line[i].StartsWith(wxT("warning:"))
{
     m_pDBG->Log(wxT("skipped:")+lines[i]);
}
before the "else if (lines.StartsWith(_T("Error ")) ||" line

I've not tried the code, so it might cause problems.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #625 on: January 29, 2012, 07:39:52 pm »
You can try to set wxDEBUG_LEVEL==0 or provide a null assert handler.
Does not help and it shouldn't be an option at compile time anyways.

Code
if (line[i].StartsWith(wxT("warning:"))
{
     m_pDBG->Log(wxT("skipped:")+lines[i]);
}
That would indeed be worth an option, but...

Meanwhile I found out, why this happens:
This GDB command:
set debugevents on
...should definitely be an option on GDB. Turning this feature off made all the messages go away. And that does make sense, because a lot applications "spit out" many of such debugging messages. But during a normal debugging session you don't always want to see them, e.g. when tracing a crash they are usually of no help.
« Last Edit: January 29, 2012, 07:47:17 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #626 on: January 29, 2012, 07:46:20 pm »
This GDB command:
set debugevents on
...should definitely be an option on GDB.

BTW: I am thinking, why not putting all of these GDB initialisation commands:
[debug]> set confirm off
[debug]> set width 0
[debug]> set height 0
[debug]> set breakpoint pending on
[debug]> set print asm-demangle on
[debug]> set unwindonsignal on
[debug]> set print elements 0
[debug]> set debugevents on
[debug]> set disassembly-flavor att
[debug]> catch throw

...in a GDB script which you can edit through the debugger config. Then, you save the script to the application folder and source/use it as you do with "stl-views-1.0.3.gdb", too... What do you think?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #627 on: January 29, 2012, 07:59:15 pm »
Some of them are controlled by options in the settings (catch throw, set disassembly-flavor att) and some of the others should not be user edited, because they will break debugging. (width, height, confirm)

"set debugevents on" is used only to detect the pid of the debuggee and when the pid is correctly detected "set debugevents off" should be executed.
I guess the pid reporting has changed, see the beginning of the GDB_driver::ParseOutput functions.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #628 on: January 29, 2012, 08:12:39 pm »
"set debugevents on" is used only to detect the pid of the debuggee and when the pid is correctly detected "set debugevents off" should be executed.
I'm afraid it doesn't really work. The messages are less, but still a lot of these warnings make it through... I was wrong because I was pointing at a menu and then the messages are "turned off". That sucks. I guess I'll implement the filter as you suggested finally... Not really "nice" but it should work.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #629 on: January 29, 2012, 08:14:15 pm »
So, you're saying that calling "set debugevents off" doesn't remove the messages?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]