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
array_return
array_subscript_addr
arrayidx
arrayparam
arrayptr
atomic_enum
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
catch_ex
char_enum
char_param
complete
cond_lang
dyn_loc
enum_idx_packed [Ada] print packed arrays indexed by enumerated type 2012-02-29 19:34:40 +00:00
exec_changed
exprs
fixed_cmp
fixed_points
formatted_ref
frame_args
fullname_bp
fun_addr
fun_in_declare
funcall_param
homonym
info_locals_renaming Testcase: "info locals" with Ada renamings. 2012-03-02 19:31:53 +00:00
int_deref
interface
lang_switch
mi_catch_ex
mi_task_arg GDB/MI: crash printing "_task" (Ada) argument 2012-02-03 07:32:40 +00:00
mi_task_info
mod_from_name
nested
null_array
null_record
operator_bp New Ada testcase for breakpoints on operators. 2012-03-02 20:36:41 +00:00
packed_array
packed_tagged
print_chars
ptr_typedef
ptype_field
ptype_tagged_param
rec_return
ref_param
ref_tick_size
same_enum
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
start
str_ref_cmp
sym_print_name
taft_type
tagged
tagged_not_init [Ada] avoid error message pollution with uninitialized tagged variable 2012-02-29 19:46:48 +00:00
task_bp
tasks
tick_last_segv
type_coercion
uninitialized_vars
variant_record_packed_array
watch_arg
whatis_array_val [Ada] whatis not printing array type name for value from history 2012-02-29 19:29:12 +00:00
widewide
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
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
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
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
info_types.exp
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
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
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
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
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
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