Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Shahab Vahedi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Shahab Vahedi <shahab.vahedi@gmail.com>,
	Shahab Vahedi <shahab@synopsys.com>, Tom Tromey <tom@tromey.com>,
	Francois Bedard <fbedard@synopsys.com>
Subject: Re: [PUSHED gdb-10-branch] arc: Write correct "eret" value during register collection
Date: Fri, 4 Dec 2020 18:10:12 +0400	[thread overview]
Message-ID: <20201204141012.GA151412@adacore.com> (raw)
In-Reply-To: <20201204105714.12903-1-shahab.vahedi@gmail.com>

Hello Shahab,

> In collect_register() function of arc-linux-tdep.c, the "eret"
> (exception return) register value was not being reported correctly.
> This patch fixes that.
> 
> Background:
> When asked for the "pc" value, we have to update the "eret" register
> with GDB's STOP_PC.  The "eret" instructs the kernel code where to
> jump back when an instruction has stopped due to a breakpoint.  This
> is how collect_register() was doing so:
> 
> --------------8<--------------
>   if (regnum == gdbarch_pc_regnum (gdbarch))
>     regnum = ARC_ERET_REGNUM;
>   regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]);
> -------------->8--------------
> 
> Root cause:
> Although this is using the correct offset (ERET register's), it is also
> changing the REGNUM itself.  Therefore, raw_collect (regnum, ...) is
> not reading from "pc" anymore.
> 
> v2:
> - Fix a copy/paste issue as rightfully addressed by Tom [1].
> 
> [1]
> https://sourceware.org/pipermail/gdb-patches/2020-November/173208.html
> 
> gdb/ChangeLog:
> 
> 	* arc-linux-tdep.c (collect_register): Populate "eret" by
> 	"pc" value from the regcache when asked for "pc" value.

Once the first release off a branch is made (GDB 10.1 in this case),
we ask that all changes pushed to the branch for the corrective
release have a PR attached to the change, with details of the problem
being solved.

This is because we use the PRs to create a list of the fixes that
were made in the corrective release, and the PRs are a link to
more information for those who might be interested in them.

Would you mind doing the following please?

  - Create a PR for it? For the description of the problem, I think
    the commit message above is fine. But if you have additional
    information you can share, please do so ;-).

  - Set the PR's target milestone to GDB 10.2.

  - Once you have the PR created, please add a note to the PR
    indicating the commits that were pushed to both master and
    the gdb-10-branch, just keep have an easy track record of
    which commits solved that PR.

    Typically, I would post something like this:

        This PR was solved on master with this commit:

        | commit 10c19fadfd45da5262d2f8b9624be71c274ff15d
        | Author: Shahab Vahedi <shahab@synopsys.com>
        | Date:   Thu Nov 12 12:50:33 2020 +0100
        | Subject: arc: Write correct "eret" value during register collection

        The patch above was also pushed to gdb-10-branch as:

        | commit abaf3df98b69d66c779ff0896d66fea9cbb67481
        | Author: Shahab Vahedi <shahab@synopsys.com>
        | Date:   Thu Nov 12 12:50:33 2020 +0100
        | Subject: arc: Write correct "eret" value during register collection

  - Update the ChangeLog entry on both master and gdb-10-branch
    to include the PR number. E.g.

        | 2020-11-29  Hannes Domani  <ssbssa@yahoo.de>
        |
 !!! -> |     PR tui/26973
        |     * tui/tui-layout.c (tui_apply_current_layout): Don't delete the
        |     static locator win info.

  - Once the above is done, I believe you can close the PR as
    RESOVED/FIXED.

Thank you!

-- 
Joel

  reply	other threads:[~2020-12-04 14:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 13:43 [PATCH] " Shahab Vahedi via Gdb-patches
2020-11-12 14:36 ` Tom Tromey
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 [this message]
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=20201204141012.GA151412@adacore.com \
    --to=brobecker@adacore.com \
    --cc=fbedard@synopsys.com \
    --cc=gdb-patches@sourceware.org \
    --cc=shahab.vahedi@gmail.com \
    --cc=shahab@synopsys.com \
    --cc=tom@tromey.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