[PATCH 1/2] [gdb/testsuite] Add proc _location_no_split

Tom Tromey tom@tromey.com
Mon Sep 23 18:57:31 GMT 2024


>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> Proc _location splits its first argument into a list of lines.
Tom> That approach is somewhat cumbersome when using it recursively.

Tom> Add a variant _location_no_split that treats its first argument as a list of
Tom> lines.

This is also kind of cumbersome though as it leads to weird-looking
"double quoted" code.

I think a more Tcl-ish approach would be to split by lines, and then
reassemble lines by reading until "info complete" reports a complete
line.

There's a FIXME to this effect just before the proc... I just didn't do
this since I was feeling lazy & didn't need it.

Then your test:

+		    { DW_AT_location {
+			DW_OP_entry_value { {DW_OP_bregx $::dwarf_regnum 0} {DW_OP_deref_size 4 } }
+			DW_OP_stack_value
+		    } SPECIAL_expr }

could be written as

    DW_OP_entry_value {
      DW_OP_bregx $::dwarf_regnum 0
      DW_OP_deref_size 4
    }

... and I think this would work fine.

thanks,
Tom


More information about the Gdb-patches mailing list