forked from Imagelibrary/binutils-gdb
Fix gstack issues
With commit fb2ded33c1, I added
Fedora's gstack script to gdb. Some issues have arisen since
then, and this patch addresses those issues:
. As Sam James recently noted[1], PKGVERSION and VERSION
need to be quoted.
. A Fedora user reported the misuse of --readnever, which
causes gstack to omit filename and line number information in the
backtrace[Red Hat BZ 2354997].
[1] https://inbox.sourceware.org/gdb-patches/d19d6bc17e0a160ce27fc572079f11a587c0e168.1742424869.git.sam@gentoo.org/
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2354997
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (C) 2024 Free Software Foundation, Inc.
|
# Copyright (C) 2024-2025 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
GDB=${GDB:-$(command -v gdb)}
|
GDB=${GDB:-$(command -v gdb)}
|
||||||
GDBARGS=${GDBARGS:-}
|
GDBARGS=${GDBARGS:-}
|
||||||
AWK=${AWK:-}
|
AWK=${AWK:-}
|
||||||
PKGVERSION=@PKGVERSION@
|
PKGVERSION="@PKGVERSION@"
|
||||||
VERSION=@VERSION@
|
VERSION="@VERSION@"
|
||||||
|
|
||||||
# Find an appropriate awk interpreter if one was not specified
|
# Find an appropriate awk interpreter if one was not specified
|
||||||
# via the environment.
|
# via the environment.
|
||||||
@@ -132,7 +132,7 @@ EOF
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Run GDB and remove some unwanted noise.
|
# Run GDB and remove some unwanted noise.
|
||||||
"$GDB" --quiet -nx --readnever $GDBARGS <<EOF |
|
"$GDB" --quiet -nx $GDBARGS <<EOF |
|
||||||
set width 0
|
set width 0
|
||||||
set height 0
|
set height 0
|
||||||
set pagination no
|
set pagination no
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2024 Free Software Foundation, Inc.
|
# Copyright (C) 2024-2025 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -62,8 +62,10 @@ if { ![gdb_assert { ![expr {$res < 0 || $res == ""}] } $test] } {
|
|||||||
set test "got backtrace"
|
set test "got backtrace"
|
||||||
set saw_backtrace false
|
set saw_backtrace false
|
||||||
set no_awk false
|
set no_awk false
|
||||||
|
set location_re ${srcfile}:${decimal}
|
||||||
|
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-i "$res" -re "#0 +(0x\[0-9a-f\]+ in )?main \(\).*\r\nGSTACK-END\r\n\$" {
|
-i "$res" -re "#0 +(0x\[0-9a-f\]+ in )?main \(\).*$location_re.*\r\nGSTACK-END\r\n\$" {
|
||||||
set saw_backtrace true
|
set saw_backtrace true
|
||||||
pass $test
|
pass $test
|
||||||
exp_continue
|
exp_continue
|
||||||
|
|||||||
Reference in New Issue
Block a user