public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/31232] New: [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
@ 2024-01-11 11:04 vries at gcc dot gnu.org
  2024-01-11 11:43 ` [Bug testsuite/31232] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-11 11:04 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31232
           Summary: [gdb/testsuite, ppc64le] FAIL:
                    gdb.dwarf2/dw2-entry-points.exp: bt foo
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On powerpc64le-linux, power10, with trunk I run into:
...
Running /home/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp ...
FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
FAIL: gdb.dwarf2/dw2-entry-points.exp: continue to breakpoint: foobar (the
program exited)
FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foobar
FAIL: gdb.dwarf2/dw2-entry-points.exp: bt fooso
...

First in more detail:
...
(gdb) PASS: gdb.dwarf2/dw2-entry-points.exp: continue to breakpoint: foo
bt^M
#0  0x00000000100006dc in foobar (J=2)^M
#1  0x000000001000070c in prog ()^M
(gdb) FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
...

In contrast, with x86_64-linux I get:
...
(gdb) PASS: gdb.dwarf2/dw2-entry-points.exp: continue to breakpoint: foo
bt^M
#0  0x00000000004004d9 in foo (J=1, K=0)^M
#1  0x0000000000400503 in prog ()^M
(gdb) PASS: gdb.dwarf2/dw2-entry-points.exp: bt foo
...

The problem seems to be that foo and foobar end up at the same address:
...
(gdb) break foo^M
Breakpoint 2 at 0x100006dc^M
(gdb) break foobar^M
Note: breakpoint 2 also set at pc 0x100006dc.^M
Breakpoint 3 at 0x100006dc^M
...

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

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

* [Bug testsuite/31232] [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
  2024-01-11 11:04 [Bug testsuite/31232] New: [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo vries at gcc dot gnu.org
@ 2024-01-11 11:43 ` vries at gcc dot gnu.org
  2024-01-11 12:56 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-11 11:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Yep, the prologue skipper is activated.

For powerpc, it walks past some instructions.

For x86_64, it walks past no instructions.

The test-case passes with:
...
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
index f361820f72f..67d8f3e062e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp
@@ -180,8 +180,8 @@ if ![runto_main] {
 }

 # Try whether we can set and hit breakpoints at the entry_points.
-gdb_breakpoint "foo"
-gdb_breakpoint "foobar"
+gdb_breakpoint "*foo"
+gdb_breakpoint "*foobar"

 # Now hit the entry_point break point and check their call-stack.
 gdb_continue_to_breakpoint "foo"
...
which disables prologue walking.

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

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

* [Bug testsuite/31232] [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
  2024-01-11 11:04 [Bug testsuite/31232] New: [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo vries at gcc dot gnu.org
  2024-01-11 11:43 ` [Bug testsuite/31232] " vries at gcc dot gnu.org
@ 2024-01-11 12:56 ` vries at gcc dot gnu.org
  2024-01-11 15:04 ` cvs-commit at gcc dot gnu.org
  2024-01-11 15:05 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-11 12:56 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2024-January/205844.html

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

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

* [Bug testsuite/31232] [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
  2024-01-11 11:04 [Bug testsuite/31232] New: [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo vries at gcc dot gnu.org
  2024-01-11 11:43 ` [Bug testsuite/31232] " vries at gcc dot gnu.org
  2024-01-11 12:56 ` vries at gcc dot gnu.org
@ 2024-01-11 15:04 ` cvs-commit at gcc dot gnu.org
  2024-01-11 15:05 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-11 15:04 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 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=fa87f8e1958b8937047e3d5fcfd8c265745710ae

commit fa87f8e1958b8937047e3d5fcfd8c265745710ae
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Jan 11 16:05:12 2024 +0100

    [gdb/testsuite] Fix gdb.dwarf2/dw2-entry-points.exp on ppc64le

    On ppc64le-linux, I run into:
    ...
    (gdb) bt^M
     #0  0x00000000100006dc in foobar (J=2)^M
     #1  0x000000001000070c in prog ()^M
    (gdb) FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
    ...

    The test-case attemps to emulate additional entry points of a function,
with
    function bar having entry points foo and foobar:
    ...
    (gdb) p bar
    $1 = {void (int, int)} 0x1000064c <bar>
    (gdb) p foo
    $2 = {void (int, int)} 0x10000698 <foo>
    (gdb) p foobar
    $3 = {void (int)} 0x100006d0 <foobar>
    ...

    However, when setting a breakpoint on the entry point foo:
    ...
    (gdb) b foo
    Breakpoint 1 at 0x100006dc
    ...
    it ends up in foobar instead of in foo, due to prologue skipping, and
    consequently the backtrace show foobar instead foo.

    The problem is that the test-case does not emulate an actual prologue at
each
    entry point.

    Fix this by disabling the prologue skipping when setting a breakpoint,
using
    "break *foo".

    Tested on ppc64le-linux and x86_64-linux.

    Tested-By: Guinevere Larsen <blarsen@redhat.com>
    Approved-By: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>

    PR testsuite/31232
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31232

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

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

* [Bug testsuite/31232] [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo
  2024-01-11 11:04 [Bug testsuite/31232] New: [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-01-11 15:04 ` cvs-commit at gcc dot gnu.org
@ 2024-01-11 15:05 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-11 15:05 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |15.1

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.

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

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

end of thread, other threads:[~2024-01-11 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11 11:04 [Bug testsuite/31232] New: [gdb/testsuite, ppc64le] FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo vries at gcc dot gnu.org
2024-01-11 11:43 ` [Bug testsuite/31232] " vries at gcc dot gnu.org
2024-01-11 12:56 ` vries at gcc dot gnu.org
2024-01-11 15:04 ` cvs-commit at gcc dot gnu.org
2024-01-11 15:05 ` vries at gcc dot gnu.org

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