public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/27015] New: ARC: "eret" value is collected from the wrong data in register cache
@ 2020-12-04 15:04 shahab.vahedi at gmail dot com
  2020-12-04 15:08 ` [Bug tdep/27015] " shahab.vahedi at gmail dot com
                   ` (48 more replies)
  0 siblings, 49 replies; 50+ messages in thread
From: shahab.vahedi at gmail dot com @ 2020-12-04 15:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27015

            Bug ID: 27015
           Summary: ARC: "eret" value is collected from the wrong data in
                    register cache
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: shahab.vahedi at gmail dot com
  Target Milestone: ---

Versions affected: HEAD and 10.1

--------------------------------

In collect_register() function of arc-linux-tdep.c, the "eret"
(exception return) register value is not being reported correctly.

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() is 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.

Consequence:
This bug affects the "native ARC gdb" badly and causes kernel code to jump
to addresses after the breakpoint and not executing the "breakpoint"ed
instructions at all.  That "native ARC gdb" feature is not upstream yet and
is in review at the time of writing [1].

[1] Add native GNU/Linux support for ARC in GDB
https://sourceware.org/pipermail/gdb-patches/2020-November/173203.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2023-07-14 21:43 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 15:04 [Bug tdep/27015] New: ARC: "eret" value is collected from the wrong data in register cache shahab.vahedi at gmail dot com
2020-12-04 15:08 ` [Bug tdep/27015] " shahab.vahedi at gmail dot com
2020-12-04 15:10 ` tromey at sourceware dot org
2020-12-04 15:15 ` shahab.vahedi at gmail dot com
2021-06-27 17:52 ` ahmedsayeed1982 at yahoo dot com
2021-07-13  3:12 ` sherrixotyv29 at gmail dot com
2021-07-13  4:59 ` simark at simark dot ca
2021-08-09  9:35 ` phillipsaeverett84 at gmail dot com
2021-08-10 11:44 ` ucelsanicin at yahoo dot com
2021-08-20 15:56 ` kingjamescarl at gmail dot com
2021-08-20 15:56 ` kingjamescarl at gmail dot com
2021-08-20 16:05 ` mark at klomp dot org
2021-08-23  5:22 ` specification166din at gmail dot com
2021-09-02 11:06 ` donipah907 at mtlcz dot com
2021-09-05  7:36 ` kimolsun2020 at yahoo dot com
2021-09-06  9:08 ` focixujo at livinginsurance dot co.uk
2021-09-06  9:12 ` focixujo at livinginsurance dot co.uk
2021-09-10 19:36 ` mehmetgelisin at aol dot com
2021-09-14 12:54 ` jarilittlenen at yahoo dot com
2021-09-20  8:21 ` johnmartin1458 at gmail dot com
2021-09-20  8:22 ` johnmartin1458 at gmail dot com
2021-09-22  9:08 ` atifarif503 at gmail dot com
2021-09-22  9:08 ` atifarif503 at gmail dot com
2021-09-22 10:18 ` diheto5497 at secbuf dot com
2021-09-22 16:58 ` mervegunesli at aol dot com
2021-10-04  7:54 ` olivernicholle9052 at gmail dot com
2021-10-09 11:00 ` gulsenenginar at aol dot com
2021-10-09 17:51 ` svitvitraga at gmail dot com
2021-10-11  5:19 ` uzey67 at gmail dot com
2021-10-16  0:06 ` mikematic@privacy-mail.top
2021-10-18  8:09 ` pagefitzpatrick687 at gmail dot com
2021-10-18 19:58 ` ahmedsayeed1982 at hotmail dot com
2021-10-19  7:14 ` progonsaytu at gmail dot com
2021-10-19 13:34 ` bart@123-fietsen.nl
2021-10-19 13:49 ` peterverbaarschotrop at gmail dot com
2021-10-24 10:02 ` glassmtech at ukr dot net
2021-10-27  6:50 ` bathroomremodelrr at gmail dot com
2021-10-28  9:09 ` elpasotileinstallation at gmail dot com
2021-11-02  9:50 ` amosohxx90 at gmail dot com
2021-11-03  7:52 ` barronwbs85 at gmail dot com
2021-11-05  9:28 ` bertbxi85 at gmail dot com
2021-11-06 21:13 ` paneki8601 at dukeoo dot com
2021-11-08 11:49 ` richardsboyer67 at gmail dot com
2021-11-12 11:41 ` shannanalt11 at gmail dot com
2021-11-14 20:01 ` brickpavingcl at gmail dot com
2021-11-16 12:40 ` Uchemanuche at gmail dot com
2021-11-16 19:08 ` xecana8007 at funboxcn dot com
2021-11-16 19:15 ` xecana8007 at funboxcn dot com
2021-11-22 13:12 ` cheesecakesuperhuman at gmail dot com
2023-07-14 21:43 ` rleonard85 at gmail dot com

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).