]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Support core dumping testcases with Cygwin's dumper
authorPedro Alves <pedro@palves.net>
Mon, 26 Jun 2023 12:56:26 +0000 (13:56 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 16:47:12 +0000 (17:47 +0100)
commit88c4b5533e097279e5e3a596d78d7c0111c35a67
tree499c9fadc2319de200ceb0e1ca1da4794b49bed8
parent9caecd5d33f52bd35dcca9843cf5c76741726da9
Support core dumping testcases with Cygwin's dumper

Cygwin supports dumping ELF cores via a dumper.exe utility, see
https://www.cygwin.com/cygwin-ug-net/dumper.html.

When I run a testcase that has the "kernel" generate a corefile, like
gdb.base/corefile.exp, Cygwin invokes dumper.exe correctly and
generates an ELF core file, however, the testsuite doesn't find the
generated core:

 Running /home/alves/gdb/src/gdb/testsuite/gdb.base/corefile.exp ...
 WARNING: can't generate a core file - core tests suppressed - check ulimit -c

The file is correctly put under $coredir, e.g., like so:

  outputs/gdb.base/corefile/coredir.8926/corefile.exe.core

The problem is in this line in core_find:

  foreach i "${coredir}/core ${coredir}/core.coremaker.c ${binfile}.core" {

Note that that isn't looking for "${binfile}.core" inside
${coredir}...  That is fixed in this patch.

However, that still isn't sufficient for Cygwin + dumper, as in that
case the core is going to be called foo.exe.core, not foo.core.  Fix
that by looking for foo.exe.core in the core dir as well.

With this, gdb.base/corefile.exp and other tests that use core_find
now run.  They don't pass cleanly, but at least now they're exercised.

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: Ic807dd2d7f22c5df291360a18c1d4fbbbb9b993e
gdb/testsuite/lib/gdb.exp