public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/31278] [gdb/tdep, thumb2] GDB on arm-linux-gnueabihf fails gdb.reverse/func-map-to-same-line.exp
Date: Tue, 13 Feb 2024 08:10:47 +0000	[thread overview]
Message-ID: <bug-31278-4717-xVpshg3gIz@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31278-4717@http.sourceware.org/bugzilla/>

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

--- Comment #13 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e4208a3f5d60f43b4a8f02e583fa950b599cd00

commit 7e4208a3f5d60f43b4a8f02e583fa950b599cd00
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Feb 13 09:10:54 2024 +0100

    [gdb/tdep] Fix reverse execution of LDR(immediate) T4

    When running test-case gdb.reverse/func-map-to-same-line.exp on arm-linux
with
    target board unix/-mthumb, we run into:
    ...
    (gdb) reverse-step
    func2 () at func-map-to-same-line.c:26
    26      {
    (gdb) FAIL: gdb.reverse/func-map-to-same-line.exp: \
      column_info_flag=column-info: step-test: reverse-step into func2
    ...

    The FAIL is caused by incorrect recording of this insn:
    ...
    4f6:   f85d 7b04       ldr.w   r7, [sp], #4
    ...

    The insn updates the sp, but we don't record this:
    ...
    $ gdb -q -batch func-map-to-same-line \
      -ex "b *func2+8" \
      -ex run \
      -ex record \
      -ex "set debug record 2" \
      -ex stepi
    Breakpoint 1 at 0x4f6: file func-map-to-same-line.c, line 27.

    Breakpoint 1, 0xaaaaa4f6 in func2 () at func-map-to-same-line.c:27
    27      } /* END FUNC2 */
    Process record: arm_process_record addr = 0xaaaaa4f6
    Process record: add register num = 15 to record list.
    Process record: record_full_arch_list_add 0xabc6c460.
    Process record: add register num = 7 to record list.
    Process record: record_full_arch_list_add 0xabc3b868.
    Process record: add register num = 25 to record list.
    ...
    [ Note that sp is r13, and we see here only r15 (pc), r7, and r25 (ps). ]

    The problem is that the specific insn, an LDR(immediate) T4, is not handled
in
    thumb2_record_ld_word.

    Fix this by detecting the insn in thumb2_record_ld_word, and recording the
    updated base register.

    Tested on arm-linux.

    Reported-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
    Approved-By: Luis Machado <luis.machado@arm.com>

    PR tdep/31278
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31278

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

  parent reply	other threads:[~2024-02-13  8:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 23:11 [Bug tdep/31278] New: " thiago.bauermann at linaro dot org
2024-01-23 10:18 ` [Bug tdep/31278] " vries at gcc dot gnu.org
2024-01-24  3:07 ` thiago.bauermann at linaro dot org
2024-01-25 14:30 ` vries at gcc dot gnu.org
2024-02-08 14:24 ` luis.machado at arm dot com
2024-02-09 13:01 ` vries at gcc dot gnu.org
2024-02-09 16:19 ` vries at gcc dot gnu.org
2024-02-11 11:58 ` vries at gcc dot gnu.org
2024-02-11 12:19 ` [Bug tdep/31278] [gdb/tdep, thumb2] " vries at gcc dot gnu.org
2024-02-11 13:10 ` vries at gcc dot gnu.org
2024-02-12  9:39 ` luis.machado at arm dot com
2024-02-12 11:27 ` vries at gcc dot gnu.org
2024-02-12 12:03 ` luis.machado at arm dot com
2024-02-12 14:11 ` vries at gcc dot gnu.org
2024-02-13  8:10 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-13  8:13 ` vries at gcc dot gnu.org

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=bug-31278-4717-xVpshg3gIz@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).