This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/2] Linespec rewrite (update 2)
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, "gdb-patches\ at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Sun, 22 Jul 2012 21:32:52 +0200
- Subject: Re: [RFA 1/2] Linespec rewrite (update 2)
- References: <4F70F8F7.503@redhat.com> <87zkb0wj1x.fsf@fleche.redhat.com> <4F74B583.6090008@redhat.com> <87obrertls.fsf@fleche.redhat.com> <4F75D859.1010907@redhat.com> <87r4waqc38.fsf@fleche.redhat.com> <20120330170913.GT2701@adacore.com> <87fwcqq8gl.fsf@fleche.redhat.com> <4F75F5F5.8070105@redhat.com> <4F7B8610.9070302@redhat.com>
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."