tap-driver.sh: flush stdout after each test result
[babeltrace.git] / plugins / lttng-utils / debug-info / bin-info.h
index 2bcd9fae42cd55b1896fe41f765300abdb667da6..c193a06de28383a79f9b6713704f1af7da76bbba 100644 (file)
 #include <stdbool.h>
 #include <gelf.h>
 #include <elfutils/libdw.h>
-#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace2/babeltrace-internal.h>
+#include <babeltrace2/fd-cache-internal.h>
 
 #define DEFAULT_DEBUG_DIR "/usr/lib/debug"
-#define DEBUG_SUBDIR ".debug/"
-#define BUILD_ID_SUBDIR ".build-id/"
+#define DEBUG_SUBDIR ".debug"
+#define BUILD_ID_SUBDIR ".build-id"
 #define BUILD_ID_SUFFIX ".debug"
+#define BUILD_ID_PREFIX_DIR_LEN 2
 
 struct bin_info {
        /* Base virtual memory address. */
@@ -58,20 +60,22 @@ struct bin_info {
        /* Optional debug link info. */
        gchar *dbg_link_filename;
        uint32_t dbg_link_crc;
-       /* FDs to ELF and DWARF files. */
-       int elf_fd;
-       int dwarf_fd;
+       /* fd cache handles to ELF and DWARF files. */
+       struct bt_fd_cache_handle *elf_handle;
+       struct bt_fd_cache_handle *dwarf_handle;
        /* Configuration. */
        gchar *debug_info_dir;
        /* Denotes whether the executable is position independent code. */
        bool is_pic:1;
-       /* denotes whether the build id in the trace matches to one on disk. */
+       /* Denotes whether the build id in the trace matches to one on disk. */
        bool file_build_id_matches:1;
        /*
         * Denotes whether the executable only has ELF symbols and no
         * DWARF info.
         */
        bool is_elf_only:1;
+       /* Weak ref. Owned by the iterator. */
+       struct bt_fd_cache *fd_cache;
 };
 
 struct source_location {
@@ -104,9 +108,9 @@ int bin_info_init(void);
  *                     NULL on failure.
  */
 BT_HIDDEN
-struct bin_info *bin_info_create(const char *path, uint64_t low_addr,
-               uint64_t memsz, bool is_pic, const char *debug_info_dir,
-               const char *target_prefix);
+struct bin_info *bin_info_create(struct bt_fd_cache *fdc, const char *path,
+               uint64_t low_addr, uint64_t memsz, bool is_pic,
+               const char *debug_info_dir, const char *target_prefix);
 
 /**
  * Destroy the given bin_info instance
This page took 0.025332 seconds and 4 git commands to generate.