Author Topic: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.  (Read 43538 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #15 on: March 11, 2011, 01:35:12 pm »
Please post the long from debuggers branch 7017...
Or add your variable as a watch in the normal nightly.
It seems the locals work, but there the debugger scripts are not working.

Read this: http://wiki.codeblocks.org/index.php?title=Debugger_scripts and probably try to disable the debug scripts for wxString.
(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 Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #16 on: March 11, 2011, 02:31:19 pm »
You are right. Now and in the KB, I got the same result.

Quote
output /c test.m_pchData[0]@((wxStringData*)test.m_pchData - 1)->nDataLength

the result is not readable character set - {31 '\037', 64 '@', 62 '>', 49 '1', 48 '0'}>>>>>>cb_gdb:

Code
> p test.m_pchData[0]@((wxStringData*)test.m_pchData - 1)->nDataLength

shows what i need - $2 = L"Проба"

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #17 on: March 11, 2011, 02:47:11 pm »
Find the gdb_types.script and remove the function call which registers the wxString handling, after that it will probably work correctly.

For best results you'll need the python pretty printers for wxWidgets...
(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 Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #18 on: March 11, 2011, 03:01:13 pm »
with rev7017 I have no problems. 7040_deb does not show local variables(http://forums.codeblocks.org/index.php?action=dlattach;topic=14334.0;attach=5344;image). shows only those variables that I added. change the script does not work as a result of just an empty string. The results of python pretty printers for wxWidgets do not fall into the Watches (7040_deb)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #19 on: March 11, 2011, 03:09:07 pm »
Find the gdb_types.script and remove the function call which registers the wxString handling, after that it will probably work correctly.

For best results you'll need the python pretty printers for wxWidgets...
totally agree!!!

and for pretty printer for wx, see my wiki pages on that site:
http://code.google.com/p/qp-gcc/

PS: I can't access to that site because the earth quake in Japan break some lines from China :(.

« Last Edit: March 11, 2011, 03:15:44 pm by ollydbg »
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: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #20 on: March 11, 2011, 03:26:22 pm »
with rev7017 I have no problems. 7040_deb does not show local variables(http://forums.codeblocks.org/index.php?action=dlattach;topic=14334.0;attach=5344;image). shows only those variables that I added. change the script does not work as a result of just an empty string. The results of python pretty printers for wxWidgets do not fall into the Watches (7040_deb)
With rev7017 you'll have the same problem, when you use "add watch" ...
Local vars are useful, but a bit limiting and at the moment are not implemented in the debuggers branch...

Also are you sure you've removed the call? Have you tried to restart C::B (not sure if it is needed).
What is the result of the "print test" gdb command?

The pretty printers change the output of the print/output gdb commands and that are the commands used to get the values for the watches.

See the sait Ollydbg mentioned.
(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 killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #21 on: March 11, 2011, 03:46:28 pm »
Quote
Local vars are useful, but a bit limiting and at the moment are not implemented in the debuggers branch...

Since we are thinking of merging the debugger branch to trunk, I personally think this is something that should be fixed asap. This seems a show stopper to me.
I don't think I can convince anyone, of all our improvements if even a local variable can not be watched.
[or am I misinterpreting the quote above ??]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #22 on: March 11, 2011, 04:07:49 pm »
killerbot:
Hm, you prefer the old unusable watches which had the almost unusable local variables, over the new usable watches which don't have them?

The reason for the missing local vars/func args, as I've stated many times, is that I want to have them in separate windows. I want something like, what is done in VStudio.
But at the moment I think it is not possible. I want to be able to move a window from one notebook to another, but last time I've checked wxAUI didn't support this feature.

p.s. we are talking about the automatic local variables, you can watch local variables but you should add them manually...
(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 killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #23 on: March 12, 2011, 09:18:08 am »
Quote
p.s. we are talking about the automatic local variables, you can watch local variables but you should add them manually...

ok, that's why is was asking. This makes already much more sense :-)

And I do prefer the new way of course. I hope we will be able to have automatic ones too, if we can solve the technical issue you mention.

Offline Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #24 on: March 12, 2011, 10:09:20 am »
svn 7017
One more thing, if you close the CB in advanced debugging. CB closes with an error, of the advanced settings for the debugger in the CB are not saved.

svn 7017_7040 and add watches:
I changed the script it solved the problem for me
Code
//in Evaluate_wxString change
local result = _T("output /c ") + a_str + oper + _T("m_pchData[") + start + _T("]@");
//to
local result = _T("output /s ") + a_str + oper + _T("m_pchData[") + start + _T("]@");

function Parse_wxString(a_str, start)
{
  local result = a_str;
  return result;
}

Debugger run as

Code
source C:\MinGW_441\bin\wx.gdb
set print element 0

Offline Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #25 on: March 13, 2011, 09:01:04 pm »
Hello to you all. Good work.
A comment:
My enviroment is XP SP3, MinGW, GDB.
I set a breakpoint with 'properties' so it will stop when 'var==1000', debug-running becomes sloooow.
I notice gdb is consuming about 45% of CPU, C:B about 25% and my app only 2%. I activate 'Debugger(debug)' tab window and see how it's continuosly updating with messages:
Quote
kernel event for pid=3096 tid=fc8 code=EXCEPTION_DEBUG_EVENT)
e=EXCEPTION_DEBUG_EVENT)
ContinueDebu
gEvent (cpid=3096, ctid=fc8, DBG_CONTINUE);
INUE);
 tid=fc8 code=EXCEPTION_DEBUG_EVENT)
c8, DBG_CONTINUE);
for pid=3096 tid=fc8 code=EXCEPTION_DEBUG_EVENT)
EBUG_EVENT)
3096, ctid=fc8, DBG_CONTINUE);
ernel event for pid=3096 tid=fc8 code=EXCEPTION_DEBUG_EVENT)
=EXCEPTION_DEBUG_EVENT)
nt for pid=3096 tid=fc8 code=EXCEPTION_DEBUG_EVENT)
ContinueDebug
Event (cpid=3096, ctid=fc8, DBG_CONTINUE);
NUE);
tid=fc8 code=EXCEPTION_DEBUG_EVENT)
C
ontinueDebugEvent (cpid=3096, ctid=fc8, DBG_CONTINUE);
8, DBG_CONTINUE);
IMHO, all these prompts are not interesting but just before the debugger stops at my breakpoint because that var's condition.
Also note that in each iteration at least the initial character of the prompt is "eaten".

