Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: [rfc, arm] Always use correct execution state for single-step breakpoints
Date: Mon, 28 Mar 2011 08:11:00 -0000	[thread overview]
Message-ID: <4D8FE64E.3030409@codesourcery.com> (raw)
In-Reply-To: <201103241831.p2OIVfSm025531@d06av02.portsmouth.uk.ibm.com>

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 (齐尧)


  parent reply	other threads:[~2011-03-28  1:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 18:55 Ulrich Weigand
2011-03-25 16:19 ` Tom Tromey
2011-03-25 17:12   ` Ulrich Weigand
2011-03-28  8:11 ` Yao Qi [this message]
2011-03-28 14:37   ` Ulrich Weigand
2011-03-28 18:34     ` Joel Brobecker
2011-03-29 14:14       ` Ulrich Weigand
2011-03-29 16:24         ` Joel Brobecker
2011-03-29 18:40           ` Ulrich Weigand
2011-04-01 11:58 ` Ulrich Weigand
2011-04-01 15:24   ` Fix build (was: Re: [rfc, arm] Always use correct execution state for single-step breakpoints) Pedro Alves
2011-04-01 15:41     ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D8FE64E.3030409@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox