Author Topic: Changed behavior in GCC 4.4.0  (Read 3922 times)

Max

  • Guest
Changed behavior in GCC 4.4.0
« on: August 28, 2009, 10:12:36 am »
All,

I'm reporting a possible bug in CB/GDB plugin.

Some weeks ago I switched to Gcc4.4.0 (latest MinGW packages, Win XP SP3, latest nigthly). Before switching I was able to observe a message in the debugger window when an exception is thrown. Now
(see the atteched testcase) nothing is displayed, the debugger seems "sleeping" and nothing is indicating that an exception was thrown.

Enabling the "Debugger log display" I see the following

Command-line: C:\MinGW\bin\gdb.exe -nx -fullname  -quiet -args obj/TestCase.exe
Working dir : C:\Development\Projects\TestCase\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-mingw32".
>>>>>>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 debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source C:\Codeblocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/Development/Projects/TestCase/
>>>>>>cb_gdb:
> break "C:/Development/Projects/TestCase/main.cpp:21"
Breakpoint 2 at 0x4014c0: file C:\Development\Projects\TestCase\main.cpp, line 21.
>>>>>>cb_gdb:
> run
gdb: win32_init_thread_list
[New thread 784.0x688]
234   ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h: No such file or directory.
Catchpoint 1 (exception thrown)
__cxa_throw (obj=0x3e2630, tinfo=0x467454, dest=0x442488 <~runtime_error>) at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h:234
   in ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/unwind-cxx.h
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> whatis try
No symbol "try" in current context.
>>>>>>cb_gdb:
> output try
No symbol "try" in current context.
>>>>>>cb_gdb:
> output try
No symbol "try" in current context.
>>>>>>cb_gdb:
> output try
No symbol "try" in current context.
>>>>>>cb_gdb:

The message we got in the past was very convenient..now I know that when the debugger is sleeping an exception was thrown..a little bit less convevient..

Hope this helps

Max


[attachment deleted by admin]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Changed behavior in GCC 4.4.0
« Reply #1 on: September 01, 2009, 01:35:07 pm »
Hi, I downloaded and tested your testcase file.
It works successfully in TDM-GCC 4.4.0.
I personally suggest you try TDM-GCC, because I have find many unconvinced behavior when using the official MinGW 4.4 package.
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.