From: "Marcin Kościelnicki" <m.koscielnicki@mimuw.edu.pl>
To: Wei-cheng Wang <cole945@gmail.com>,
uweigand@de.ibm.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 6/7 v3] Build unavailable-stack frames for tracepoint.
Date: Mon, 22 Feb 2016 05:28:00 -0000 [thread overview]
Message-ID: <56CA9C90.9000706@mimuw.edu.pl> (raw)
In-Reply-To: <1427733032-64989-6-git-send-email-cole945@gmail.com>
Hey, what about this patch? Seems it got approval before. I've just
applied it on top of master and tested - no regressions on ppc, ppc64,
ppc64le, and indeed fixes gdb.trace tests for all 3 if I enable
tracepoints. OK if I push it?
On 30/03/15 18:30, Wei-cheng Wang wrote:
> gdb/ChangeLog
>
> 2015-03-30 Wei-cheng Wang <cole945@gmail.com>
>
> * rs6000-tdep.c (rs6000_frame_cache, rs6000_frame_this_id): Handle
> unavailable PC/SP to build unavailable frame.
> ---
> gdb/rs6000-tdep.c | 53 ++++++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 40 insertions(+), 13 deletions(-)
>
> diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
> index 68e22b3..7436073 100644
> --- a/gdb/rs6000-tdep.c
> +++ b/gdb/rs6000-tdep.c
> @@ -3152,6 +3152,13 @@ struct rs6000_frame_cache
> CORE_ADDR base;
> CORE_ADDR initial_sp;
> struct trad_frame_saved_reg *saved_regs;
> +
> + /* Set BASE_P to true if this frame cache is properly initialized.
> + Otherwise set to false because some registers or memory cannot
> + collected. */
> + int base_p;
> + /* Cache PC for building unavailable frame. */
> + CORE_ADDR pc;
> };
>
> static struct rs6000_frame_cache *
> @@ -3169,21 +3176,33 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
> return (*this_cache);
> cache = FRAME_OBSTACK_ZALLOC (struct rs6000_frame_cache);
> (*this_cache) = cache;
> + cache->pc = 0;
> cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
>
> - func = get_frame_func (this_frame);
> - pc = get_frame_pc (this_frame);
> - skip_prologue (gdbarch, func, pc, &fdata);
> -
> - /* Figure out the parent's stack pointer. */
> -
> - /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most
> - address of the current frame. Things might be easier if the
> - ->frame pointed to the outer-most address of the frame. In
> - the mean time, the address of the prev frame is used as the
> - base address of this frame. */
> - cache->base = get_frame_register_unsigned
> - (this_frame, gdbarch_sp_regnum (gdbarch));
> + TRY
> + {
> + func = get_frame_func (this_frame);
> + cache->pc = func;
> + pc = get_frame_pc (this_frame);
> + skip_prologue (gdbarch, func, pc, &fdata);
> +
> + /* Figure out the parent's stack pointer. */
> +
> + /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most
> + address of the current frame. Things might be easier if the
> + ->frame pointed to the outer-most address of the frame. In
> + the mean time, the address of the prev frame is used as the
> + base address of this frame. */
> + cache->base = get_frame_register_unsigned
> + (this_frame, gdbarch_sp_regnum (gdbarch));
> + }
> + CATCH (ex, RETURN_MASK_ERROR)
> + {
> + if (ex.error != NOT_AVAILABLE_ERROR)
> + throw_exception (ex);
> + return (*this_cache);
> + }
> + END_CATCH
>
> /* If the function appears to be frameless, check a couple of likely
> indicators that we have simply failed to find the frame setup.
> @@ -3332,6 +3351,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
> cache->initial_sp
> = get_frame_register_unsigned (this_frame, fdata.alloca_reg);
>
> + cache->base_p = 1;
> return cache;
> }
>
> @@ -3341,6 +3361,13 @@ rs6000_frame_this_id (struct frame_info *this_frame, void **this_cache,
> {
> struct rs6000_frame_cache *info = rs6000_frame_cache (this_frame,
> this_cache);
> +
> + if (!info->base_p)
> + {
> + (*this_id) = frame_id_build_unavailable_stack (info->pc);
> + return;
> + }
> +
> /* This marks the outermost frame. */
> if (info->base == 0)
> return;
>
next prev parent reply other threads:[~2016-02-22 5:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 16:31 [PATCH 1/7 v3] powerpc: Support z-point type in gdbserver Wei-cheng Wang
2015-03-30 16:31 ` [PATCH 7/7 v3] Remove tracepoint_action ops Wei-cheng Wang
2015-04-08 17:09 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 3/7 v3] Add testcases for ppc64 tracepoint Wei-cheng Wang
2015-04-08 17:02 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 4/7 v3] Allow target to decide where to map jump-pad Wei-cheng Wang
2015-04-08 17:04 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 6/7 v3] Build unavailable-stack frames for tracepoint Wei-cheng Wang
2015-04-08 17:07 ` Ulrich Weigand
2016-02-22 5:28 ` Marcin Kościelnicki [this message]
2016-02-23 18:58 ` Ulrich Weigand
2016-02-24 3:18 ` Marcin Kościelnicki
2016-02-24 20:44 ` Sergio Durigan Junior
2016-02-24 21:06 ` [PATCH] [OBV] gdb/rs6000: Fix maybe-uninitialized warning Marcin Kościelnicki
2015-03-30 16:31 ` [PATCH 2/7 v3] Tracepoint for ppc64 Wei-cheng Wang
2015-04-08 16:57 ` Ulrich Weigand
2015-06-27 17:48 ` Wei-cheng Wang
2015-07-03 16:42 ` Ulrich Weigand
2015-03-30 16:31 ` [PATCH 5/7 v3] Replace write_inferior_data_ptr with write_inferior_data_pointer Wei-cheng Wang
2015-04-08 17:06 ` Ulrich Weigand
2015-04-08 16:56 ` [PATCH 1/7 v3] powerpc: Support z-point type in gdbserver 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=56CA9C90.9000706@mimuw.edu.pl \
--to=m.koscielnicki@mimuw.edu.pl \
--cc=cole945@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).