From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id B06FF385700A for ; Thu, 19 Aug 2021 09:49:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B06FF385700A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x334.google.com with SMTP id k5-20020a05600c1c85b02902e699a4d20cso3665803wms.2 for ; Thu, 19 Aug 2021 02:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8mU4BbP6vSX2ANry1frcbpScIdP2JNFP3KdVcDo85sw=; b=b30bertVGQ70AONC/MM7m+aJcIHuNNDnTdtmDm2x2fY5wR5AApBrUbW7LzlaGg+gS7 CCED9xWiSNundxa4MlxUVpsZKHqbPyUmNX2lm+T+KqaMRFawjyz57tFGKIS54qADSTC3 bCVhbRigzagFElOrM4TB1TFvUsc2eE3Vv8UyxSK4ivIcwYljql5DUrWaI4MXinalYYmG d548+9Ewco2JECv2A0aEcPk92YkjacmI00UepXQYl8oplkPr3ZoNfvHDUGCqZFKY9JVH 4uLp5mm4CQeqcYBf4VhDcj/3/ROzrTnGSOVNBF7ZDwbO9uga/l4/ZXDcu0mmJCvwJvQc iF0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8mU4BbP6vSX2ANry1frcbpScIdP2JNFP3KdVcDo85sw=; b=pJ8v1qIcrbuT4jiWCoN+skEyaeUBDbpIHLyPbIVzen5T3DOrDwbfeyN8Pzjzo5s0y8 pjMJgYcBTpbFTL5CTgNFcYWNItyZD6Xdbh3uGmj1rmg50+gr5NmU9O5pMTZxX9Lfhd7m loeGZwCTDfimlvKfn14wYX1deMKiJlOBOdMD8hgNd6c3b8cDdrDBQy20BSGel7Y5agli t4d0BDyRb5wRjSXGDqnbALpUaNOcZs2QKUa6GQ4emXDwKUdtil26HhD9phIGCJbBBTLD V4UnyziIhil0RCeJDg+TKiumZhgO4HY87DlTihRysF/ldbzkXR37PzEZpiL5OQchrVwU xr1Q== X-Gm-Message-State: AOAM530YIykh5eY3WaJLLL5d8jRgyPmAW3Gsd5Ugye1hJxggwFWH5vUn wVvhUyAO0HA7iqmWZeNPF9x2ByXMryUnDQ== X-Google-Smtp-Source: ABdhPJxy2H7hed1/gduyIReQlCdHzYGFd4h43LKcPCBzg6q3JwPEHc5sNhh1xh3WeeH/baZIswa45g== X-Received: by 2002:a1c:2504:: with SMTP id l4mr12924153wml.55.1629366576266; Thu, 19 Aug 2021 02:49:36 -0700 (PDT) Received: from localhost (host86-188-49-44.range86-188.btcentralplus.com. [86.188.49.44]) by smtp.gmail.com with ESMTPSA id d7sm2432978wrs.39.2021.08.19.02.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 02:49:35 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 0/6] Display GDB backtrace for internal errors Date: Thu, 19 Aug 2021 10:49:25 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 09:49:48 -0000 This series does two things: 1. Imports libbacktrace from gcc to present better backtraces of GDB when we hit a fatal signal, and 2. Prints the backtrace when GDB hits an internal-error (e.g. an assert). The hope here is to try an improve the quality of bug reports, instead of just getting a report that GDB hit some assert in frame.c, or value.c, we will (hopefully) have a backtrace included with the bug report, which _might_ give developers a fighting chance at figuring out what went wrong. All feedback welcome, Thanks, Andrew --- Andrew Burgess (6): gdb: use bool instead of int in struct internal_problem gdb: make use of std::string in utils.c gdb: Add a dependency between gdb and libbacktrace Copy in libbacktrace from gcc gdb: use libbacktrace to create a better backtrace for fatal signals gdb: print backtrace for internal error/warning Makefile.def | 1 + Makefile.in | 1 + gdb/Makefile.in | 16 +- gdb/NEWS | 8 + gdb/bt-utils.c | 170 + gdb/bt-utils.h | 69 + gdb/config.in | 3 + gdb/configure | 32 + gdb/configure.ac | 23 + gdb/doc/gdb.texinfo | 13 + gdb/event-top.c | 47 +- .../gdb.base/bt-on-error-and-warning.exp | 118 + gdb/testsuite/gdb.base/bt-on-fatal-signal.exp | 36 - gdb/utils.c | 121 +- libbacktrace/ChangeLog | 1759 ++ libbacktrace/ChangeLog.jit | 14 + libbacktrace/Makefile.am | 586 + libbacktrace/Makefile.in | 2528 +++ libbacktrace/README | 23 + libbacktrace/aclocal.m4 | 867 + libbacktrace/alloc.c | 167 + libbacktrace/allocfail.c | 136 + libbacktrace/allocfail.sh | 104 + libbacktrace/atomic.c | 113 + libbacktrace/backtrace-supported.h.in | 66 + libbacktrace/backtrace.c | 129 + libbacktrace/backtrace.h | 206 + libbacktrace/btest.c | 501 + libbacktrace/config.h.in | 184 + libbacktrace/configure | 16893 ++++++++++++++++ libbacktrace/configure.ac | 581 + libbacktrace/dwarf.c | 4056 ++++ libbacktrace/edtest.c | 120 + libbacktrace/edtest2.c | 43 + libbacktrace/elf.c | 4919 +++++ libbacktrace/fileline.c | 346 + libbacktrace/filetype.awk | 13 + .../install-debuginfo-for-buildid.sh.in | 65 + libbacktrace/instrumented_alloc.c | 114 + libbacktrace/internal.h | 380 + libbacktrace/macho.c | 1355 ++ libbacktrace/mmap.c | 331 + libbacktrace/mmapio.c | 110 + libbacktrace/mtest.c | 410 + libbacktrace/nounwind.c | 66 + libbacktrace/pecoff.c | 935 + libbacktrace/posix.c | 104 + libbacktrace/print.c | 92 + libbacktrace/read.c | 110 + libbacktrace/simple.c | 108 + libbacktrace/sort.c | 108 + libbacktrace/state.c | 72 + libbacktrace/stest.c | 137 + libbacktrace/test_format.c | 55 + libbacktrace/testlib.c | 234 + libbacktrace/testlib.h | 110 + libbacktrace/ttest.c | 161 + libbacktrace/unittest.c | 92 + libbacktrace/unknown.c | 65 + libbacktrace/xcoff.c | 1606 ++ libbacktrace/xztest.c | 508 + libbacktrace/ztest.c | 541 + 62 files changed, 42760 insertions(+), 121 deletions(-) create mode 100644 gdb/bt-utils.c create mode 100644 gdb/bt-utils.h create mode 100644 gdb/testsuite/gdb.base/bt-on-error-and-warning.exp create mode 100644 libbacktrace/ChangeLog create mode 100644 libbacktrace/ChangeLog.jit create mode 100644 libbacktrace/Makefile.am create mode 100644 libbacktrace/Makefile.in create mode 100644 libbacktrace/README create mode 100644 libbacktrace/aclocal.m4 create mode 100644 libbacktrace/alloc.c create mode 100644 libbacktrace/allocfail.c create mode 100755 libbacktrace/allocfail.sh create mode 100644 libbacktrace/atomic.c create mode 100644 libbacktrace/backtrace-supported.h.in create mode 100644 libbacktrace/backtrace.c create mode 100644 libbacktrace/backtrace.h create mode 100644 libbacktrace/btest.c create mode 100644 libbacktrace/config.h.in create mode 100755 libbacktrace/configure create mode 100644 libbacktrace/configure.ac create mode 100644 libbacktrace/dwarf.c create mode 100644 libbacktrace/edtest.c create mode 100644 libbacktrace/edtest2.c create mode 100644 libbacktrace/elf.c create mode 100644 libbacktrace/fileline.c create mode 100644 libbacktrace/filetype.awk create mode 100644 libbacktrace/install-debuginfo-for-buildid.sh.in create mode 100644 libbacktrace/instrumented_alloc.c create mode 100644 libbacktrace/internal.h create mode 100644 libbacktrace/macho.c create mode 100644 libbacktrace/mmap.c create mode 100644 libbacktrace/mmapio.c create mode 100644 libbacktrace/mtest.c create mode 100644 libbacktrace/nounwind.c create mode 100644 libbacktrace/pecoff.c create mode 100644 libbacktrace/posix.c create mode 100644 libbacktrace/print.c create mode 100644 libbacktrace/read.c create mode 100644 libbacktrace/simple.c create mode 100644 libbacktrace/sort.c create mode 100644 libbacktrace/state.c create mode 100644 libbacktrace/stest.c create mode 100644 libbacktrace/test_format.c create mode 100644 libbacktrace/testlib.c create mode 100644 libbacktrace/testlib.h create mode 100644 libbacktrace/ttest.c create mode 100644 libbacktrace/unittest.c create mode 100644 libbacktrace/unknown.c create mode 100644 libbacktrace/xcoff.c create mode 100644 libbacktrace/xztest.c create mode 100644 libbacktrace/ztest.c -- 2.25.4