Skip to content

Commit 02124a6

Browse files
committed
gnatdbg.utils.register_pretty_printers: refactor and enhance testing
Change-Id: Iba8c063b1030907ca630781d61ea1949045e39ef TN: RC14-025
1 parent 6a7ec53 commit 02124a6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gnatdbg/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
for name in dir(gdb)
1212
if name.startswith('TYPE_CODE_')
1313
}
14+
objfile_filter_true = lambda objfile: True # no-code-coverage
1415

1516

16-
def register_pretty_printers(printers, objfile_filter=lambda objfile: True):
17+
def register_pretty_printers(printers, objfile_filter=objfile_filter_true):
1718
"""
1819
Register pretty-printers in existing objfiles and register a hook to
1920
register them in all objfiles that will be loaded.

testsuite/tests/misc/setup/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
gdb.run_to(gdb.find_loc('foo.adb', 'BREAK'))
1717
gdb.test('python import gnatdbg; gnatdbg.setup(globally=False)', '')
1818
gdb.print_expr('empty_string', 'Unbounded_String ("")')
19+
20+
# Re-load and re-run foo, just to make sure the new_objfile event is run.
21+
gdb.kill()
22+
gdb.run_to(gdb.find_loc('foo.adb', 'BREAK'))
23+
gdb.print_expr('empty_string', 'Unbounded_String ("")')

0 commit comments

Comments
 (0)