Index: mdebugread.c =================================================================== RCS file: /cvs/src/src/gdb/mdebugread.c,v retrieving revision 1.32 diff -c -3 -p -r1.32 mdebugread.c *** mdebugread.c 17 Dec 2002 00:39:07 -0000 1.32 --- mdebugread.c 3 Jan 2003 13:59:00 -0000 *************** parse_symbol (SYMR *sh, union aux_ext *a *** 865,871 **** switch (tsym.st) { case stEnd: ! goto end_of_fields; case stMember: if (nfields == 0 && type_code == TYPE_CODE_UNDEF) --- 865,888 ---- switch (tsym.st) { case stEnd: ! /* C++ encodes class types as structures where there the ! methods are encoded as stProc. The scope of stProc ! symbols also ends with stEnd, thus creating a risk of ! taking the wrong stEnd symbol record as the end of ! the current struct, which would cause GDB to undercount ! the real number of fields in this struct. To make sure ! we really reached the right stEnd symbol record, we ! check the associated name, and match it against the ! struct name. Since method names are mangled while ! the class name is not, there is no risk of having a ! method whose name is identical to the class name ! (in particular constructor method names are different ! from the class name). There is therefore no risk that ! this check stops the count on the StEnd of a method. */ ! if (strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss, ! name) == 0) ! goto end_of_fields; ! break; case stMember: if (nfields == 0 && type_code == TYPE_CODE_UNDEF)