Author Topic: debug plugin  (Read 6800 times)

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
debug plugin
« on: January 23, 2007, 03:21:00 pm »
Has the debug plugin been changed?
I'm not shore if I understood forum topics about this correctly but is the debug plugin broken at the moment? I've just built latest svn revision and it doesn't work for me anny more and I'm not shore if I made a misstake in settings or what.

Could somebody tell me which was the last svn revision No. before this changes?

Regards,
Domen

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: debug plugin
« Reply #1 on: January 23, 2007, 03:56:14 pm »
Quote
I've just built latest svn revision and it doesn't work for me anny more and I'm not shore if I made a misstake in settings or what.

And if you don't tell us what exactly is not working we won't be able to help...
Be patient!
This bug will be fixed soon...

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #2 on: January 24, 2007, 11:32:41 am »
Before I was using rev. 3300 and debugger log was:
[...]
>>>>>>cb_gdb:
> target jtag jtag://10.237.2.35:9999
load
set $pc=0x100
Remote ba debugging using jtag://10.237.2.35:9999
[...some output that jtag returns to gdb...]
 >>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
> directory /home/domenv/hello-uart/
>>>>>>cb_gdb:
> delete breakpoints
[...]

Now with rew 3536 it is:
[...]
>>>>>>cb_gdb:
target jtag jtag://10.237.2.35:9999
load
set $pc=0x100
Failed to receive SET_CHAIN response from JTAG proxy: Connection reset by peer
Remote ba debugging using jtag://10.237.2.35:9999
[...nothing...]
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
> directory /home/domenv/hello-uart/
You can't do that when your target is `exec'
>>>>>>cb_gdb:
> delete breakpoints
No registers.

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #3 on: January 24, 2007, 11:34:30 am »
And all the settings are the same in both revisions.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: debug plugin
« Reply #4 on: January 24, 2007, 11:40:41 am »
Quote
Failed to receive SET_CHAIN response from JTAG proxy: Connection reset by peer

What makes you think this is a C::B problem? C::B has nothing to do with JTAG (whatever that is). This is a message returned by the "JTAG proxy".
I 'd like some more help here, if you really think this is a C::B problem.
Be patient!
This bug will be fixed soon...

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #5 on: January 24, 2007, 11:52:34 am »
Sory. You were right this was jtag problem that occured after reseting C::B and not the jtag server. But this happened after C::B crashed once.

This is the correct debug log output:

>>>>>>cb_gdb:
> target jtag jtag://10.237.2.35:9999
load
set $pc=0x100
Remote ba debugging using jtag://10.237.2.35:9999
>>>>>>cb_gdb:
> directory /home/domenv/hello-uart/
Loading section .vectors, size 0x124 lma 0x0
Loading section .text, size 0x35c lma 0x2000
Loading section .data, size 0x4 lma 0x235c
Loading section .rodata, size 0x14 lma 0x2360
Start address 0x2000, load size 1176
Transfer rate: 7840 bits/sec, 294 bytes/write.
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
> delete breakpoints
>>>>>>cb_gdb:
> break "/home/domenv/hello-uart/hello.c:97"
Breakpoint 1 at 0x22c4: file hello.c, line 97.
>>>>>>cb_gdb:
> break "/home/domenv/hello-uart/hello.c:93"
Breakpoint 2 at 0x2290: file hello.c, line 93.
>>>>>>cb_gdb:
> break "/home/domenv/hello-uart/hello.c:90"
Breakpoint 3 at 0x226c: file hello.c, line 90.
>>>>>>cb_gdb:
> info locals
No symbol table info available.
>>>>>>cb_gdb:
> info args
No symbol table info available.
>>>>>>cb_gdb:
> info frame
Stack level 1, frame at 0xfffb9c:
 PC = 0xf000149c; saved PC 0xf000149c
 called by frame at 0xfffb9c, caller of frame at 0xfffb9c
 Arglist at 0xfffb9c, args:
 Locals at 0xfffb9c, Previous frame's sp is 0xfffb9c
