gdb/testsuite: Fix gdb.base/gcore-memory-usage with address sanitizer

The test gdb.base/gcore-memory-usage is meant to show that the memory
requirements of GDB's gcore command don't grow with the memory usage
of the inferior.  It was using hardcoded values for memory, but the
values were too small when building GDB with address sanitizer.  This
commit fixes one of the failures by increasing the limit on the first
gcore call.

But, rather than just increasing the hardcoded limit for the second
call, we instead save the amount of memory used in the first call and
ensure that the second call doesn't use more memory than the first.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33148
Approved-By: Tom de Vries <tdevries@suse.de>
1 file changed