This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [RFA]: search_symbols(in symtab.c) -- fix off by one error


    From: Elena Zannoni <ezannoni@cygnus.com>
    Date: Fri, 25 Aug 2000 11:56:20 -0400 (EDT)

    Yes, true. Approved. Now, though, there is another similar thing in
    symtab.c:symtab_symbol_info(). This function also defines an array and
    uses LABEL_NAMESPACE to access its elements. But it subtracts 1, so
    this is in sync:

Thanks.

    symtab_symbol_info (regexp, kind, from_tty)
	 char *regexp;
	 namespace_enum kind;
	 int from_tty;
    {
      static char *classnames[]
      =
      {"variable", "function", "type", "method"};

    [....]

      printf_filtered (regexp
		       ? "All %ss matching regular expression \"%s\":\n"
		       : "All defined %ss:\n",
		       classnames[(int) (kind - LABEL_NAMESPACE - 1)], regexp);
    [....]


    I wonder why LABEL_NAMESPACE was used at all.
    Can you fix this above occurrence as well, so it is all consistent?

Done.  I'll be committing it later today.

    Thanks
    Elena

David

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