Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Don't cache debuginfo sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
ranweiler committed Dec 17, 2021
1 parent 396f337 commit 94bfd89
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/agent/coverage/src/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::{Path, PathBuf};

use anyhow::Result;
use symbolic::{
debuginfo::{pe, Object, ObjectDebugSession},
debuginfo::{pe, Object},
symcache::{SymCache, SymCacheWriter},
};

Expand Down Expand Up @@ -64,9 +64,6 @@ pub struct ModuleDebugInfo {
/// May not include the actual executable code.
pub object: Object<'static>,

/// Interface and caching structures for general debug info querying.
pub session: ObjectDebugSession<'static>,

/// Cache which allows efficient source line lookups.
pub source: SymCache<'static>,
}
Expand Down Expand Up @@ -102,17 +99,11 @@ impl ModuleDebugInfo {
return Ok(None);
}

let session = object.debug_session()?;

let cursor = io::Cursor::new(vec![]);
let cursor = SymCacheWriter::write_object(&object, cursor)?;
let cache_data = Box::leak(cursor.into_inner().into_boxed_slice());
let source = SymCache::parse(cache_data)?;

Ok(Some(Self {
object,
session,
source,
}))
Ok(Some(Self { object, source }))
}
}

0 comments on commit 94bfd89

Please sign in to comment.