public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26377] New: generate backtrace upon assert
@ 2020-08-12 14:33 vries at gcc dot gnu.org
  2020-08-12 20:47 ` [Bug gdb/26377] " tromey at sourceware dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2020-08-12 14:33 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26377
           Summary: generate backtrace upon assert
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Similar to what is done in gcc, using fancy_abort

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

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

* [Bug gdb/26377] generate backtrace upon assert
  2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
@ 2020-08-12 20:47 ` tromey at sourceware dot org
  2020-08-13 12:48 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2020-08-12 20:47 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Good idea.  Looks relatively straightforward:

* Import libbacktrace from gcc
* Update top-level configury so it is a dependency of gdb
* Change gdb's internal error to call into libbacktrace

Is anything else needed?  All I can think of is maybe some
test suite tweaks.

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

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

* [Bug gdb/26377] generate backtrace upon assert
  2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
  2020-08-12 20:47 ` [Bug gdb/26377] " tromey at sourceware dot org
@ 2020-08-13 12:48 ` vries at gcc dot gnu.org
  2020-11-29  9:25 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2020-08-13 12:48 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

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

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

* [Bug gdb/26377] generate backtrace upon assert
  2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
  2020-08-12 20:47 ` [Bug gdb/26377] " tromey at sourceware dot org
  2020-08-13 12:48 ` vries at gcc dot gnu.org
@ 2020-11-29  9:25 ` vries at gcc dot gnu.org
  2021-08-30 14:17 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2020-11-29  9:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
FTR, first mentioned here (
https://sourceware.org/pipermail/gdb/2020-July/048788.html ).

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

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

* [Bug gdb/26377] generate backtrace upon assert
  2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-11-29  9:25 ` vries at gcc dot gnu.org
@ 2021-08-30 14:17 ` vries at gcc dot gnu.org
  2021-09-28 11:27 ` cvs-commit at gcc dot gnu.org
  2021-09-28 15:22 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-30 14:17 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch submitted:
https://sourceware.org/pipermail/gdb-patches/2021-August/181548.html

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

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

* [Bug gdb/26377] generate backtrace upon assert
  2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-08-30 14:17 ` vries at gcc dot gnu.org
@ 2021-09-28 11:27 ` cvs-commit at gcc dot gnu.org
  2021-09-28 15:22 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-28 11:27 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Burgess <aburgess@sourceware.org>:

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

commit 91f2597bd24d171c1337a4629f8237aa47c59082
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Thu Aug 12 18:24:59 2021 +0100

    gdb: print backtrace for internal error/warning

    This commit builds on previous work to allow GDB to print a backtrace
    of itself when GDB encounters an internal-error or internal-warning.
    This fixes PR gdb/26377.

    There's not many places where we call internal_warning, and I guess in
    most cases the user would probably continue their debug session.  And
    so, in order to avoid cluttering up the output, by default, printing
    of a backtrace is off for internal-warnings.

    In contrast, printing of a backtrace is on by default for
    internal-errors, as I figure that in most cases hitting an
    internal-error is going to be the end of the debug session.

    Whether a backtrace is printed or not can be controlled with the new
    settings:

      maintenance set internal-error backtrace on|off
      maintenance show internal-error backtrace

      maintenance set internal-warning backtrace on|off
      maintenance show internal-warning backtrace

    Here is an example of what an internal-error now looks like with the
    backtrace included:

      (gdb) maintenance internal-error blah
      ../../src.dev-3/gdb/maint.c:82: internal-error: blah
      A problem internal to GDB has been detected,
      further debugging may prove unreliable.
      ----- Backtrace -----
      0x5c61ca gdb_internal_backtrace_1
            ../../src.dev-3/gdb/bt-utils.c:123
      0x5c626d _Z22gdb_internal_backtracev
            ../../src.dev-3/gdb/bt-utils.c:165
      0xe33237 internal_vproblem
            ../../src.dev-3/gdb/utils.c:393
      0xe33539 _Z15internal_verrorPKciS0_P13__va_list_tag
            ../../src.dev-3/gdb/utils.c:470
      0x1549652 _Z14internal_errorPKciS0_z
            ../../src.dev-3/gdbsupport/errors.cc:55
      0x9c7982 maintenance_internal_error
            ../../src.dev-3/gdb/maint.c:82
      0x636f57 do_simple_func
            ../../src.dev-3/gdb/cli/cli-decode.c:97
       .... snip, lots more backtrace lines ....
      ---------------------
      ../../src.dev-3/gdb/maint.c:82: internal-error: blah
      A problem internal to GDB has been detected,
      further debugging may prove unreliable.
      Quit this debugging session? (y or n) y

      This is a bug, please report it.  For instructions, see:
      <https://www.gnu.org/software/gdb/bugs/>.

      ../../src.dev-3/gdb/maint.c:82: internal-error: blah
      A problem internal to GDB has been detected,
      further debugging may prove unreliable.
      Create a core file of GDB? (y or n) n

    My hope is that this backtrace might make it slightly easier to
    diagnose GDB issues if all that is provided is the console output, I
    find that we frequently get reports of an assert being hit that is
    located in pretty generic code (frame.c, value.c, etc) and it is not
    always obvious how we might have arrived at the assert.

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

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

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

* [Bug gdb/26377] generate backtrace upon assert
  2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-09-28 11:27 ` cvs-commit at gcc dot gnu.org
@ 2021-09-28 15:22 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-28 15:22 UTC (permalink / raw)
  To: gdb-prs

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

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

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
patch committed, marking resolved-fixed.

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

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

end of thread, other threads:[~2021-09-28 15:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 14:33 [Bug gdb/26377] New: generate backtrace upon assert vries at gcc dot gnu.org
2020-08-12 20:47 ` [Bug gdb/26377] " tromey at sourceware dot org
2020-08-13 12:48 ` vries at gcc dot gnu.org
2020-11-29  9:25 ` vries at gcc dot gnu.org
2021-08-30 14:17 ` vries at gcc dot gnu.org
2021-09-28 11:27 ` cvs-commit at gcc dot gnu.org
2021-09-28 15:22 ` 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).