Skip to content

Commit b22a38e

Browse files
committed
Remove early bail on profiling-data registration when debugging is enabled: this always happens so we cannot error out.
1 parent 06b27b0 commit b22a38e

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

crates/wasmtime/src/runtime/instantiate.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
//! `CompiledModule` to allow compiling and instantiating to be done as separate
44
//! steps.
55
6+
use crate::code::EngineCode;
67
use crate::prelude::*;
78
use crate::profiling_agent::ProfilingAgent;
89
use crate::runtime::vm::CompiledModuleId;
9-
use crate::{Engine, code::EngineCode};
1010
use alloc::sync::Arc;
1111
use core::ops::Range;
1212
use core::str;
@@ -47,7 +47,6 @@ impl CompiledModule {
4747
/// The `profiler` argument here is used to inform JIT profiling runtimes
4848
/// about new code that is loaded.
4949
pub fn from_artifacts(
50-
engine: &Engine,
5150
engine_code: Arc<EngineCode>,
5251
info: CompiledModuleInfo,
5352
index: Arc<CompiledFunctionsTable>,
@@ -61,20 +60,15 @@ impl CompiledModule {
6160
index,
6261
func_names: info.func_names,
6362
};
64-
ret.register_profiling(engine, profiler)?;
63+
ret.register_profiling(profiler)?;
6564

6665
Ok(ret)
6766
}
6867

69-
fn register_profiling(&mut self, engine: &Engine, profiler: &dyn ProfilingAgent) -> Result<()> {
68+
fn register_profiling(&mut self, profiler: &dyn ProfilingAgent) -> Result<()> {
7069
// TODO-Bug?: "code_memory" is not exclusive for this module in the case of components,
7170
// so we may be registering the same code range multiple times here.
7271

73-
if engine.tunables().debug_guest {
74-
// TODO(#12105): support this case.
75-
anyhow::bail!("Cannot register profiling when guest debugging is enabled");
76-
}
77-
7872
profiler.register_module(self.engine_code.image(), &|addr| {
7973
let idx = self.func_by_text_offset(addr)?;
8074
let idx = self.module.func_index(idx);

crates/wasmtime/src/runtime/module.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,7 @@ impl Module {
532532
index: Arc<CompiledFunctionsTable>,
533533
serializable: bool,
534534
) -> Result<Self> {
535-
let module =
536-
CompiledModule::from_artifacts(engine, code.clone(), info, index, engine.profiler())?;
535+
let module = CompiledModule::from_artifacts(code.clone(), info, index, engine.profiler())?;
537536

538537
// Validate the module can be used with the current instance allocator.
539538
let offsets = VMOffsets::new(HostPtr, module.module());

0 commit comments

Comments
 (0)