Breakpoints in the drmemory code itself should fire, if in the drmemory code that runs unmanaged (i.e., not in something like the string replacement routines which run managed in the code cache).
report_summary is hit when I try it.
DR prints them out in debug build; there is some python gdb scripting automating their loading but it is bit-rotted.
<Paste into GDB to debug DynamoRIO clients:
set confirm off
add-symbol-file /yxz/drmemory/git/build_x64_dbg/bin64/debug/libdrmemorylib.so' 0x00007fffe3a18000
add-symbol-file /yxz/drmemory/git/build_x64_dbg/dynamorio/lib64/debug/libdynamorio.so' 0x00007ffff7a4f000
add-symbol-file '/lib/x86_64-linux-gnu/libunwind.so.8' 0x00007ffff7fa0400
add-symbol-file '/lib/x86_64-linux-gnu/libc.so.6' 0x00007ffff7647400
add-symbol-file '/usr/lib64/ld-linux-x86-64.so.2' 0x00007ffff7f65000
add-symbol-file '/lib/x86_64-linux-gnu/liblzma.so.5' 0x00007ffff7f365c0
add-symbol-file '/lib/x86_64-linux-gnu/libz.so.1' 0x00007ffff7f14340
>
<press enter to continue>
^C
Program received signal SIGINT, Interrupt.
syscall_ready () at /yxz/drmemory/git/src/dynamorio/core/drlibc/drlibc_x86.asm:187
187 pop REG_XBX
(gdb) set confirm off
(gdb) add-symbol-file /yxz/drmemory/git/build_x64_dbg/bin64/debug/libdrmemorylib.so' 0x00007fffe3a18000
add symbol table from file /yxz/drmemory/git/build_x64_dbg/bin64/debug/libdrmemorylib.so" at
.text_addr = 0x7fffe3a18000
Reading symbols from /yxz/drmemory/git/build_x64_dbg/bin64/debug/libdrmemorylib.so...
(gdb) add-symbol-file /yxz/drmemory/git/build_x64_dbg/dynamorio/lib64/debug/libdynamorio.so' 0x00007ffff7a4f000
add symbol table from file /yxz/drmemory/git/build_x64_dbg/dynamorio/lib64/debug/libdynamorio.so" at
.text_addr = 0x7ffff7a4f000
Reading symbols from /yxz/drmemory/git/build_x64_dbg/dynamorio/lib64/debug/libdynamorio.so...
Reading symbols from /yxz/drmemory/git/build_x64_dbg/dynamorio/lib64/debug/libdynamorio.so.debug...
(gdb) add-symbol-file '/lib/x86_64-linux-gnu/libunwind.so.8' 0x00007ffff7fa0400
add symbol table from file "/lib/x86_64-linux-gnu/libunwind.so.8" at
.text_addr = 0x7ffff7fa0400
Reading symbols from /lib/x86_64-linux-gnu/libunwind.so.8...
(No debugging symbols found in /lib/x86_64-linux-gnu/libunwind.so.8)
(gdb) add-symbol-file '/lib/x86_64-linux-gnu/libc.so.6' 0x00007ffff7647400
add symbol table from file "/lib/x86_64-linux-gnu/libc.so.6" at
.text_addr = 0x7ffff7647400
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...
Reading symbols from /usr/lib/debug/.build-id/61/e1dea1f540b3b4b4d8ec76716e409cec096ece.debug...
warning: td_ta_new failed: generic error
warning: File "/usr/lib/x86_64-linux-gnu/libthread_db.so.1" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libthread_db.so.1
line to your configuration file /yxz/gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file /yxz/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
(gdb) add-symbol-file '/usr/lib64/ld-linux-x86-64.so.2' 0x00007ffff7f65000
add symbol table from file "/usr/lib64/ld-linux-x86-64.so.2" at
.text_addr = 0x7ffff7f65000
Reading symbols from /usr/lib64/ld-linux-x86-64.so.2...
Reading symbols from /usr/lib/debug/.build-id/08/cccc2a9388d5247ccb3e864f3063b975b0a15d.debug...
(gdb) add-symbol-file '/lib/x86_64-linux-gnu/liblzma.so.5' 0x00007ffff7f365c0
add symbol table from file "/lib/x86_64-linux-gnu/liblzma.so.5" at
.text_addr = 0x7ffff7f365c0
Reading symbols from /lib/x86_64-linux-gnu/liblzma.so.5...
(No debugging symbols found in /lib/x86_64-linux-gnu/liblzma.so.5)
(gdb) add-symbol-file '/lib/x86_64-linux-gnu/libz.so.1' 0x00007ffff7f14340
add symbol table from file "/lib/x86_64-linux-gnu/libz.so.1" at
.text_addr = 0x7ffff7f14340
Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...
(No debugging symbols found in /lib/x86_64-linux-gnu/libz.so.1)
(gdb) b report_summary
Breakpoint 1 at 0x7fffe3b25c16: file /yxz/drmemory/git/src/drmemory/report.c, line 1912.
(gdb) c
Continuing.
Breakpoint 1, report_summary () at /yxz/drmemory/git/src/drmemory/report.c:1912
1912 report_summary_to_file(f_global, true, true, false);
(gdb) bt
#0 report_summary () at /yxz/drmemory/git/src/drmemory/report.c:1912
#1 0x00007fffe3b25d4a in report_exit () at /yxz/drmemory/git/src/drmemory/report.c:1926
#2 0x00007fffe3a1aad5 in event_exit () at /yxz/drmemory/git/src/drmemory/drmemory.c:455
#3 0x00007ffff7bfe1ce in instrument_exit_event () at /yxz/drmemory/git/src/dynamorio/core/lib/instrument.c:906
#4 0x00007ffff7a61db1 in dynamo_shared_exit (toexit=0x0) at /yxz/drmemory/git/src/dynamorio/core/dynamo.c:1078
#5 0x00007ffff7a622c7 in dynamo_process_exit_cleanup () at /yxz/drmemory/git/src/dynamorio/core/dynamo.c:1394
#6 0x00007ffff7a62455 in dynamo_process_exit () at /yxz/drmemory/git/src/dynamorio/core/dynamo.c:1449
#7 0x00007ffff7cc42c6 in cat_done_saving_dstack () at /yxz/drmemory/git/src/dynamorio/core/arch/x86/x86.asm:614
#8 0x00007ffff7cc4325 in global_do_syscall_sysenter () at /yxz/drmemory/git/src/dynamorio/core/arch/x86/x86.asm:805
#9 0x00007ffde3a9f000 in ?? ()
#10 0x00007ffde3a84680 in ?? ()
#11 0x00000000000000e7 in ?? ()
#12 0x0000000000000000 in ?? ()