aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2025-04-19 14:41:17 +0100
committerAndrew Burgess <aburgess@redhat.com>2025-04-22 17:21:58 +0100
commit93c145c2aaf3b85b7c3b7abee029da5438d6732f (patch)
treed8c50b64abdaae648677fbbb5a47e5922d8e09ad /gdb/python/python.c
parent067bb42419ddb9d5c3f755544d52277a03ce623f (diff)
downloadbinutils-93c145c2aaf3b85b7c3b7abee029da5438d6732f.zip
binutils-93c145c2aaf3b85b7c3b7abee029da5438d6732f.tar.gz
binutils-93c145c2aaf3b85b7c3b7abee029da5438d6732f.tar.bz2
gdb/python: restructure the existing memory leak tests
We currently have two memory leak tests in gdb.python/ and there's a lot of duplication between these two. In the next commit I'd like to add yet another memory leak test, which would mean a third set of scripts which duplicate the existing two. And three is where I draw the line. This commit factors out the core of the memory leak tests into a new module gdb_leak_detector.py, which can then be imported by each tests's Python file in order to make writing the memory leak tests easier. I've also added a helper function to lib/gdb-python.exp which captures some of the common steps needed in the TCL file in order to run a memory leak test. Finally, I use this new infrastructure to rewrite the two existing memory leak tests. What I considered, but ultimately didn't do, is merge the two memory leak tests into a single TCL script. I did consider this, and for the existing tests this would be possible, but future tests might require different enough setup that this might not be possible for all future tests, and now that we have helper functions in a central location, the each individual test is actually pretty small now, so leaving them separate seemed OK. There should be no change in what is actually being tested after this commit. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/python.c')
0 files changed, 0 insertions, 0 deletions