public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug backtrace/30929] New: 'frame function' fails when call is the last instruction
@ 2023-10-01 15:51 amonakov at gmail dot com
  2023-10-01 16:40 ` [Bug backtrace/30929] " tromey at sourceware dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: amonakov at gmail dot com @ 2023-10-01 15:51 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30929
           Summary: 'frame function' fails when call is the last
                    instruction
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: backtrace
          Assignee: unassigned at sourceware dot org
          Reporter: amonakov at gmail dot com
  Target Milestone: ---

int main()
{
        __builtin_abort();
}

gcc -g test.c

gdb ./a.out

(gdb) start
Temporary breakpoint 1 at 0x40113a: file t.c, line 3.

Temporary breakpoint 1, main () at t.c:3
3               __builtin_abort();
(gdb) f f main
#0  main () at t.c:3
3               __builtin_abort();
(gdb) c
Continuing.

Program received signal SIGABRT, Aborted.
0x00007ffff7e4d47c in __pthread_kill_implementation () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff7e4d47c in __pthread_kill_implementation () from
/lib64/libc.so.6
#1  0x00007ffff7dfae16 in raise () from /lib64/libc.so.6
#2  0x00007ffff7de389c in abort () from /lib64/libc.so.6
#3  0x000000000040113f in main () at t.c:3
(gdb) f f main
No frame for function "main".


Compiling to an intermediate assembly file and adding a nop after 'call abort'
is sufficient to make it work. Apparently 'frame function' doesn't work in the
corner case when return address is exactly past the end of a function (the last
instruction was a call).

In practice this breaks the following snippet:

catch signal SIGABRT
commands
f f __assert_fail
up
end

which is supposed to automatically select the frame of the failing assert.

-- 
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 backtrace/30929] 'frame function' fails when call is the last instruction
  2023-10-01 15:51 [Bug backtrace/30929] New: 'frame function' fails when call is the last instruction amonakov at gmail dot com
@ 2023-10-01 16:40 ` tromey at sourceware dot org
  2023-10-01 17:13 ` amonakov at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2023-10-01 16:40 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-10-01
                 CC|                            |tromey at sourceware dot org
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Can you try git master gdb?
I suspect this is a dup of bug#29074.

If not, then it is probably another instance of bug#8416 -
same idea, just need to track down the spot with the incorrect call.

-- 
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 backtrace/30929] 'frame function' fails when call is the last instruction
  2023-10-01 15:51 [Bug backtrace/30929] New: 'frame function' fails when call is the last instruction amonakov at gmail dot com
  2023-10-01 16:40 ` [Bug backtrace/30929] " tromey at sourceware dot org
@ 2023-10-01 17:13 ` amonakov at gmail dot com
  2023-10-06 12:33 ` tromey at sourceware dot org
  2024-01-10 20:10 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: amonakov at gmail dot com @ 2023-10-01 17:13 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Alexander Monakov <amonakov at gmail dot com> ---
No, I don't have a git build of GDB. The instructions should be straightforward
to follow for any active GDB developer (who presumably has a git build at
hand).

-- 
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 backtrace/30929] 'frame function' fails when call is the last instruction
  2023-10-01 15:51 [Bug backtrace/30929] New: 'frame function' fails when call is the last instruction amonakov at gmail dot com
  2023-10-01 16:40 ` [Bug backtrace/30929] " tromey at sourceware dot org
  2023-10-01 17:13 ` amonakov at gmail dot com
@ 2023-10-06 12:33 ` tromey at sourceware dot org
  2024-01-10 20:10 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2023-10-06 12:33 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Confirmed.

-- 
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 backtrace/30929] 'frame function' fails when call is the last instruction
  2023-10-01 15:51 [Bug backtrace/30929] New: 'frame function' fails when call is the last instruction amonakov at gmail dot com
                   ` (2 preceding siblings ...)
  2023-10-06 12:33 ` tromey at sourceware dot org
@ 2024-01-10 20:10 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-01-10 20:10 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |8416


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=8416
[Bug 8416] Audit get_frame_pc vs get_frame_address_in_block
-- 
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-10 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 15:51 [Bug backtrace/30929] New: 'frame function' fails when call is the last instruction amonakov at gmail dot com
2023-10-01 16:40 ` [Bug backtrace/30929] " tromey at sourceware dot org
2023-10-01 17:13 ` amonakov at gmail dot com
2023-10-06 12:33 ` tromey at sourceware dot org
2024-01-10 20:10 ` tromey at sourceware dot 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).