This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Cleanup: Use add_sal_to_sals for expressions
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gp \>\> \"gdb-patches\ at sourceware dot org ml\"" <gdb-patches at sourceware dot org>
- Date: Wed, 18 Jul 2012 10:34:52 -0600
- Subject: Re: [RFA] Cleanup: Use add_sal_to_sals for expressions
- References: <5005D93D.7020808@redhat.com>
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> This patch causes expressions to use add_sal_to_sals, which will then
Keith> set a canonical name for the linespec, thereby negating the need to
Keith> double-check for missing linespecs later (in decode_line_full).
Keith> @@ -842,6 +842,8 @@ add_sal_to_sals (struct linespec_state *self,
Keith> else
Keith> canonical_name = xstrprintf ("%s:%d", filename, sal->line);
Keith> }
Keith> + else if (symname != NULL)
Keith> + canonical_name = xstrdup (symname);
[...]
Keith> + sal = find_pc_line (ls->expr_pc, 0);
Keith> + sal.pc = ls->expr_pc;
Keith> + sal.section = find_pc_overlay (ls->expr_pc);
Keith> + sal.explicit_pc = 1;
Keith> + add_sal_to_sals (state, &sals, &sal, ls->expression);
It seems to me that find_pc_line can return a sal with symtab set;
search for "val.symtab = " in find_pc_sect_line. In this case it seems
that you'd wind up with the wrong canonical form.
Tom