mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 02:44:18 +08:00
b599498e18
I wrote this support file to help me debug Tcl issues in the testsuite. Adding a call to: print_stack_backtrace somewhere in a .exp file (along with "load_lib print-stack.exp") leads to the interpreter printing a backtrace in a form that e.g. Emacs can consume, with filename:linenum: lines, and quoting the line of .exp source code. Fer example, adding a print_stack_backtrace to scansarif.exp in run-sarif-pytest I get this output: VVV START OF BACKTRACE VVV /home/david/coding/gcc-newgit/src/gcc/testsuite/lib/scansarif.exp:142: frame 16 in proc print_stack_backtrace 142 | print_stack_backtrace <proc>: frame 15 in proc run-sarif-pytest <eval>: frame 14 in proc dg-final-proc /usr/share/dejagnu/dg.exp:851: frame 13 in proc dg-final-proc 851 | if {[catch "dg-final-proc $prog" errmsg]} { <eval>: frame 12 in proc saved-dg-test /home/david/coding/gcc-newgit/src/gcc/testsuite/lib/gcc-dg.exp:1080: frame 11 in proc saved-dg-test 1080 | if { [ catch { eval saved-dg-test $args } errmsg ] } { /usr/share/dejagnu/dg.exp:559: frame 10 in proc dg-test 559 | dg-test $testcase $options ${default-extra-options} /home/david/coding/gcc-newgit/src/gcc/testsuite/gcc.dg/sarif-output/sarif-output.exp:28: frame 9 28 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" "" <eval>: frame 8 <eval>: frame 7 /usr/share/dejagnu/runtest.exp:1460: frame 6 1460 | if { [catch "uplevel #0 source $test_file_name"] == 1 } { /usr/share/dejagnu/runtest.exp:1886: frame 5 in proc dg-runtest 1886 | runtest $test_name /usr/share/dejagnu/runtest.exp:1845: frame 4 in proc dg-runtest 1845 | foreach test_name [lsort [find ${dir} *.exp]] { /usr/share/dejagnu/runtest.exp:1788: frame 3 in proc dg-runtest 1788 | foreach dir "${test_top_dirs}" { /usr/share/dejagnu/runtest.exp:1669: frame 2 in proc dg-runtest 1669 | foreach pass $multipass { /usr/share/dejagnu/runtest.exp:1619: frame 1 in proc dg-runtest 1619 | foreach current_target $target_list { ^^^ END OF BACKTRACE ^^^ and can click on the lines in Emacs's compilation buffer to take me to the relevant places. I found this made it *much* easier to debug my .exp files. That said, I'm uncomfortable with Tcl, and so (a) there may be a better way of doing this (b) I may have made mistakes gcc/testsuite/ChangeLog: * lib/print-stack.exp: New file. Signed-off-by: David Malcolm <dmalcolm@redhat.com> |
||
---|---|---|
.forgejo | ||
.github | ||
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgm2 | ||
libgo | ||
libgomp | ||
libgrust | ||
libiberty | ||
libitm | ||
libobjc | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.b4-config | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
SECURITY.txt | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.