binutils-gdb/gdb/testsuite/gdb.multi
Pedro Alves b9a3f8429b Fix TID parser bug
I noticed this inconsistency in the error messages below:

 (gdb) print --1
 Left operand of assignment is not an lvalue.

 (gdb) thread apply 1 print --1

 Thread 1 (Thread 0x7ffff7fb6740 (LWP 17805)):
 inverted range

The "inverted range" error happens because get_number_trailer returns
0 to indicate error, but number_or_range_parser::get_number is not
checking for that.  I tried detected the error there, but that doesn't
work because number_of_range_parser is used in places that _do_ want
to legitimately handle 0.  IMO we should fix get_number_trailer's
interface or use something else when we want to parse 0 too.

I've decided to fix it in a different way, similarly to how
number_or_range_parser::finished was changed in commit 529c08b25e
("Add helper functions parse_flags and parse_flags_qcs").

Seems like a good change, even if we tweaked
number_or_range_parser::get_number, as it simplifies
thread_apply_command and makes them consistent with
number_or_range_parser::finished().

We now get the same error message in both cases:

 (gdb) print --1
 Left operand of assignment is not an lvalue.

 (gdb) thread apply 1 print --1

 Thread 1 (Thread 0x7ffff7fb6740 (LWP 17805)):
 Left operand of assignment is not an lvalue.

gdb/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

	* thread.c (thread_apply_command): Adjust TID parsing.
	* tid-parse.c (tid_range_parser::finished): Ensure parsing end is
	detected before end of string.
	(tid_is_in_list): Error out if LIST is invalid.

gdb/testsuite/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

	* gdb.multi/tids.exp: Adjust expected output.  Add "thread apply 1
	foo --1" test.
2019-06-13 00:08:09 +01:00
..
base.exp
bkpt-multi-exec.c
bkpt-multi-exec.exp
crashme.c
dummy-frame-restore.c
dummy-frame-restore.exp
goodbye.c
hangout.c
hello.c Fix gdb.multi/multi-arch-exec.exp blocking under high load/slow gdb 2019-03-28 21:15:20 +01:00
info-threads.exp
multi-arch-exec.c
multi-arch-exec.exp
multi-arch.exp
multi-attach.c
multi-attach.exp
multi-term-settings.c Fix gdb.multi/multi-term-settings.exp blocking under high load/slow gdb 2019-03-28 21:15:59 +01:00
multi-term-settings.exp
remove-inferiors.c
remove-inferiors.exp [gdb/testsuite] Fix remove-inferiors.exp FAIL with readnow board 2019-06-11 13:54:10 +02:00
tids.c
tids.exp Fix TID parser bug 2019-06-13 00:08:09 +01:00
watchpoint-multi-exit.c
watchpoint-multi-exit.exp
watchpoint-multi.c
watchpoint-multi.exp