public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: gdb-patches@sourceware.org,
		Francois Bedard <Francois.Bedard@synopsys.com>
Subject: Re: [PATCH 2/3] arc: Add evaluation of long jump targets
Date: Tue, 11 Oct 2016 16:22:00 -0000	[thread overview]
Message-ID: <8660oyamac.fsf@gmail.com> (raw)
In-Reply-To: <1475843870-11449-2-git-send-email-Anton.Kolesov@synopsys.com>	(Anton Kolesov's message of "Fri, 7 Oct 2016 15:37:49 +0300")

Anton Kolesov <Anton.Kolesov@synopsys.com> writes:

> Standard get_longjmp_target implementation, similar to what is in arm-tdep.c.
> Actual value of jb_pc should be set in init_osabi methods of particular OS/ABI
> implementations.
>

Patch is good to me, two nits below,

> gdb/ChangeLog:
>
> 	* arc-tdep.h (gdbarch_tdep): Add jb_pc.

        * arc-tdep.h (struct gdbarch_tdep) <jb_pc>: New field.

> 	* arc-tdep.c (arc_get_longjmp_target): New function.
> 	(arc_gdbarch_init): Set get_longjmp_target if jb_pc is non-negative.
> 	(arc_dump_tdep): Print jb_pc.
> ---
>  gdb/arc-tdep.c | 36 +++++++++++++++++++++++++++++++++++-
>  gdb/arc-tdep.h |  3 +++
>  2 files changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
> index 58de8e9..bc8bb98 100644
> --- a/gdb/arc-tdep.c
> +++ b/gdb/arc-tdep.c
> @@ -557,6 +557,34 @@ arc_store_return_value (struct gdbarch *gdbarch, struct type *type,
>      error (_("arc_store_return_value: type length too large."));
>  }
>  
> +/* Implement the "get_longjmp_target" gdbarch method.
> +
> +   Detemine the address the longjmp will jump to.  We need to use the frame
> +   info to get the register pointing to the jmp_buf, then extract the PC from
> +   that.  Since jmp_buf is the first argument to longjmp () it will be in r0.
> +   Where we then go depends on the OS - OS/ABI initialization should set offset
> +   from jmp_buf start to the stored PC location.  */
> +

I don't see any extra information these comments have, so the first
sentence is enough, IMO.

/* Implement the "get_longjmp_target" gdbarch method.  */

> +static int
> +arc_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
> +{


-- 
Yao (齐尧)

  reply	other threads:[~2016-10-11 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 12:38 [PATCH 1/3] arc: Add a gdbarch_tdep structure Anton Kolesov
2016-10-07 12:38 ` [PATCH 3/3] arc: Add support for Newlib Anton Kolesov
2016-10-11 14:14   ` Yao Qi
2016-10-11 15:36     ` Anton Kolesov
2016-10-11 16:25   ` Yao Qi
2016-10-12 11:57     ` Anton Kolesov
2016-10-07 12:38 ` [PATCH 2/3] arc: Add evaluation of long jump targets Anton Kolesov
2016-10-11 16:22   ` Yao Qi [this message]
2016-10-11 16:16 ` [PATCH 1/3] arc: Add a gdbarch_tdep structure Yao Qi

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=8660oyamac.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=Anton.Kolesov@synopsys.com \
    --cc=Francois.Bedard@synopsys.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).