Author Topic: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.  (Read 77208 times)

Offline themaddin

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #15 on: February 15, 2012, 04:34:25 pm »
Oh, I wish I could CB debug by myself but this is very new to me.

Now I'm working with 11 February 2012 build (7790) DEBUGGER BRANCH version.

It is possible to reproduce the problem without hardware. All you need is CB and Codesourcery. Codesourcery Lite is freeware. You can download it here: http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ (Download the EABI Release)


Compiler executable: arm-none-eabi-gcc.exe

Debugger executable: arm-none-eabi-gdb.exe

If you create a empty project and click continue the following debugger log should appear:
Code
[debug]GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs
[debug]Copyright (C) 2010 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "--host=i686-mingw32 --target=arm-none-eabi".
[debug]For bug reporting instructions, please see:
[debug]<https://support.codesourcery.com/GNUToolchain/>.
[debug]>>>>>>cb_gdb:GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs
[debug]> set confirm off

Debugger name and version: GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs

[debug]Copyright (C) 2010 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "--host=i686-mingw32 --target=arm-none-eabi".
[debug]For bug reporting instructions, please see:
[debug]<https://support.codesourcery.com/GNUToolchain/>.
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set debugevents on
[debug]No symbol table is loaded.  Use the "file" command.
[debug]No symbol table is loaded.  Use the "file" command.
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set new-console on
[debug]No symbol table is loaded.  Use the "file" command.
[debug]No symbol table is loaded.  Use the "file" command.
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]No symbol table is loaded.  Use the "file" command.
[debug]No symbol table is loaded.  Use the "file" command.
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> catch throw
[debug]No symbol table is loaded.  Use the "file" command.
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:Catchpoint 2 (throw)
[debug]> source C:\CodeBlocks_NB7790sa\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory D:/cb_projects/mysecproject/
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]>>>>>>cb_gdb:
[debug]Don't know how to run.  Try "help target".
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:

Every confirmation appears twice.


I think this is a problem between Codeblocks and Codesourcery.
It seems other people had this problem too. Look at the following GDB-Server log: http://www.mikrocontroller.net/topic/170920#1634778. Every message appears twice. Very similar to my problem.



I tried the GNU gdb from Yagarto tools. This one works fine.

Debuggers log with empty project:
Code
[debug]GNU gdb (GDB) 7.2
[debug]Copyright (C) 2010 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "--host=i686-pc-mingw32 --target=arm-none-eabi".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.2

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set debugevents on
[debug]No symbol table is loaded.  Use the "file" command.
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]No symbol table is loaded.  Use the "file" command.
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]No symbol table is loaded.  Use the "file" command.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\CodeBlocks_NB7790sa\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory D:/cb_projects/mysecproject/
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Don't know how to run.  Try "help target".
[debug]>>>>>>cb_gdb:
« Last Edit: May 08, 2012, 07:48:54 am by themaddin »

Offline themaddin

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #16 on: February 16, 2012, 12:46:02 pm »
It seems to me that is a general problem between CodeBlocks and Codesourcery GDB.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #17 on: February 16, 2012, 12:53:05 pm »
At the moment you can do one of these three things:
1. Wait for me to restart in windows and inspect your problem
2. Apply the change I proposed and see if this is the problem
3. Persuade someone else to do it

Spamming the forum with the same problem over and over again won't increase the chances of this problem getting fixed.
It can only minimize them, because I can get annoyed.  :P

