public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/28527] New: [gdb/tdep] powerpc skip_prologue walks past system call
Date: Tue, 02 Nov 2021 09:05:40 +0000	[thread overview]
Message-ID: <bug-28527-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 28527
           Summary: [gdb/tdep] powerpc skip_prologue walks past system
                    call
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

[ As reported here:
https://sourceware.org/pipermail/gdb-patches/2021-October/182919.html ]

On powerpc64le-linux, I run into:
...
[Inferior 1 (process 5156) exited normally]^M
(gdb) FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: \
  detach: detach: continue to breakpoint: _exit (the program exited)
...

What happens is the following:
- a breakpoint is set on _exit,
- a continue is issued
- the continue is supposed to hit the breakpoint, but instead
  the program exits.

I traced this down to the breakpoint on _exit being set too far from function
entry.  This is caused by the skip_prologue function (in rs6000-tdep.c)
optimistically ignoring insns it doesn't recognize.  In particular, it walks
past the system call instruction "sc" which initiates the actual exit.

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

             reply	other threads:[~2021-11-02  9:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02  9:05 vries at gcc dot gnu.org [this message]
2021-11-02  9:19 ` [Bug tdep/28527] " vries at gcc dot gnu.org
2021-11-02 10:18 ` vries at gcc dot gnu.org
2021-11-02 10:20 ` vries at gcc dot gnu.org
2021-11-02 10:28 ` vries at gcc dot gnu.org
2021-11-02 11:33 ` vries at gcc dot gnu.org
2021-11-02 18:14 ` 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-28527-4717@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).