binutils-gdb/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
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
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
widewide
aliased_array.exp
array_bounds.exp * gdb.ada/array_bounds.exp: Get breakpoint for line 2012-03-08 22:19:48 +00:00
array_return.exp
array_subscript_addr.exp
arrayidx.exp gdb/testsuite/ 2012-03-03 18:03:31 +00:00
arrayparam.exp
arrayptr.exp
assign_1.exp
atomic_enum.exp
bad-task-bp-keyword.exp stop parsing breakpoint command if invalid keyword found 2012-06-05 13:50:13 +00:00
boolean_expr.exp
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
catch_ex.exp
char_enum.exp
char_param.exp
complete.exp
cond_lang.exp
dyn_loc.exp
enum_idx_packed.exp [Ada] print packed arrays indexed by enumerated type 2012-02-29 19:34:40 +00:00
exec_changed.exp
exprs.exp
fixed_cmp.exp
fixed_points.exp
formatted_ref.exp
frame_args.exp
fullname_bp.exp
fun_addr.exp PR exp/13907: 2012-05-18 15:31:42 +00:00
fun_in_declare.exp
funcall_param.exp
gnat_ada.gpr
homonym.exp
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
interface.exp
lang_switch.exp
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
mod_from_name.exp
nested.exp
null_array.exp
null_record.exp
operator_bp.exp * gdb.ada/operator_bp.exp: Clear debug-file-directory. 2012-03-05 21:21:13 +00:00
packed_array.exp
packed_tagged.exp
print_chars.exp
print_pc.exp
ptr_typedef.exp
ptype_arith_binop.exp
ptype_field.exp
ptype_tagged_param.exp
rec_return.exp
ref_param.exp
ref_tick_size.exp
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
str_ref_cmp.exp
sym_print_name.exp
taft_type.exp
tagged_not_init.exp [Ada] avoid error message pollution with uninitialized tagged variable 2012-02-29 19:46:48 +00:00
tagged.exp
task_bp.exp
tasks.exp
tick_last_segv.exp
type_coercion.exp
uninitialized_vars.exp
variant_record_packed_array.exp
watch_arg.exp
whatis_array_val.exp
widewide.exp