Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Shahab Vahedi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Shahab Vahedi <shahab.vahedi@gmail.com>,
	Shahab Vahedi <shahab@synopsys.com>,
	Francois Bedard <fbedard@synopsys.com>
Subject: Re: [PATCH] arc: Write correct "eret" value during register collection
Date: Thu, 12 Nov 2020 07:36:42 -0700	[thread overview]
Message-ID: <871rgyfxqd.fsf@tromey.com> (raw)
In-Reply-To: <20201112134310.8544-1-shahab.vahedi@gmail.com> (Shahab Vahedi via Gdb-patches's message of "Thu, 12 Nov 2020 14:43:10 +0100")

>>>>> "Shahab" == Shahab Vahedi via Gdb-patches <gdb-patches@sourceware.org> writes:

Shahab> 	* arc-linux-tdep.c (collect_register): Use "eret" value while
Shahab> 	still writing to "pc" register cache.

Shahab>  collect_register (const struct regcache *regcache, struct gdbarch *gdbarch,
Shahab>  		  int regnum, gdb_byte *buf)
Shahab>  {
Shahab> +  int offset;
Shahab> +
Shahab>    /* Skip non-existing registers.  */
Shahab> -  if ((arc_linux_core_reg_offsets[regnum] == ARC_OFFSET_NO_REGISTER))
Shahab> +  if (arc_linux_core_reg_offsets[regnum] == ARC_OFFSET_NO_REGISTER)
Shahab>      return;
Shahab> +  else
Shahab> +    offset = arc_linux_core_reg_offsets[ARC_ERET_REGNUM];

I would drop the "else" here.

I didn't understand this patch.  It unconditionally sets 'offset' to the
offset of ARC_ERET_REGNUM.  But surely that can't be correct?
The assignment above does this, and so does...

Shahab>    if (regnum == gdbarch_pc_regnum (gdbarch))
Shahab> -    regnum = ARC_ERET_REGNUM;
Shahab> -  regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]);
Shahab> +    offset = arc_linux_core_reg_offsets[ARC_ERET_REGNUM];

... this one.

Tom

  reply	other threads:[~2020-11-12 14:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 13:43 Shahab Vahedi via Gdb-patches
2020-11-12 14:36 ` Tom Tromey [this message]
2020-11-12 15:46   ` Shahab Vahedi via Gdb-patches
2020-11-12 15:42 ` [PATCH v2] " Shahab Vahedi via Gdb-patches
2020-11-12 15:43   ` Tom Tromey
2020-11-12 16:05 ` [PUSHED] " Shahab Vahedi via Gdb-patches
2020-12-04 10:57 ` [PUSHED gdb-10-branch] " Shahab Vahedi via Gdb-patches
2020-12-04 14:10   ` Joel Brobecker
2020-12-04 14:44     ` Shahab Vahedi via Gdb-patches
2020-12-04 14:53       ` Joel Brobecker
2020-12-04 15:38         ` Shahab Vahedi via Gdb-patches
2020-12-05  8:12           ` Joel Brobecker

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=871rgyfxqd.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=fbedard@synopsys.com \
    --cc=gdb-patches@sourceware.org \
    --cc=shahab.vahedi@gmail.com \
    --cc=shahab@synopsys.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