aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.rust/methods.rs
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-08-12 10:33:00 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-08-12 10:33:00 +0200
commitc2c2dd9f09130fcdfc6bee999705206644f1f17f (patch)
treec92ff934e45bcb664a7196dc6af81aedbc68a727 /gdb/testsuite/gdb.rust/methods.rs
parent483767a333faed7ac25783459c0c9b0be4800932 (diff)
downloadgdb-c2c2dd9f09130fcdfc6bee999705206644f1f17f.zip
gdb-c2c2dd9f09130fcdfc6bee999705206644f1f17f.tar.gz
gdb-c2c2dd9f09130fcdfc6bee999705206644f1f17f.tar.bz2
testsuite: Exclude end-of-line characters from get_valueof result
The get_valueof procedure allows tests to conveniently make gdb evaluate an expression an return the value as a string. However, it includes an end-of-line character in its result. I stumbled on this when trying to use that result as part of a regex further in a test. You can see this for example by adding a puts in gdb.dwarf2/implref-struct.exp:get_members: set members [get_valueof "" ${var} ""] puts "<$members>" The output is <{a = 0, b = 1, c = 2} > This is because the regex in get_valueof is too greedy, the captured portion matches anything up to the gdb_prompt, including the end of line characters. This patch changes it to capture everything but end of line characters. The output of the puts becomes: <{a = 0, b = 1, c = 2}> I tested this by running gdb.dwarf2/implref-array.exp and gdb.dwarf2/implref-struct.exp, the two only current users of that procedure. gdb/testsuite/ChangeLog: * lib/gdb.exp (get_valueof): Don't capture end-of-line characters.
Diffstat (limited to 'gdb/testsuite/gdb.rust/methods.rs')
0 files changed, 0 insertions, 0 deletions