From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: tromey@redhat.com (Tom Tromey)
Cc: gdb-patches@sourceware.org, matthew.gretton-dann@arm.com,
patches@linaro.org
Subject: Re: [rfc, arm] Always use correct execution state for single-step breakpoints
Date: Fri, 25 Mar 2011 17:12:00 -0000 [thread overview]
Message-ID: <201103251623.p2PGNOEu007805@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <m3k4fnw5rl.fsf@fleche.redhat.com> from "Tom Tromey" at Mar 25, 2011 09:59:10 AM
Tom Tromey wrote:
> >>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
>
> Ulrich> This is done by means of a new global "arm_override_mode" which
> Ulrich> is respected in arm_pc_is_thumb unconditionally (similar to
> Ulrich> arm_force_mode_string),
>
> Ulrich> (The global is a bit ugly, but the concept still seems right to me:
> Ulrich> if at some point in the future, we actually do use two different
> Ulrich> gdbarch's to represent Thumb vs. ARM, the single-step routines would
> Ulrich> determine the proper gdbarch to set the breakpoint in and simply
> Ulrich> use insert_single_step_breakpoint with that arch.)
>
> I wonder whether such globals should actually be per-inferior?
> I really don't know whether it would be possible to get in trouble with
> this.
Well, the way the patch is using the global, there is no possibility
of any trouble (as long as GDB itself it not multi-threaded):
+ 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);
Note how the setting only remains in effect across the one call to
insert_single_step_breakpoint. The intent is basically to pass an
extra argument through to a routine called within the call chain
of that one function invocation.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2011-03-25 16:23 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 [this message]
2011-03-28 8:11 ` Yao Qi
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=201103251623.p2PGNOEu007805@d06av02.portsmouth.uk.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=matthew.gretton-dann@arm.com \
--cc=patches@linaro.org \
--cc=tromey@redhat.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