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:
#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:
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==10Now I use F8 (Start) and here is the debugger output:
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):
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