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: [PATCH v2 2/5] Further cleanup/modernization of gdb.base/commands.exp


On 2016-11-09 10:59, Pedro Alves wrote:
And I'm wondering whether this below as well would be a good idea,
or whether it'd obfuscate?  If a good idea, maybe we'd put the new
variable in gdb.exp.

...

@@ -45,7 +50,7 @@ proc_with_prefix gdbvar_simple_if_test {} {
 	     "else" \
 	     "  p/x 0xdeadbeef" \
 	     "end"] \
-	"\\\$\[0-9\]* = 0xdeadbeef" \
+	"$valnum_re = 0xdeadbeef" \
 	"#1"


That's not bad. I was going to suggest using {} instead of "" to get rid of most backslashes (untested):

-"\\\$\[0-9\]* = 0xdeadbeef"
+{\$[0-9]* = 0xdeadbeef}

but with the variable it looks good as well.


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