]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: add test for memory requirements of gcore
authorGuinevere Larsen <guinevere@redhat.com>
Fri, 21 Feb 2025 13:06:03 +0000 (10:06 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Wed, 5 Mar 2025 20:37:28 +0000 (17:37 -0300)
commit18b66eb58729a0eb61ff46f32bf4127d28b800aa
tree0e01b54726031d1ea28723897d770b7502cb9dd7
parent6594ca4a99dabbebd70c0748dee61d8b3a373336
gdb/testsuite: add test for memory requirements of gcore

For a long time, Fedora has been carrying an out-of-tree patch with a
similar test to the one proposed in this patch, that ensures that the
memory requirements don't grow with the inferior's memory. It's been
so long that the context for why this test exists has been lost, but
it looked like it could be interesting for upstream.

The test runs twice, once with the inferior allocating 4Mb of memory,
and the other allocating 64Mb. My plan was to find the rate at which
things increase based on inferior size, and have that tested to ensure
we're not growing that requirement accidentally, but my testing
actually showed memory requirements going down as the inferior increases,
so instead I just hardcoded that we need less than 2Mb for the command,
and it can be tweaked later if necessary.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.base/gcore-memory-usage.c [new file with mode: 0644]
gdb/testsuite/gdb.base/gcore-memory-usage.exp [new file with mode: 0644]