User forums > Nightly builds
The 06 March 2011 build (7040) DEBUGGER BRANCH version is out.
Manolo:
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);
--- End quote ---
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
Manolo:
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
Manolo:
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.
--- End quote ---
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
oBFusCATed:
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?
Manolo:
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;
}
--- End code ---
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)
--- End quote ---
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
--- End quote ---
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
--- End quote ---
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
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version