public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, Carl Love <cel@us.ibm.com>
Subject: [pushed] [gdb/testsuite] Fix gdb.guile/scm-symtab.exp for ppc64le
Date: Fri,  9 Dec 2022 10:42:37 +0100	[thread overview]
Message-ID: <20221209094237.3736-1-tdevries@suse.de> (raw)

On powerpc64le-linux, I run into:
...
(gdb) PASS: gdb.guile/scm-symtab.exp: step out of func2
guile (print (> (sal-line (find-pc-line (frame-pc (selected-frame)))) line))^M
= #f^M
(gdb) FAIL: gdb.guile/scm-symtab.exp: test find-pc-line with resume address
...

The problem is as follows: the instructions for the call to func2 are:
...
    1000070c:   39 00 00 48     bl      10000744 <func1>
    10000710:   00 00 00 60     nop
    10000714:   59 00 00 48     bl      1000076c <func2>
    10000718:   00 00 00 60     nop
    1000071c:   00 00 20 39     li      r9,0
...
and the corresponding line number info is:
...
scm-symtab.c:
File name     Line number    Starting address    View    Stmt
scm-symtab.c           42          0x1000070c               x
scm-symtab.c           43          0x10000714               x
scm-symtab.c           44          0x1000071c               x
...

The test-case looks at the line numbers for two insns:
- the insn of the call to func2 (0x10000714), and
- the insn after that (0x10000718),
and expects the line number of the latter to be greater than the line number
of the former.

However, both insns have the same line number: 43.

Fix this by replacing ">" with ">=".

Tested on x86_64-linux and powerpc64le-linux.
---
 gdb/testsuite/gdb.guile/scm-symtab.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.guile/scm-symtab.exp b/gdb/testsuite/gdb.guile/scm-symtab.exp
index 2ea13ff0d6c..4b8b59c42de 100644
--- a/gdb/testsuite/gdb.guile/scm-symtab.exp
+++ b/gdb/testsuite/gdb.guile/scm-symtab.exp
@@ -153,5 +153,5 @@ gdb_test "guile (print (= (sal-line (find-pc-line (frame-pc (selected-frame))))
 gdb_scm_test_silent_cmd "step" "step into func2"
 gdb_scm_test_silent_cmd "up" "step out of func2"
 
-gdb_test "guile (print (> (sal-line (find-pc-line (frame-pc (selected-frame)))) line))" \
+gdb_test "guile (print (>= (sal-line (find-pc-line (frame-pc (selected-frame)))) line))" \
     "#t" "test find-pc-line with resume address"

base-commit: cd3866b6d07b37258eb840443537baa163877e24
-- 
2.35.3


                 reply	other threads:[~2022-12-09  9:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221209094237.3736-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=cel@us.ibm.com \
    --cc=gdb-patches@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).