Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

(crush) debugging with gdb - infinit loop problem

(1/4) > >>

DoMeN:
Hi.

I've noticed a problem with C::B and gdb when you debug a program that enters an infinit loop or waits for some HW input.
Simple example:


--- Code: ---int main (int args, char *argv[]) {
  while (1) {
  }
}

--- End code ---

This program will go into an infinit loop and the only option you have is to press "stop debugging" button and when you do this C::B crushes.

In such a small program this is no problem (except that you get anoyed because you have to reopen everything  :() but in a large program that has an wait_for_com_port_input(); function or something like that where the program goes in to an infinit loop it is a problem even to find the place where C::B crushes.

I don't know how the crush when pressed "stop debugging" button in this case could be fixed but it would be great to have a "pause" button that would send "ctrl+c" command to gdb (if running gdb from console this would stall the program where it is at the moment and you would regain the control over gdb) and if gdb would be reachable again I think that C::B would continue execution as if it had reached a breakpoint.

Unfortunately I don't have any experience with wxWidgets programming so I don't know how "ctrl+c" could be simulated and my debug plugin src knowladge is also werry limited.

Could someone write a patch for this or at least help me a bit with how I could make such a patch myself (solution suggestions, info about debug plugin (where the code for debugging buttons actions is located) and simulating ctrl+c command).

BTW I also noticed the problem with alt+F7 shortcut in Linux Debian Edge. The debug plugin doesn't intercept it and executes Linux shortcut that is set for this key combination. Is this C::B or wxWidgets and Linux problem?

r. DoMeN

mandrav:
Will have a look into it.


--- Quote ---BTW I also noticed the problem with alt+F7 shortcut in Linux Debian Edge. The debug plugin doesn't intercept it and executes Linux shortcut that is set for this key combination. Is this C::B or wxWidgets and Linux problem?

--- End quote ---

Go into your window manager's shortcuts configuration and remove the Alt+F7 shortcut from whatever it is bound to. C::B never receives this keystroke because your window manager receives and handles it first.

Pecan:
This patch will most probable aleviate the CB crash when using the stop button.

http://developer.berlios.de/patch/?func=detailpatch&patch_id=1881&group_id=5358
Fix for Debugger termination crashes

This patch will allow a Linux/Unix user to use console I/O and trace console programs under the CB debugger.

http://developer.berlios.de/patch/?func=detailpatch&patch_id=1882&group_id=5358
Debugging Console for Linux

DoMeN:
Great thanks for the info. I'll check it out.

Domen

raph:

--- Quote from: Pecan on February 22, 2007, 03:26:50 pm ---http://developer.berlios.de/patch/?func=detailpatch&patch_id=1881&group_id=5358
Fix for Debugger termination crashes
--- End quote ---
Thx alot, debugger crashes often, here :?

Navigation

[0] Message Index

[#] Next page

Go to full version