Skip to content

Commit

Permalink
dump more information about attr_id and source_map during function_ge…
Browse files Browse the repository at this point in the history
…nerator for red_black_map::add

WARNING: debug log output will now be 721MB.
  • Loading branch information
brmataptos committed Nov 14, 2024
1 parent 32cbef4 commit 953e569
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ impl<'a> FunctionGenerator<'a> {
let code_offset = i as FF::CodeOffset;
let bc = &bytecode[i];
debug!(
"Generating code for bytecode {:?} ({}) at offset {}",
"Generating code for bytecode {:?} ({}) at offset {} with attr_id {:?}",
bc,
bc.display(&ctx.fun, &BTreeMap::new()),
i
i,
bc.get_attr_id(),
);
let bytecode_ctx = BytecodeContext {
fun_ctx: ctx,
Expand Down Expand Up @@ -252,6 +253,14 @@ impl<'a> FunctionGenerator<'a> {
}
}

let func_name = ctx.fun.func_env.get_full_name_str();
if func_name == "red_black_map::add" {
debug!(
"After Function {} source_map is {:#?}",
func_name, self.gen.source_map
);
}

// Deliver result
let locals = self.gen.signature(
&ctx.module,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::{
};
use codespan_reporting::diagnostic::Severity;
use itertools::Itertools;
use log::debug;
use move_binary_format::{
file_format as FF,
file_format::{AccessKind, FunctionHandle, ModuleHandle, StructDefinitionIndex, TableIndex},
Expand Down Expand Up @@ -211,6 +212,14 @@ impl ModuleGenerator {
FunctionGenerator::run(self, ctx, fun_env, acquires_list);
}

let module_name = module_env.get_full_name_str();
if module_name == "0xabc::red_black_map" {
debug!(
"After generating module {}, source_map is {:#?}",
module_name, self.source_map
);
}

// At handles of friend modules
for mid in module_env.get_friend_modules() {
let handle = self.module_handle(ctx, &module_env.get_loc(), &ctx.env.get_module(mid));
Expand Down

0 comments on commit 953e569

Please sign in to comment.