Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bbdump_tags for non-CI builds #2552

Merged
merged 1 commit into from
Jul 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/arch/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ DECLARE_CXTSWPROT_VAR(mutex_t bb_building_lock, INIT_LOCK_FREE(bb_building_lock)
/* i#1111: we do not use the lock until the 2nd thread is created */
volatile bool bb_lock_start;

#if defined(INTERNAL) || defined(DEBUG) || defined(CLIENT_INTERFACE)
static file_t bbdump_file = INVALID_FILE;
#endif

#ifdef DEBUG
DECLARE_NEVERPROT_VAR(uint debug_bb_count, 0);
Expand All @@ -130,10 +132,12 @@ DECLARE_NEVERPROT_VAR(uint debug_bb_count, 0);
void
interp_init()
{
#if defined(INTERNAL) || defined(DEBUG) || defined(CLIENT_INTERFACE)
if (INTERNAL_OPTION(bbdump_tags)) {
bbdump_file = open_log_file("bbs", NULL, 0);
ASSERT(bbdump_file != INVALID_FILE);
}
#endif
}

#ifdef CUSTOM_TRACES_RET_REMOVAL
Expand All @@ -147,9 +151,11 @@ static int num_rets_removed;
void
interp_exit()
{
#if defined(INTERNAL) || defined(DEBUG) || defined(CLIENT_INTERFACE)
if (INTERNAL_OPTION(bbdump_tags)) {
close_log_file(bbdump_file);
}
#endif
DELETE_LOCK(bb_building_lock);

LOG(GLOBAL, LOG_INTERP|LOG_STATS, 1, "Total application code seen: %d KB\n",
Expand Down Expand Up @@ -5240,9 +5246,11 @@ build_basic_block_fragment(dcontext_t *dcontext, app_pc start, uint initial_flag
disassemble_fragment(dcontext, f, false);
}
});
#if defined(INTERNAL) || defined(DEBUG) || defined(CLIENT_INTERFACE)
if (INTERNAL_OPTION(bbdump_tags)) {
disassemble_fragment_header(dcontext, f, bbdump_file);
}
#endif

#ifdef INTERNAL
DODEBUG({
Expand Down