Write .debug_frame information (#53)

* Write .debug_frame information

* mv map_reg
This commit is contained in:
Yury Delendik
2020-03-11 10:22:51 -05:00
committed by GitHub
parent 2ead747f48
commit f76b36f737
16 changed files with 403 additions and 112 deletions

View File

@@ -79,30 +79,37 @@ pub fn compile_to_obj(
};
// TODO: use the traps information
let (compilation, relocations, address_transform, value_ranges, stack_slots, _traps) =
match strategy {
Strategy::Auto | Strategy::Cranelift => Cranelift::compile_module(
&module,
&module_translation,
lazy_function_body_inputs,
&*isa,
debug_info,
cache_config,
),
#[cfg(feature = "lightbeam")]
Strategy::Lightbeam => Lightbeam::compile_module(
&module,
&module_translation,
lazy_function_body_inputs,
&*isa,
debug_info,
cache_config,
),
#[cfg(not(feature = "lightbeam"))]
Strategy::Lightbeam => bail!("lightbeam support not enabled"),
other => bail!("unsupported compilation strategy {:?}", other),
}
.context("failed to compile module")?;
let (
compilation,
relocations,
address_transform,
value_ranges,
stack_slots,
_traps,
frame_layouts,
) = match strategy {
Strategy::Auto | Strategy::Cranelift => Cranelift::compile_module(
&module,
&module_translation,
lazy_function_body_inputs,
&*isa,
debug_info,
cache_config,
),
#[cfg(feature = "lightbeam")]
Strategy::Lightbeam => Lightbeam::compile_module(
&module,
&module_translation,
lazy_function_body_inputs,
&*isa,
debug_info,
cache_config,
),
#[cfg(not(feature = "lightbeam"))]
Strategy::Lightbeam => bail!("lightbeam support not enabled"),
other => bail!("unsupported compilation strategy {:?}", other),
}
.context("failed to compile module")?;
if compilation.is_empty() {
bail!("no functions were found/compiled");
@@ -144,6 +151,7 @@ pub fn compile_to_obj(
&debug_data,
&address_transform,
&value_ranges,
&frame_layouts,
)
.context("failed to emit debug sections")?;
}