+static inline
+void handle_lib_unload_event(struct debug_info *debug_info,
+ struct ctf_event_definition *event_def)
+{
+ struct bt_definition *baddr_def = NULL;
+ struct bt_definition *event_fields_def = NULL;
+ struct bt_definition *sec_def = NULL;
+ struct bt_definition *vpid_def = NULL;
+ struct proc_debug_info_sources *proc_dbg_info_src;
+ uint64_t baddr;
+ int64_t vpid;
+ gpointer key_ptr = NULL;
+
+ event_fields_def = (struct bt_definition *) event_def->event_fields;
+ sec_def = (struct bt_definition *)
+ event_def->stream->stream_event_context;
+ if (!event_fields_def || !sec_def) {
+ goto end;
+ }
+
+ baddr_def = bt_lookup_definition(event_fields_def, "_baddr");
+ if (!baddr_def) {
+ goto end;
+ }
+
+ vpid_def = bt_lookup_definition(sec_def, "_vpid");
+ if (!vpid_def) {
+ goto end;
+ }
+
+ if (baddr_def->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
+ goto end;
+ }
+ if (vpid_def->declaration->id != BT_CTF_TYPE_ID_INTEGER) {
+ goto end;
+ }
+
+ baddr = bt_get_unsigned_int(baddr_def);
+ vpid = bt_get_signed_int(vpid_def);
+
+ proc_dbg_info_src = proc_debug_info_sources_ht_get_entry(
+ debug_info->vpid_to_proc_dbg_info_src, vpid);
+ if (!proc_dbg_info_src) {
+ goto end;
+ }
+
+ key_ptr = (gpointer) &baddr;
+ (void) g_hash_table_remove(proc_dbg_info_src->baddr_to_bin_info,
+ key_ptr);
+end:
+ return;
+}