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] Cleanup: Use add_sal_to_sals for expressions


>>>>> "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


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