p.s. I've added this problem to my to-do, so it wouldn't be forgotten.
(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 themaddin

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #18 on: February 16, 2012, 01:43:06 pm »
Hello oBFusCATed!
I don't want you to get annoyed. My only answering voice of this forum. ;) I'm glad to hear this thing is on your to do list.

Thanks for your reply. I will look if i could do one of the three things you mentioned.
My workaround is to use the yagarto gdb executable.

Kind regards
Martin

Offline Aradayn

  • Single posting newcomer
  • *
  • Posts: 8
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #19 on: February 18, 2012, 04:47:09 am »
I reported an issue ages ago with a nightly build that's still showing up in this one. In a nutshell, opening up the debugger settings crashed the IDE on my machine.

I finally got Codeblocks building from source this morning, and I narrowed the problem down significantly tonight. It appears that having a debugger name that is too long causes the crash:

debuggersettingsdlg.cpp:85
Code
m_treebook->AddPage(new DebuggerSettingsPanel(m_treebook, this, it->first), it->first->GetGUIName());

You see, the name I'm getting is "GDB Debugger." If I change the line like so:
Code
m_treebook->AddPage(new DebuggerSettingsPanel(m_treebook, this, it->first), _("GDB"));
it doesn't crash! It seems that if the debugger name is too long to fit in the panel, the crash occurs.

There's probably some crazy sizing thing causing infinite recursion somewhere deep in wx or Windows if this text overflows the panel for some reason, but I don't know wx well enough to get to the root of the issue.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #20 on: February 18, 2012, 10:10:30 am »
Aradayn: Thanks for the tests you've done. I'll see if I can find time to do some more debugging about this problem.
(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: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #21 on: February 19, 2012, 07:51:17 pm »
@themaddin:
I've just tested with Codesourcery on windows and it turns out I'm right.
Using SetMode(wxEOL_DOS) fixes the problem.
Can you ask the Codesourcery's support what do they think about this problem?

@devs: Should I add an option to specify the EOL mode or should I try to find another solution?

@Aradayn: Confirmed, using _("GDB") instead of the full name fixes the crash.
Does anyone know what I can do to debug this?
(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: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #22 on: February 19, 2012, 08:13:07 pm »
Using SetMode(wxEOL_DOS) fixes the problem.
[...]
@devs: Should I add an option to specify the EOL mode or should I try to find another solution?
I didn't fully understand why and where you want to add this?
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: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #23 on: February 19, 2012, 08:28:31 pm »
Code
Index: src/sdk/pipedprocess.cpp
===================================================================
--- src/sdk/pipedprocess.cpp    (revision 7821)
+++ src/sdk/pipedprocess.cpp    (working copy)
@@ -148,6 +148,7 @@
     if (pOut)
     {
         wxTextOutputStream sin(*pOut);
+        sin.SetMode(wxEOL_UNIX);
         wxString msg = text + _T('\n');
         sin.WriteString(msg);
     }

Here is the patch that makes it work.
The reason is that this version of gdb treats both \n and \m as new command markers.
So using \n\m triggers as two commands:
1. the actual command
2. the re execution of the command, because most debuggers treat empty commands as "repeat-last-command", this is a feature to simplify usage.
(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: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #24 on: February 19, 2012, 09:58:08 pm »
Here is the patch that makes it work.
OK - I see. However, this is a very sensible component, so we really should test long(er). Remember your last trial to change this class??? ;-) ;D ;D ;D

I'll apply in my local copy and report back...
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: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #25 on: February 19, 2012, 10:25:09 pm »
The change would be simple and non-destructive. I'm thinking of adding another parameter to the SendString function and also to add an option, to use the wxEOL_DOS which will be off by default.
(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 themaddin

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #26 on: February 21, 2012, 02:47:06 pm »
Hello oBFusCATed,

thanks for your effort. Codesourcery offers support only for paid versions.
I think the change you are thinking about would be great.  :)


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #27 on: February 21, 2012, 02:59:22 pm »
I think the change you are thinking about would be great.  :)
Great is not the right word here! :(

Do you have an e-mail, where I can write to them then?
(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 scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #28 on: February 21, 2012, 06:01:24 pm »
Codesourcery offers support only for paid versions.
Although they offer support only for paid versions, I don't think they'll decline bug reports. ;)

@obfuscated: They have a contact page here but I don't know if that's what u are looking for.
http://www.mentor.com/embedded-software/contactme

Offline themaddin

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: The 11 February 2012 build (7790) DEBUGGER BRANCH version is out.
« Reply #29 on: February 22, 2012, 02:14:26 pm »
Do you have an e-mail, where I can write to them then?
No, unfortunately not. Maybe the contact page posted by scarphin helps.