[RFA 1/2] Linespec rewrite (update 2)
Andreas Schwab
schwab@linux-m68k.org
Sun Jul 22 19:33:00 GMT 2012
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."
More information about the Gdb-patches
mailing list