mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 02:53:48 +08:00
Various fixes to improve C++ debugging. See ChangeLog.
This commit is contained in:
parent
7eec00ed56
commit
5c5b5d4b0e
@ -84,6 +84,7 @@ expprint.c
|
||||
expression.h
|
||||
findvar.c
|
||||
frame.h
|
||||
gcc.patch
|
||||
gdb-stabs.h
|
||||
gdb.1
|
||||
gdbcmd.h
|
||||
|
@ -1,3 +1,23 @@
|
||||
Thu Jul 9 19:05:27 1992 Per Bothner (bothner@rtl.cygnus.com)
|
||||
|
||||
* gdbtypes.c (lookup_struct_elt_type): If the input type is
|
||||
TYPE_CODE_PTR or TYPE_CODE_REF, dereference it to get the
|
||||
target type. Otherwise, 'whatis this.field' wouldn't work,
|
||||
which would be inconsistent, since 'print this.field' works.
|
||||
* buildsym.c (read_struct_type, read_enum_type): Clear
|
||||
TYPE_FLAG_STUB flag.
|
||||
* buildsym.c (cleanup_undefined_types): Don't rely on a
|
||||
flawed "Reasonable test to see if" a type has been defined
|
||||
since it was referred to; now we can just see if the
|
||||
TYPE_FLAG_STUB flag has been cleared.
|
||||
* valprint.c (print_type_base): Emit public/protected/private
|
||||
labels for methods as well as fields. Also, indent these labels
|
||||
2 spaces instead of 4, for a more conventional "look".
|
||||
* symtab.c (gdb_mangle_name): Undo Fred's change, unless
|
||||
GCC_MANGLE_BUG is defined. Also, handle destructors specially.
|
||||
* gcc.patch: New file. Contains patch for gcc (so people
|
||||
with gdb-2.2.x won't have to wait for a new gcc release).
|
||||
|
||||
Thu Jul 9 18:44:26 1992 Ken Raeburn (raeburn@cygnus.com)
|
||||
|
||||
* i960-pinsn.c (mem): Variables reg[123] should point to CONST.
|
||||
|
@ -1622,8 +1622,8 @@ cleanup_undefined_types ()
|
||||
case TYPE_CODE_UNION:
|
||||
case TYPE_CODE_ENUM:
|
||||
{
|
||||
/* Reasonable test to see if it's been defined since. */
|
||||
if (TYPE_NFIELDS (*type) == 0)
|
||||
/* Check if it has been defined since. */
|
||||
if (TYPE_FLAGS (*type) & TYPE_FLAG_STUB)
|
||||
{
|
||||
struct pending *ppt;
|
||||
int i;
|
||||
@ -1650,9 +1650,6 @@ cleanup_undefined_types ()
|
||||
memcpy (*type, SYMBOL_TYPE (sym), sizeof (struct type));
|
||||
}
|
||||
}
|
||||
else
|
||||
/* It has been defined; don't mark it as a stub. */
|
||||
TYPE_FLAGS (*type) &= ~TYPE_FLAG_STUB;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2129,6 +2126,7 @@ read_struct_type (pp, type, objfile)
|
||||
|
||||
TYPE_CODE (type) = TYPE_CODE_STRUCT;
|
||||
INIT_CPLUS_SPECIFIC(type);
|
||||
TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
|
||||
|
||||
/* First comes the total size in bytes. */
|
||||
|
||||
@ -2339,9 +2337,19 @@ read_struct_type (pp, type, objfile)
|
||||
list->field.type = read_type (pp, objfile);
|
||||
if (**pp == ':')
|
||||
{
|
||||
/* Static class member. */
|
||||
list->field.bitpos = (long)-1;
|
||||
p = ++(*pp);
|
||||
#if 0
|
||||
/* Possible future hook for nested types. */
|
||||
if (**pp == '!')
|
||||
{
|
||||
list->field.bitpos = (long)-2; /* nested type */
|
||||
p = ++(*pp);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ /* Static class member. */
|
||||
list->field.bitpos = (long)-1;
|
||||
}
|
||||
while (*p != ';') p++;
|
||||
list->field.bitsize = (long) savestring (*pp, p - *pp);
|
||||
*pp = p + 1;
|
||||
@ -2943,6 +2951,7 @@ read_enum_type (pp, type, objfile)
|
||||
|
||||
TYPE_LENGTH (type) = sizeof (int);
|
||||
TYPE_CODE (type) = TYPE_CODE_ENUM;
|
||||
TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
|
||||
TYPE_NFIELDS (type) = nsyms;
|
||||
TYPE_FIELDS (type) = (struct field *)
|
||||
obstack_alloc (&objfile -> type_obstack,
|
||||
|
63
gdb/gcc.patch
Normal file
63
gdb/gcc.patch
Normal file
@ -0,0 +1,63 @@
|
||||
Recent versions of gcc have had a bug in how they emit debugging
|
||||
information for C++ methods (when using dbx-style stabs).
|
||||
This patch should fix the problem. Fix you can't fix gcc,
|
||||
you can alternatively define GCC_MANGLE_BUG when compling gdb/symtab.c.
|
||||
|
||||
===================================================================
|
||||
RCS file: /rel/cvsfiles/devo/gcc/dbxout.c,v
|
||||
retrieving revision 1.53
|
||||
diff -c -r1.53 dbxout.c
|
||||
*** 1.53 1992/07/05 09:50:22
|
||||
--- dbxout.c 1992/07/09 07:00:33
|
||||
***************
|
||||
*** 683,688 ****
|
||||
--- 683,689 ----
|
||||
tree type_encoding;
|
||||
register tree fndecl;
|
||||
register tree last;
|
||||
+ char formatted_type_identifier_length[16];
|
||||
register int type_identifier_length;
|
||||
|
||||
if (methods == NULL_TREE)
|
||||
***************
|
||||
*** 711,716 ****
|
||||
--- 712,719 ----
|
||||
|
||||
type_identifier_length = IDENTIFIER_LENGTH (type_encoding);
|
||||
|
||||
+ sprintf(formatted_type_identifier_length, "%d", type_identifier_length);
|
||||
+
|
||||
if (TREE_CODE (methods) == FUNCTION_DECL)
|
||||
fndecl = methods;
|
||||
else if (TREE_VEC_ELT (methods, 0) != NULL_TREE)
|
||||
***************
|
||||
*** 754,762 ****
|
||||
--- 757,769 ----
|
||||
if (debug_name[0] == '_' && debug_name[1] == '_')
|
||||
{
|
||||
char *method_name = debug_name + 2;
|
||||
+ char *length_ptr = formatted_type_identifier_length;
|
||||
/* Get past const and volatile qualifiers. */
|
||||
while (*method_name == 'C' || *method_name == 'V')
|
||||
method_name++;
|
||||
+ /* Skip digits for length of type_encoding. */
|
||||
+ while (*method_name == *length_ptr && *length_ptr)
|
||||
+ length_ptr++, method_name++;
|
||||
if (! strncmp (method_name,
|
||||
IDENTIFIER_POINTER (type_encoding),
|
||||
type_identifier_length))
|
||||
***************
|
||||
*** 768,775 ****
|
||||
--- 775,786 ----
|
||||
else if (debug_name[0] == '_' && debug_name[1] == '_')
|
||||
{
|
||||
char *ctor_name = debug_name + 2;
|
||||
+ char *length_ptr = formatted_type_identifier_length;
|
||||
while (*ctor_name == 'C' || *ctor_name == 'V')
|
||||
ctor_name++;
|
||||
+ /* Skip digits for length of type_encoding. */
|
||||
+ while (*ctor_name == *length_ptr && *length_ptr)
|
||||
+ length_ptr++, ctor_name++;
|
||||
if (!strncmp (IDENTIFIER_POINTER (type_encoding), ctor_name,
|
||||
type_identifier_length))
|
||||
debug_name = ctor_name + type_identifier_length;
|
@ -611,6 +611,10 @@ lookup_struct_elt_type (type, name, noerr)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR ||
|
||||
TYPE_CODE (type) == TYPE_CODE_REF)
|
||||
type = TYPE_TARGET_TYPE (type);
|
||||
|
||||
if (TYPE_CODE (type) != TYPE_CODE_STRUCT &&
|
||||
TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user