TIA
Manolo

Offline Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #26 on: March 13, 2011, 09:16:44 pm »
Hello again.
Other point when debugging is about watches window.
I have a class with a member that is an array. Because I want to watch that array, I watch the class, look for the address of that array and open the 'Examine memory' window for that address.
Other way is at the watching window: I can set properties for my class (or 'rename') to myclass.myarray and watch it. But I would prefer to see inside the watch window some part of that array, with just some kind of click on my array member (i.e. setting also properties for that member).

Thanks
Manolo

Offline Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #27 on: March 13, 2011, 09:35:54 pm »
Hello, twice again.
I don't know if this thread is the right for this question or if it is a gdb bug...

I set only one breakpoint, start, and the run stops at it. OK.
Now I use the 'Next line' button (or F7) and gdb complains:
Quote
>>>>>>cb_gdb:
> next
Warning:
Cannot insert breakpoint -127.
Error accessing memory address 0x7816cd30: Input/output error.
Cannot insert breakpoint -126.
Error accessing memory address 0x7c343646: Input/output error.
>>>>>>cb_gdb:
> next
Warning:
Cannot insert breakpoint -131.
Error accessing memory address 0x7816cd30: Input/output error.
I searched for this in the web. I found a possible gdb's bug about
"PIE (Position Independent Executable), which GDB does NOT currently support"
I don't know how to cope with this.

TIA
Manolo

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #28 on: March 13, 2011, 10:07:47 pm »
Reply in reverse order:

to post3: Check if you're using -fPIE to compile your application, if you're using it please remove it.

to post2: To watch arrays without size ( the array declaration is not T a[size]), you have to add the my_struct.my_array to the watches and then set the properties for the watch to be 'watch as array' and dial an appropriate count.

to post1:
Are you using a quad core processor?
Can you reproduce this problem with simple console hello world project?
Can you set the condition to var==10 and then paste the debugger's debug log?
(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 Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
« Reply #29 on: March 15, 2011, 12:42:23 am »
Post 3: Activating 'Complier loggin: full command line' I don't see -fPIE

Post 2: You are saying what I said. I asked for simplifying it setting also properties for dereferenced members in watch window.

Post 1:
I'm using an old AMD 3200
Here's is simple code:
Code
#include <iostream>
using namespace std;
int main()
{
    int var, res=0;
    for (var=0; var<1000; var++)
        res +=var; //set breakpoint here
    cout << res;
    return 0;
}
The full command line:
Quote
mingw32-g++.exe -Wall -fexceptions  -g    -IC:\MinGW\include  -c C:\PROGS\pruebas\hello\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\MinGW\lib  -o bin\Debug\hello.exe obj\Debug\main.o   
Información: se resuelve std::cout  al enlazar con __imp___ZSt4cout (auto-importación
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: aviso: la importación automática se activó sin especificar --enable-auto-import en la línea de órdenes.
Esto debe funcionar a menos que involucre estructuras de datos constantes que referencíen símbolos de DLLs auto-importadas.
)
Output size is 37.44 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings (0 minutes, 1 seconds)
 
I set the breakpoint and edit it's properties:
"Enabled" and "Break when expresion is true" and the expresion is var==10
Now I use F8 (Start) and here is the debugger output:
Quote
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\PROGS\pruebas\hello\
Adding source dir: C:\PROGS\pruebas\hello\
Adding file: bin\Debug\hello.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.2
Child process PID: 2760
Program exited normally.
Debugger finished with status 0
And the long output (I skip my long PATH):
Quote
Command-line: C:\MinGW\bin\gdb.exe -nx -fullname  -quiet -args bin/Debug/hello.exe
Working dir : C:\PROGS\pruebas\hello\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\PROGS\pruebas\hello/bin/Debug/hello.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source C:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/PROGS/pruebas/hello/
>>>>>>cb_gdb:
> break "C:/PROGS/pruebas/hello/main.cpp:6"
Breakpoint 2 at 0x4013d6: file C:\PROGS\pruebas\hello\main.cpp, line 6.
>>>>>>cb_gdb:
> condition 2 var==10
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 488.0x604]
Program exited normally.
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> quit
As you can see, it doesn't stop!
I change expresion to res>20 and try again with the same no-stop result.
No, I can't reproduce my first post problem with this simple code. But now it's a different problem.

TIA
Manolo