If you wish to debug the library loading & symbol proxying process
libcapsule exposes a lot of detail depending on the contents of the
CAPSULE_DEBUG environment variable.

CAPSULE_DEBUG is a comma-or-space separated variable, and currently
understand the following debug flags:

  path    : path manipulation and translation
  search  : searching for DSOs
  ldcache : loading/processing the ld cache
  capsule : setting up the proxy capsule
  mprotect: subverting mprotect (for RELRO linking)
  wrappers: function wrappers installed in the capsule
  reloc   : patching capsule symbols into external DSOs
  dlfunc  : dlsym/dlfunc wrapper info as they execute (overlaps wrappers)
  elf     : detailed ELF introspection logging
  all     : all of the above

At this point gdb does not yet know about dlmopen()ed DSOs and their
symbols, so debugging a libcapsule proxy library with gdb isn't very
convenient. It's on the list of things to fix.

If you are debugging the unit tests, you might want to set
CAPSULE_TESTS_KEEP_TEMP to a non-empty value so temporary
directories will not be cleaned up. See tests/CapsuleTest.pm
or `perldoc -F tests/CapsuleTest.pm` for more details.
