[PATCH] gdb/testsuite: make declare_labels use better default label names

Tom Tromey tom@tromey.com
Fri Dec 4 19:46:43 GMT 2020


>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> When using the single-element form of argument to declare_labels, the
Simon> generated label (in the assembly file) is of the format ".LlabelN",
Simon> where N is a number.

Simon> I propose making it use the name of the label by default.  Calling:

Simon>     declare_labels foo

Simon> will generate the ".LfooN" in the assembly file (again, where N is a
Simon> number).

Seems like a good idea to me.

Simon> Also, when defining the same label
Simon> twice by mistake in the Tcl code (like I d id)

Can we make this a Tcl error at the point of redefinition?
For example declare_labels and define_label could use a new
namespace-local array to track when labels are declared and when they
are defined, to prevent non-declaration (if that is needed, I forget)
and redefinition.

Simon> gdb/testsuite/ChangeLog:

Simon> 	* lib/dwarf.exp (declare_labels): Use name as text if text is
Simon> 	not provided.

Looks good.

Tom


More information about the Gdb-patches mailing list