Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Obvious fix in values.c?
@ 2002-04-19 14:28 Jim Ingham
  2002-04-19 15:58 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Ingham @ 2002-04-19 14:28 UTC (permalink / raw)
  To: gdb-patches

Do folks agree that this falls under the obvious fix rule?  It doesn't 
seem safe to assume that all demangled names will contain a space (and 
in fact, gdb crashed on someone when the assumption was proved false...).

2002-04-19  Jim Ingham <jingham@apple.com>

	* values.c (value_headof): Don't assume all demangled names contain 
a space.

Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.34
diff -p -r1.34 values.c
*** values.c    29 Jan 2002 03:08:26 -0000      1.34
--- values.c    19 Apr 2002 21:24:45 -0000
*************** value_headof (struct value *in_arg, stru
*** 1043,1048 ****
--- 1043,1049 ----
     struct symbol *sym;
     char *demangled_name;
     struct minimal_symbol *msymbol;
+   char *tmp;

     btype = TYPE_VPTR_BASETYPE (dtype);
     CHECK_TYPEDEF (btype);
*************** value_headof (struct value *in_arg, stru
*** 1080,1086 ****
           return in_arg;
         }
     demangled_name = cplus_demangle(demangled_name,DMGL_ANSI);
!   *(strchr (demangled_name, ' ')) = '\0';

     sym = lookup_symbol (demangled_name, 0, VAR_NAMESPACE, 0, 0);
     if (sym == NULL)
--- 1081,1089 ----
           return in_arg;
         }
     demangled_name = cplus_demangle(demangled_name,DMGL_ANSI);
!   tmp = strchr (demangled_name, ' ');
!   if (tmp)
!     *tmp = '\0';

     sym = lookup_symbol (demangled_name, 0, VAR_NAMESPACE, 0, 0);
     if (sym == NULL)

--
Jim Ingham                                   jingham@apple.com
Developer Tools - gdb
Apple Computer


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-11 23:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19 14:28 Obvious fix in values.c? Jim Ingham
2002-04-19 15:58 ` Daniel Jacobowitz
2002-04-19 16:23   ` Jim Ingham
2002-04-19 16:43     ` Andrew Cagney
2002-04-19 18:06       ` Jim Ingham
2002-05-11 16:46   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox