Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: yao@codesourcery.com (Yao Qi)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc, arm] Always use correct execution state for single-step breakpoints
Date: Mon, 28 Mar 2011 14:37:00 -0000	[thread overview]
Message-ID: <201103281315.p2SDFg3F004550@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <4D8FE64E.3030409@codesourcery.com> from "Yao Qi" at Mar 28, 2011 09:37:18 AM

Yao Qi wrote:
> 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?

To ensure that the variable is always reset, even if
insert_single_step_breakpoint throws an exception.

> > +
> > +gdb_exit
> > +gdb_start
> > +gdb_reinitialize_dir $srcdir/$subdir
> > +gdb_load ${binfile}
> > +
> 
> `clean_restart' can do these four above.

Yes, I guess so ...  I was copying an old test case.

> > +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?

I don't really have a strong opinion on that, except that perror is
probably wrong (this is supposed to be uses to signal problems in
the test *framework* itself).  I'd say that if there is a reasonable
expectation that starting up the test may fail on some platforms,
a failure of runto_main ought to trigger something like UNTESTED
or UNSUPPORTED.  Otherwise it should trigger a FAIL.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2011-03-28 13:16 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
2011-03-28 14:37   ` Ulrich Weigand [this message]
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=201103281315.p2SDFg3F004550@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /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