This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12673] Can not identify the new variable type by typedef.


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

--- Comment #2 from flyxiao_2000 at 163 dot com 2011-04-15 01:22:24 UTC ---
Hi,
   Thanks for your quick answer !
   The below is my case as your try !
    linux-j9au ----------------my suse hostname


linux-j9au:/local/test # cat foo.cc
#include <stdint.h>
#define MAX_KEYS 256
class foo
{
public:
 typedef struct {
     uint64_t key[MAX_KEYS];
     long   dataIndex;
     long next;
  } keyList_t;


};


int
main (void)
{
  foo::keyList_t kt;
  return 1;
}
linux-j9au:/local/test # g++ -g foo.cc
linux-j9au:/local/test # gdb -nx -q a.out
Reading symbols from /local/test/a.out...done.
(gdb) ptype foo::keyList_t
There is no field named keyList_t
(gdb) q
linux-j9au:/local/test # gdb -v
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 "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
linux-j9au:/local/test # uname -a
Linux linux-j9au 2.6.22.5-31-bigsmp #1 SMP 2007/09/21 22:29:00 UTC i686 i686
i386 GNU/Linux
linux-j9au:/local/test # uname -r
2.6.22.5-31-bigsmp
linux-j9au:/local/test # lsb_release -a
LSB Version:   
core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32:desktop-3.1-ia32:desktop-3.1-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description:    openSUSE 10.3 (i586)
Release:        10.3
Codename:       n/a











At 2011-04-15 01:36:26ï"keiths at redhat dot com"
<sourceware-bugzilla@sourceware.org> wrote:

>http://sourceware.org/bugzilla/show_bug.cgi?id=12673
>
>Keith Seitz <keiths at redhat dot com> changed:
>
>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>                 CC|                            |keiths at redhat dot com
>
>--- Comment #1 from Keith Seitz <keiths at redhat dot com> 2011-04-14 17:36:08 UTC ---
>I am unable to reproduce this bug, which works for me with 7.2 and newer on
>Fedora 13 w/gcc 4.4.5 (Red Hat 4.4.5-2), at least for this simple test case:
>
>#include <stdint.h>
>#define MAX_KEYS 256
>class foo
>{
>public:
> typedef struct {
>     uint64_t key[MAX_KEYS];
>     long   dataIndex;
>     long next;
>  } keyList_t;
>
>};
>
>int
>main (void)
>{
>  foo::keyList_t kt;
>  return 1;
>}
>
>$ g++ -g foo.cc
>$ gdb -nx -q a.out
>Reading symbols from /home/keiths/tmp/12673...done.
>(gdb) ptype foo::keyList_t
>type = struct foo::keyList_t {
>    uint64_t key[256];
>    long dataIndex;
>    long next;
>}
>(gdb)
>
>Several causes for this may include:
>1) Not compiling with debuginfo ("-g" flag to GCC/G++)
>2) Not referencing the type in your program (compiler didn't include it)
>3) Bug in compiler
>4) Some other bug not so trivially reproduced with this test case
>
>Can you supply a specific test case for this? What compiler are you using? What
>host platform (output of "gdb -v"/"show version") Are you using Windows? [Your
>test case uses "uint64" instead of "uint64_t".]
>
>-- 
>Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
>------- You are receiving this mail because: -------
>You reported the bug.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]