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] Restore original GDB prompt in define.exp



On 7/3/19 3:48 PM, Andreas Schwab wrote:
> On Jul 03 2019, Tom Tromey <tom@tromey.com> wrote:
> 
>>>>>>> "Richard" == Richard Bunt <Richard.Bunt@arm.com> writes:
>>
>> Richard> -gdb_test_multiple "set prompt \\(gdb\\) " "reset gdb_prompt" {
>> Richard> +gdb_test_multiple "set prompt $gdb_prompt " "reset gdb_prompt" {
>>
>> This is peculiar because both the original code and the new code have
>> backslashes in the "set" command -- gdb_prompt is actually a regexp, not
>> just a plain string.  But, it works anyhow, I guess something along the
>> way is ignoring the "\".
> 
> That's because it's a var_string, not a var_string_noescape.
> 
> Andreas.
> 

Thanks for the comments.

Based on these I would like to submit a v2 (when it's ready) which saves
the literal prompt from "show prompt" and restores from this.

I think this is a more robust solution as it will not break if someone is
indeed using $gdb_prompt with a more complex regular expression and
doesn't unnecessarily rely on the escape behavior of the GDB prompt.
Note: The test case which sets the prompt to \\(blah\\) still covers this
escaping behavior, but I see no need for the prompt restore test to rely
on it.

Many thanks,

Rich

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