>>>>>>cb_gdb:
> disassemble
No function contains program counter for selected frame.
>>>>>>cb_gdb:

And after this I push continue button again and get:
> start
Breakpoint 4 at 0x2264: file hello.c, line 89.

And after this the only option available on debugger is stop debugging and if I push that button C::B crashes.

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #6 on: January 24, 2007, 11:56:15 am »
I've built C::B nightly on Debian etch.

Settings for debugger are:
Do not run the debugee
Display debug log
Watch local variables
Watch function arguments

debug initialisation commands:
target jtag jtag://10.237.2.35:9999
load
set $pc=0x100

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #7 on: January 24, 2007, 12:09:55 pm »
i've checked rev 3300 and before this part wasn't output in log before:

>>>>>>cb_gdb:
> info locals
No symbol table info available.
>>>>>>cb_gdb:
> info args
No symbol table info available.
>>>>>>cb_gdb:
> info frame
Stack level 1, frame at 0xfffb9c:
 PC = 0xf000149c; saved PC 0xf000149c
 called by frame at 0xfffb9c, caller of frame at 0xfffb9c
 Arglist at 0xfffb9c, args:
 Locals at 0xfffb9c, Previous frame's sp is 0xfffb9c
>>>>>>cb_gdb:
> disassemble
No function contains program counter for selected frame.

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #8 on: January 24, 2007, 01:52:06 pm »
I've tested gdb alone so that I've written all the commands that are sent to him in a text file and then coppied them into gdb all at once. I also used the arguments that C::B sends to gdb on start up. Everything works fine so there must be a problem with C::B.

mandrav could you please tell me what else besides sending commands to and reciving them from gdb does this plugin do?
Also could you please tell me why there are all those >>>>>> and cb_gdb: writen to debugger log?
I would also need to know which function is responsible for sending and which for reciving gdb commands.

r. Domen

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: debug plugin
« Reply #9 on: January 24, 2007, 03:04:58 pm »
Quote
mandrav could you please tell me what else besides sending commands to and reciving them from gdb does this plugin do?

Nothing. That is exactly what it does (and interfaces with the gui, of course).

Quote
Also could you please tell me why there are all those >>>>>> and cb_gdb: writen to debugger log?

This is the gdb prompt, as set by the plugin.

Quote
I would also need to know which function is responsible for sending and which for reciving gdb commands.

This is kind of complex and requires studying the plugin code. It's in src/plugins/debuggergdb/*
Be patient!
This bug will be fixed soon...

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #10 on: January 25, 2007, 04:20:13 pm »
I've found one of the problems and submited the patch to berilOS: 001855. But there seems to be more problems. Could someone confirm that this setting works for all gdbs on linux not just mine which is patched.

Code
--- src/plugins/debuggergdb/gdb_driver.cpp      2007-01-25 16:11:54.000000000 +0100
+++ src/plugins/debuggergdb/gdb_driver.cpp      2007-01-25 16:15:38.000000000 +0100
@@ -375,7 +375,7 @@
     }
 #else
     m_BreakOnEntry = breakOnEntry;
-    m_ManualBreakOnEntry = true;
+    m_ManualBreakOnEntry = false;

     if (!Manager::Get()->GetConfigManager(_T("debugger"))->ReadBool(_T("do_not_run"), false))
     {

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #11 on: January 25, 2007, 04:21:44 pm »
The reason why I havent noticed this before is that before #if (defined( __LINUX__) || defined(__WXMAC__)) was used instead of #if (defined( __WXMSW__) || defined(__WXMAC__)) so this part of the code wasnt even compiled as I am using LInux.

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: debug plugin
« Reply #12 on: January 26, 2007, 10:37:07 am »
I've found the second problem and it was in my gdb. It didn't execute run command propperly. Now it works  :D

r. Domen