Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Ingham <jingham@apple.com>
To: gdb-patches@sources.redhat.com
Subject: Obvious fix in values.c?
Date: Fri, 19 Apr 2002 14:28:00 -0000	[thread overview]
Message-ID: <6D0E546A-53DC-11D6-8B7C-00039379E320@apple.com> (raw)

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


             reply	other threads:[~2002-04-19 21:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-19 14:28 Jim Ingham [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6D0E546A-53DC-11D6-8B7C-00039379E320@apple.com \
    --to=jingham@apple.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox