This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [RFA 1/2] Linespec rewrite (update 2)


Keith Seitz <keiths@redhat.com> writes:

> +      for (i = 0; VEC_iterate (symbolp, ls->labels.label_symbols, i, sym); ++i)
> +	{
> +	  symbol_to_sal (&sal, state->funfirstline, sym);
> +	  add_sal_to_sals (state, &sals, &sal,
> +			   SYMBOL_NATURAL_NAME (sym));

If symbol_to_sal returns 0 then sal is uninitialized.

> +	}
> +    }
> +  else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
> +    {
> +      /* We have just a bunch of functions and/or methods.  */
> +      int i;
> +      struct symtab_and_line sal;
> +      struct symbol *sym;
> +      minsym_and_objfile_d *elem;
> +      struct program_space *pspace;
> +
> +      if (ls->function_symbols != NULL)
> +	{
> +	  /* Sort symbols so that symbols with the same program space are next
> +	     to each other.  */
> +	  qsort (VEC_address (symbolp, ls->function_symbols),
> +		 VEC_length (symbolp, ls->function_symbols),
> +		 sizeof (symbolp), compare_symbols);
> +
> +	  for (i = 0; VEC_iterate (symbolp, ls->function_symbols, i, sym); ++i)
> +	    {
> +	      pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym));
> +	      set_current_program_space (pspace);
> +	      symbol_to_sal (&sal, state->funfirstline, sym);
> +	      if (maybe_add_address (state->addr_set, pspace, sal.pc))
> +		add_sal_to_sals (state, &sals, &sal, SYMBOL_NATURAL_NAME (sym));

Likewise.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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