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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #660 on: February 25, 2012, 03:53:20 pm »
You're reporting this for the second time.

About the first one, can you state your exact version of the compiler and does it happen when running on windows 7 x64 bit?
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #661 on: February 25, 2012, 03:56:35 pm »
Ok - here comes another issue... ;-)

- consider this code:
Code
#include <iostream>

void funca()
{
    std::cout << "Hello!" << std::endl;
}

int main()
{
    funca();
    return 0;
}
- place a BP at the line "funca();"
- continue to step through it with Next (F7)
- after a few times, everything comes to a halt.

It works fine here xunxun's gcc 4.6.3 and gdb cvs build my self.
Code
[debug]>>>>>>cb_gdb:
[debug]> break "E:/code/cb/test_code/mortenr2012-01-15/main.cpp:10"
[debug]Breakpoint 2 at 0x401697: file E:\code\cb\test_code\mortenr2012-01-15\main.cpp, line 10.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: E:\code\cb\test_code\mortenr2012-01-15\bin\Debug\mortenr2012-01-15.exe
[debug]gdb: windows_init_thread_list

Child process PID: 5332

[debug][New Thread 5332.0x1178]
[debug]Breakpoint 2, main () at E:\code\cb\test_code\mortenr2012-01-15\main.cpp:10
[debug]E:\code\cb\test_code\mortenr2012-01-15\main.cpp:10:101:beg:0x401697
[debug]>>>>>>cb_gdb:

At E:\code\cb\test_code\mortenr2012-01-15\main.cpp:10

[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]E:\code\cb\test_code\mortenr2012-01-15\main.cpp:11:115:beg:0x40169c
[debug]>>>>>>cb_gdb:

At E:\code\cb\test_code\mortenr2012-01-15\main.cpp:11

[debug]> next
[debug]E:\code\cb\test_code\mortenr2012-01-15\main.cpp:12:130:beg:0x4016a1
[debug]>>>>>>cb_gdb:

At E:\code\cb\test_code\mortenr2012-01-15\main.cpp:12

[debug]> next
[debug]0x0040146d in __tmainCRTStartup ()
[debug]>>>>>>cb_gdb:

In __tmainCRTStartup () ()

[debug]> bt 30
[debug]#0  0x0040146d in __tmainCRTStartup ()
[debug]#1  0x7c817077 in RegisterWaitForInputIdle () from C:\WINDOWS\system32\kernel32.dll
[debug]#2  0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]Single stepping until exit from function __tmainCRTStartup,
[debug]which has no line number information.
[debug][Inferior 1 (process 5332) exited normally]
[debug]>>>>>>cb_gdb:

[Inferior 1 (process 5332) exited normally]

[debug]> quit

Debugger finished with status 0
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #662 on: February 25, 2012, 04:15:16 pm »
ollydbg: That's why I've asked for the exact compiler version. This happens when the libc is build with debug symbols or at least happens on my centos/ubuntu.
(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 #663 on: February 25, 2012, 05:26:09 pm »
You're reporting this for the second time.
:o Really? In fact, I can't remember. :-[ - Which one of the two reports do you mean?

Anyways...
About the first one, can you state your exact version of the compiler and does it happen when running on windows 7 x64 bit?
The compiler if GCC-TDM 4.6.1 (32 bit) and I am on Windows 7, 64 bit, but using a 32 bit compiled version of 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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #664 on: February 25, 2012, 05:30:47 pm »
Something completely different: Do you think I should switch to the GDB/MI plugin? I know you have less interest in fixing the current plugin - I just wonder if the GDB/MI one is already usable?!

BTW: SVN access to this plugin is not possible for me anymore ("Unknown host: smrt.is-a-geek.org"). Did you move it?
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 #665 on: February 25, 2012, 05:46:41 pm »
BTW: SVN access to this plugin is not possible for me anymore ("Unknown host: smrt.is-a-geek.org"). Did you move it?
I've lost the domain name and now I use different one cmpt.benbmp.org.
I doubt it is usable in production, thought. I've tried to build it on centos, but failed, so I don't use it actively at the moment.
And unfortunately I can't find enough time and concentration to work on it.
(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 cbexaminr

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #666 on: March 02, 2012, 09:20:46 pm »
... I had the weird idea to run C::B with only the debugger plugin and see how well C::B would work as debugger front end.

Morten - FWIW - I was _not_ running debugger plugin only (AsFarAsIKnow), but I think I did have such functionality working in the stuff presented back around and/or prior to this post:
http://forums.codeblocks.org/index.php/topic,10908.msg98311.html#msg98311

as I wanted/needed such functionality (and would _still_ like to have it within C::B).  My efforts at that time were not, however, accepted and applied. 

If you're interested in such functionality, you might look at the patches I submitted then against their related source control versions, and find whatever changes I made at that time.

So far, "nothing" without a project works, and loading a project without an active compiler plugin is rejected. (:-\) But what also does not work is attaching to a process. Then I see this message:
---------------------------
Error
---------------------------
This project is configured to use an invalid debugger.
The operation failed...
---------------------------
OK   
---------------------------
However, that is not correct, because there is no need for a project and the debugger is setup correctly. Maybe you see a chance to make this work... ;-)


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #667 on: March 03, 2012, 01:04:50 pm »
... I had the weird idea to run C::B with only the debugger plugin and see how well C::B would work as debugger front end.
http://forums.codeblocks.org/index.php/topic,10908.msg98311.html#msg98311
Well this patch embeds not only one, but many changes. Is it possible, that for each change you create an own patch (that's how it always should be).
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 #668 on: March 03, 2012, 03:20:06 pm »
Well this patch embeds not only one, but many changes. Is it possible, that for each change you create an own patch (that's how it always should be).
Sorry, to say this, but my trials to apply the patch on trunk of the debugger's branch failed miserably. I guess w/o an update (you might have continued to use it in your local copy) it will be hard to see if that's what I had in mind...
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 #669 on: March 03, 2012, 07:43:37 pm »
The patch won't apply, because the GetCommandLine has been change. But if you read, my comments about the patch, you'll see that I'm pretty much against it.
This a plugin specific feature, which should not be required by all other plugins implementing a debugger.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #670 on: March 03, 2012, 08:20:03 pm »
About attaching:
As far as I can see attaching to a running program works even if there is no loaded project.
The only requirement is that you should not use the "Use active target's debugger" option in the "Debug->Active debuggers".
If you have a non working case for attaching, please report the details.
(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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #671 on: April 03, 2012, 04:02:05 pm »
SVN 7916 (shows in debugger as 7904)
svn build  rev 7904 (2012-03-19 21:48:48)   gcc 4.3.1 Windows/unicode - 32 bit

When aborting a Hello World compile and run, CB gets hung up. The compiler buttons are disabled and the system "says" the compiler is in use.

The only way out (I've found) is just to kill CB.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #672 on: April 03, 2012, 04:26:11 pm »
Please post the exact steps to reproduce this.
Does it happen every time or it is a random thing?
(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 Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #673 on: April 04, 2012, 12:02:45 pm »
Please post the exact steps to reproduce this.
Does it happen every time or it is a random thing?

1) Using the wizard, create a default console hello world project
2) build the project
3) run the project
4) use the little red [ x ] to kill the running console window.
5) CB is hung. Always happens

svn build  rev 7904 (2012-03-19 21:48:48)   gcc 4.3.1 Windows/unicode - 32 bit
« Last Edit: April 04, 2012, 12:06:09 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #674 on: April 04, 2012, 12:13:37 pm »
Does this happen with the trunk's version?
(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!]