old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker ccab2054e9 stop parsing breakpoint command if invalid keyword found
With an Ada program, trying to break on a specific Ada task, but
with the wrong capitalization of the `task' keyword, we currently
get only pieces of the "garbage" that caused the error:

    (gdb) b *rendez_vous'address TASK 2
    Garbage 2 at end of command

Pushing this a little further:

    (gdb) b *rendez_vous'address TASK Task TaSK 2
    Garbage 2 at end of command

Another interesting failure mode:

    (gdb) b *rendez_vous'address TASK if
    Argument required (expression to compute).

The parser skipped `TASK', then found the `if' keyword, and thus
started looking for a condition.

This patch fixes the problem by aborting the parsing as soon as
an invalid keyword is found.  This makes it consistent with the
case where the REST parameter is passed as NULL (where an error
is raised immediately after seeing the first invalid keyword).

It also introduces a new testcase that reproduces all above scenarios.

gdb/ChangeLog:

        * breakpoint.c (find_condition_and_thread): Stop parsing
        as soon as the first invalid keyword is found.

gdb/testsuite/ChangeLog:

        * gdb.ada/bad-task-bp-keyword: New testcase.
2012-06-05 13:50:13 +00:00
..
aliased_array [Ada] Handle reference to array descriptors 2012-02-29 19:33:02 +00:00
array_bounds Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
array_return Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
array_subscript_addr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
arrayidx Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
arrayparam Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
arrayptr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
atomic_enum Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
bad-task-bp-keyword stop parsing breakpoint command if invalid keyword found 2012-06-05 13:50:13 +00:00
bp_enum_homonym New Ada testcase (bp_enum_homonym). 2012-03-06 17:04:59 +00:00
bp_on_var New Ada testcase (bp_on_var.exp). 2012-03-06 17:33:32 +00:00
bp_range_type testcase for "gdb-ax.c: Add handling of TYPE_CODE_RANGE types" 2012-03-14 01:38:51 +00:00
call_pn Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
catch_ex Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
char_enum Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
char_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
complete Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
cond_lang Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
dyn_loc Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
enum_idx_packed [Ada] print packed arrays indexed by enumerated type 2012-02-29 19:34:40 +00:00
exec_changed Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
exprs Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fixed_cmp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fixed_points Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
formatted_ref Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
frame_args Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fullname_bp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fun_addr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fun_in_declare Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
funcall_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
homonym Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
info_locals_renaming Testcase: "info locals" with Ada renamings. 2012-03-02 19:31:53 +00:00
int_deref Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
interface Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
lang_switch Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mi_catch_ex Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mi_task_arg GDB/MI: crash printing "_task" (Ada) argument 2012-02-03 07:32:40 +00:00
mi_task_info Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mod_from_name Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
nested Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
null_array Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
null_record Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
operator_bp New Ada testcase for breakpoints on operators. 2012-03-02 20:36:41 +00:00
packed_array Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
packed_tagged Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
print_chars Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptr_typedef Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptype_field Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptype_tagged_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
rec_return Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ref_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ref_tick_size Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
same_enum Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
set_pckd_arr_elt [Ada] Crash when trying to set value of packed array element 2012-03-16 17:55:45 +00:00
small_reg_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
start Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
str_ref_cmp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
sym_print_name Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
taft_type Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tagged Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tagged_not_init [Ada] avoid error message pollution with uninitialized tagged variable 2012-02-29 19:46:48 +00:00
task_bp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tasks Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tick_last_segv Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
type_coercion Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
uninitialized_vars Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
variant_record_packed_array Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
watch_arg Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
whatis_array_val [Ada] whatis not printing array type name for value from history 2012-02-29 19:29:12 +00:00
widewide Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
aliased_array.exp [Ada] Handle reference to array descriptors 2012-02-29 19:33:02 +00:00
array_bounds.exp * gdb.ada/array_bounds.exp: Get breakpoint for line 2012-03-08 22:19:48 +00:00
array_return.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
array_subscript_addr.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
arrayidx.exp gdb/testsuite/ 2012-03-03 18:03:31 +00:00
arrayparam.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
arrayptr.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
assign_1.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
atomic_enum.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
bad-task-bp-keyword.exp stop parsing breakpoint command if invalid keyword found 2012-06-05 13:50:13 +00:00
boolean_expr.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
bp_enum_homonym.exp New Ada testcase (bp_enum_homonym). 2012-03-06 17:04:59 +00:00
bp_on_var.exp New Ada testcase (bp_on_var.exp). 2012-03-06 17:33:32 +00:00
bp_range_type.exp testcase for "gdb-ax.c: Add handling of TYPE_CODE_RANGE types" 2012-03-14 01:38:51 +00:00
call_pn.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
catch_ex.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
char_enum.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
char_param.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
complete.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
cond_lang.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
dyn_loc.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
enum_idx_packed.exp [Ada] print packed arrays indexed by enumerated type 2012-02-29 19:34:40 +00:00
exec_changed.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
exprs.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
fixed_cmp.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
fixed_points.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
formatted_ref.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
frame_args.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
fullname_bp.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fun_addr.exp PR exp/13907: 2012-05-18 15:31:42 +00:00
fun_in_declare.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
funcall_param.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
gnat_ada.gpr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
homonym.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
info_locals_renaming.exp Testcase: "info locals" with Ada renamings. 2012-03-02 19:31:53 +00:00
info_types.c Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
info_types.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
int_deref.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
interface.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
lang_switch.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
mi_catch_ex.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mi_task_arg.exp * gdb.ada/operator_bp.exp: Clear debug-file-directory. 2012-03-05 21:21:13 +00:00
mi_task_info.exp 2012-01-18 Pedro Alves <palves@redhat.com> 2012-01-18 17:00:17 +00:00
mod_from_name.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
nested.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
null_array.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
null_record.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
operator_bp.exp * gdb.ada/operator_bp.exp: Clear debug-file-directory. 2012-03-05 21:21:13 +00:00
packed_array.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
packed_tagged.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
print_chars.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
print_pc.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
ptr_typedef.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptype_arith_binop.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
ptype_field.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
ptype_tagged_param.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
rec_return.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
ref_param.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
ref_tick_size.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
same_enum.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
set_pckd_arr_elt.exp [Ada] Crash when trying to set value of packed array element 2012-03-16 17:55:45 +00:00
small_reg_param.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
start.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
str_ref_cmp.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
sym_print_name.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
taft_type.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
tagged.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
tagged_not_init.exp [Ada] avoid error message pollution with uninitialized tagged variable 2012-02-29 19:46:48 +00:00
task_bp.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tasks.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
tick_last_segv.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
type_coercion.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
uninitialized_vars.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
variant_record_packed_array.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
watch_arg.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
whatis_array_val.exp [Ada] whatis not printing array type name for value from history 2012-02-29 19:29:12 +00:00
widewide.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00