[Bug c++/45334] New: Base class type information not accessible in binaries compiled with g++ 4.5.0

2010-08-18 Thread andre dot poenitz at nokia dot com
This is a copy of an issue originally filed as gdb bug at
http://sourceware.org/bugzilla/show_bug.cgi?id=11639 that was identified as a
gcc issue in the mean time:

If 'Derived' and 'Base' are setup as shown in the attachment

void Derived::foo()
{
Base *b = this;
Base &br = *b;
}

then

 'print b'

yields  "$1 = (void *) 0xbfffee38", i.e. the type information for 'b' is
completely lost.

It should print (Base *) 0xbfffee38. 

The problem is not present in g++ 4.4.


-- 
   Summary: Base class type information not accessible in binaries
compiled with g++ 4.5.0
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andre dot poenitz at nokia dot com
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45334



[Bug c++/45334] Base class type information not accessible in binaries compiled with g++ 4.5.0

2010-08-18 Thread andre dot poenitz at nokia dot com


--- Comment #1 from andre dot poenitz at nokia dot com  2010-08-19 06:58 
---
Created an attachment (id=21517)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21517&action=view)
Example code to reproduce the problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45334



[Bug debug/45465] New: Wrong type reported by gdb

2010-08-31 Thread andre dot poenitz at nokia dot com
This is a somewhat curious issue as one needs fairly recent gcc (>= 4.5) _and_
gdb ( > 2010-07-29 ) to reproduce.


- snip -
#!/bin/sh

# To reproduce:
#   - use g++ 4.5 or 4.6 (but not 4.4)
#   - use gdb from CVS from 2010-07-29 or newer

echo "

template
void x(_ForwardIterator __first)
{
}

template
struct vector
{
T* _M_start;
vector() { x(_M_start); }
};

struct foo {};

int main()
{
vector flist;
foo *f = new foo;
}
" > foo.cpp

CXX=/usr/local/bin/i686-pc-linux-gnu-g++-4.5.0
CXX=/usr/bin/g++
CXX=/usr/local/bin/i686-pc-linux-gnu-g++-4.6.0

${CXX} -g foo.cpp -o foo

GDB=~/bin/gdb-7.1   # works
GDB=~/bin/gdb-7.0   # works
GDB=~/debugger/fsf-git/gdb/gdb  # "fails"

${GDB} -ex 'set confirm off' \
-ex 'b main' -ex 'run' -ex 'p f' -ex 'q'\
./foo


# GNU gdb (GDB) 7.2.50.20100728-cvs
# [...]
# Breakpoint 1 at 0x80486d2: file foo.cpp, line 18.
# Breakpoint 1, main () at foo.cpp:18
# #18  foo *f = new foo;
# $1 = (_ForwardIterator) 0x402b8ff4
- snip -


The type 'ForwardIterator' is wrong, should be  (foo *)


-- 
   Summary: Wrong type reported by gdb
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andre dot poenitz at nokia dot com
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45465



[Bug debug/45465] Wrong type reported by gdb

2010-08-31 Thread andre dot poenitz at nokia dot com


--- Comment #1 from andre dot poenitz at nokia dot com  2010-08-31 17:08 
---
This is also tracked on gdb's bugzilla as

   http://sourceware.org/bugzilla/show_bug.cgi?id=11961


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45465



[Bug debug/45465] Wrong type reported by gdb

2010-08-31 Thread andre dot poenitz at nokia dot com


--- Comment #2 from andre dot poenitz at nokia dot com  2010-08-31 17:08 
---

This is now also tracked on the gcc bugzilla as

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45465


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45465