contrib/gdb-7/gdb/linespec.c
static struct symtabs_and_lines
decode_variable (struct linespec_state *self, char *copy)
{
  struct collect_info info;
  const char *lookup_name;
  char *canon;
  struct cleanup *cleanup;

  info.state = self;
  info.result.sals = NULL;
  info.result.nelts = 0;

  cleanup = demangle_for_lookup (copy, current_language->la_language,
				 &lookup_name);
  if (current_language->la_language == language_ada)
    {
      /* In Ada, the symbol lookups are performed using the encoded
         name rather than the demangled name.  */
      lookup_name = ada_name_for_lookup (copy);
      make_cleanup (xfree, (void *) lookup_name);
    }

  canon = cp_canonicalize_string_no_typedefs (lookup_name);
  if (canon != NULL)
    {
      make_cleanup (xfree, canon);
      lookup_name = canon;
    }

  add_matching_symbols_to_info (lookup_name, &info, NULL);

  if (info.result.nelts > 0)
    {
      if (self->canonical)
	{
	  self->canonical->pre_expanded = 1;
	  if (self->user_filename)
	    self->canonical->addr_string
	      = xstrprintf ("%s:%s", self->user_filename, copy);
	  else
	    self->canonical->addr_string = xstrdup (copy);
	}
      return info.result;
    }

  if (!have_full_symbols ()
      && !have_partial_symbols ()
      && !have_minimal_symbols ())
    throw_error (NOT_FOUND_ERROR,
		 _("No symbol table is loaded.  Use the \"file\" command."));
  if (self->user_filename)
    throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined in \"%s\"."),
		 copy, self->user_filename);
  else
    throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy);
}
/* Decode a linespec that's a variable.  If FILE_SYMTAB is non-NULL,
   look in that symtab's static variables first.  */
Decode a linespec that's a variable.  If FILE_SYMTAB is non-NULL,
look in that symtab's static variables first.
Decode a linespec that ' s a variable . If FILE_SYMTAB is non - NULL look in that symtab ' s static variables first .
static struct symtabs_and_lines
decode_variable (struct linespec_state *self, char *copy)
{
  struct collect_info info;
  const char *lookup_name;
  char *canon;
  struct cleanup *cleanup;
  info.state = self;
  info.result.sals = NULL;
  info.result.nelts = 0;
  cleanup = demangle_for_lookup (copy, current_language->la_language,
				 &lookup_name);
  if (current_language->la_language == language_ada)
    {
      lookup_name = ada_name_for_lookup (copy);
      make_cleanup (xfree, (void *) lookup_name);
    }
  canon = cp_canonicalize_string_no_typedefs (lookup_name);
  if (canon != NULL)
    {
      make_cleanup (xfree, canon);
      lookup_name = canon;
    }
  add_matching_symbols_to_info (lookup_name, &info, NULL);
  if (info.result.nelts > 0)
    {
      if (self->canonical)
	{
	  self->canonical->pre_expanded = 1;
	  if (self->user_filename)
	    self->canonical->addr_string
	      = xstrprintf ("%s:%s", self->user_filename, copy);
	  else
	    self->canonical->addr_string = xstrdup (copy);
	}
      return info.result;
    }
  if (!have_full_symbols ()
      && !have_partial_symbols ()
      && !have_minimal_symbols ())
    throw_error (NOT_FOUND_ERROR,
		 _("No symbol table is loaded.  Use the \"file\" command."));
  if (self->user_filename)
    throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined in \"%s\"."),
		 copy, self->user_filename);
  else
    throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy);
}
static struct symtabs_and_lines decode_variable ( struct linespec_state * self , char * copy ) { struct collect_info info ; const char * lookup_name ; char * canon ; struct cleanup * cleanup ; info . state = self ; info . result . sals = NULL ; info . result . nelts = 0 ; cleanup = demangle_for_lookup ( copy , current_language -> la_language , & lookup_name ) ; if ( current_language -> la_language == language_ada ) { lookup_name = ada_name_for_lookup ( copy ) ; make_cleanup ( xfree , ( void * ) lookup_name ) ; } canon = cp_canonicalize_string_no_typedefs ( lookup_name ) ; if ( canon != NULL ) { make_cleanup ( xfree , canon ) ; lookup_name = canon ; } add_matching_symbols_to_info ( lookup_name , & info , NULL ) ; if ( info . result . nelts > 0 ) { if ( self -> canonical ) { self -> canonical -> pre_expanded = 1 ; if ( self -> user_filename ) self -> canonical -> addr_string = xstrprintf ( " " , self -> user_filename , copy ) ; else self -> canonical -> addr_string = xstrdup ( copy ) ; } return info . result ; } if ( ! have_full_symbols ( ) && ! have_partial_symbols ( ) && ! have_minimal_symbols ( ) ) throw_error ( NOT_FOUND_ERROR , _ ( " \" \" " ) ) ; if ( self -> user_filename ) throw_error ( NOT_FOUND_ERROR , _ ( " \" \" \" \" " ) , copy , self -> user_filename ) ; else throw_error ( NOT_FOUND_ERROR , _ ( " \" \" " ) , copy ) ; }
Decode a linespec that's a variable.
Decode a linespec that ' s a variable .
/* In Ada, the symbol lookups are performed using the encoded
         name rather than the demangled name.  */