Re: [rfc, arm] Always use correct execution state for single-step breakpoints

Yao Qi
2011-03-28T01:37:36Z

On 03/25/2011 02:31 AM, Ulrich Weigand wrote:
> +void
> +arm_insert_single_step_breakpoint (struct gdbarch *gdbarch,
> + struct address_space *aspace,
> + CORE_ADDR pc)
> +{
> + struct cleanup *old_chain
> + = make_cleanup_restore_integer (&arm_override_mode);
> +
> + arm_override_mode = IS_THUMB_ADDR (pc);
> + pc = gdbarch_addr_bits_remove (gdbarch, pc);
> +
> + insert_single_step_breakpoint (gdbarch, aspace, pc);
> +
> + do_cleanups (old_chain);
> +}
> +

I don't understand why we put make_cleanup_restore_integer/do_cleanups
in the same function. Can't we use a temp variable to save/restore the
value of arm_override_mode?

> +
> +gdb_exit
> +gdb_start
> +gdb_reinitialize_dir $srcdir/$subdir
> +gdb_load ${binfile}
> +

`clean_restart' can do these four above.

> +if ![runto_main] then {
> + gdb_suppress_tests
> +}

I am OK with part, but a question on general handling `failed to
runto_main'. I noticed there are some different policies to handle
that, such as `fail and return', `perror and return', and
'gdb_suppress_tests'. Which on is recommended?

--
Yao (é½å°§)