Author Topic: CodeBlocks and Codesourcery GDB  (Read 65307 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and Codesourcery GDB
« Reply #15 on: March 19, 2012, 11:12:19 am »
Does you executable captures Ctrl+C/SIGINT and after that resending it to the real GDB?
If not can you try to implement it and report if this is working?
Keep in mind that you have to have a console allocated in order for this to work.
(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 Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #16 on: March 19, 2012, 11:45:49 am »
Does you executable captures Ctrl+C/SIGINT and after that resending it to the real GDB?

How should it looks?

After SIGINT to debugging exec in C::B "Debugger(debug)" log view contains following (my comments under ///):
/// run exec to while(1) loop...
> continue
/// send CTRL+C
Cannot access memory at address 0x0
Program received signal SIGINT, Interrupt.
0x402b9d58 in ?? ()
>>>>>>cb_gdb:
/// some commands by debugee to obtain current exec state
« Last Edit: March 19, 2012, 11:50:20 am by Lost_Byte »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and Codesourcery GDB
« Reply #17 on: March 19, 2012, 11:56:24 am »
I don't understand your question. Can you clarify it a 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 Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #18 on: March 19, 2012, 12:17:03 pm »
Does you executable captures Ctrl+C/SIGINT and after that resending it to the real GDB?

What did you mean under "resending"?
How should it looks for me during debugging session under C::B?

Offline Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #19 on: March 19, 2012, 12:29:47 pm »
Does you executable captures Ctrl+C/SIGINT and after that resending it to the real GDB?

Oh.. It seems, I got it... "Executable"- means, my "gdb-cb-bridge" sketch? Is it?
If it's so - answer, no, "gdb-cb-bridge" does not handle SIGINT... I'll try to implement.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and Codesourcery GDB
« Reply #20 on: March 19, 2012, 12:33:33 pm »
Yes, your executable (gdb-cb-bridge).

Some notes written before your last post:
See this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686016%28v=vs.85%29.aspx

The idea is that your application should capture the ctrl-c event and then you send the same event to gdb.
When using remote debugging this is the only way to stop gdb/inferior/debuggee.
(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 ricardo

  • Single posting newcomer
  • *
  • Posts: 2
    • CodeSourcery
Re: CodeBlocks and Codesourcery GDB
« Reply #21 on: March 20, 2012, 12:16:52 am »
OK. Will be brief.
Code Sourcery did not respond. It's not surprising, becouse of Lite is "as is" toolchain, end there is propietary Code Bench.

Hello.  I'm not CodeSourcery support, but the Lite edition tools do have some community mailing lists associated with them.  See http://sourcerytools.com/ for information on how to post to those mailing lists.

Offline Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #22 on: March 20, 2012, 07:59:22 am »

The idea is that your application should capture the ctrl-c event and then you send the same event to gdb.
When using remote debugging this is the only way to stop gdb/inferior/debuggee.

ОК. I've implemented that.
It works in command-line debug session: CTRL+C in gdb-cb-brige becomes a CTRL_C_EVENT for gdb, and it stops the inferior and shows command-prompt.
It does not works under C::B Nightly 11 February 2012 build (7789).

New build of gdb-cb-bridge is in attach.

Offline Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #23 on: March 26, 2012, 06:40:16 am »
The idea is that your application should capture the ctrl-c event and then you send the same event to gdb.
When using remote debugging this is the only way to stop gdb/inferior/debuggee.

Hi, oBFusCATed !
Have you probed new build of gdb-cb-brige? Is there something wrong in implementation?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and Codesourcery GDB
« Reply #24 on: March 26, 2012, 09:37:32 am »
I've never tried this bridge, I run linux and also don't use any embedded debugger/compiler.
(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 Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #25 on: March 26, 2012, 09:45:04 am »
Hmmm... For some reason, I thought you were going to work out the feature to stop the debugging process on the fly...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and Codesourcery GDB
« Reply #26 on: March 26, 2012, 09:51:44 am »
If cb-gdb-bridge does correctly the ctrl-c re-translation it should work. But I can't guarantee as I've not tried it.
Also getting this console stuff right is pretty tough. I've done many tests in order to make the current implementation work correctly.
I've not tried it since I've implemented it, so I don't know if it still works.
(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 Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #27 on: March 26, 2012, 10:24:57 am »
With what gdb this feature were verified? I would like to try.
The fact that I also use cygwin-GDB for one of my platforms (without bridge), and stopping on the fly from a C::B does not work either.
Checked on Nightly build too.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and Codesourcery GDB
« Reply #28 on: March 26, 2012, 10:36:21 am »
Normal gdb used for remote debugging to debug a console application.
I've not tried cygwin.
(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 Lost_Byte

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: CodeBlocks and Codesourcery GDB
« Reply #29 on: March 26, 2012, 02:48:27 pm »
Sorry colleagues!
I've found stupid mistake, that leads to overbuffering in some conditions.
That's new build.