Skip to content

Commit

Permalink
xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Nov 13, 2023
1 parent 02bc30d commit b964b49
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
33 changes: 17 additions & 16 deletions cobc/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -13728,26 +13728,28 @@ output_header (const char *locbuff, const struct cb_program *cp)
static void
output_cob_prof_data ()
{
struct cb_text_list *l = procedures_list;
if (cb_flag_prof) {
struct cb_text_list *l = procedures_list;

output_local ("/* cob_prof data */\n\n");
output_local ("/* cob_prof data */\n\n");

output_local ("#include <libcob/cobprof.h>\n\n");
output_local ("#include <libcob/cobprof.h>\n\n");

output_local ("static const char *procedures_names[%d] = {\n", procedures_list_len + 1);
while (l) {
output_local (" \"%s\",\n", l->text);
l = l->next;
}
output_local (" \"\"");
output_local ("};\n");
output_local ("static const char *procedures_names[%d] = {\n", procedures_list_len + 1);
while (l) {
output_local (" \"%s\",\n", l->text);
l = l->next;
}
output_local (" \"\"");
output_local ("};\n");

output_local ("static struct cobprof_info *prof_info;\n");
output_local ("static struct cobprof_info *prof_info;\n");

output_local ("\n/* End of cob_prof data */\n");
output_local ("\n/* End of cob_prof data */\n");

procedures_list = NULL;
procedures_list_len = 0;
procedures_list = NULL;
procedures_list_len = 0;
}
}

void
Expand Down Expand Up @@ -14025,8 +14027,7 @@ codegen_internal (struct cb_program *prog, const int subsequent_call)

output_local_base_cache ();
output_local_field_cache (prog);

if (cb_flag_prof) output_cob_prof_data ();
output_cob_prof_data ();

/* Report data fields */
if (prog->report_storage) {
Expand Down
6 changes: 2 additions & 4 deletions libcob/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,10 @@ static struct config_tbl gc_conf[] = {
{"COB_CORE_ON_ERROR", "core_on_error", "0", coeopts, GRP_MISC, ENV_UINT | ENV_ENUMVAL, SETPOS (cob_core_on_error)},
{"COB_CORE_FILENAME", "core_filename", "./core.libcob", NULL, GRP_MISC, ENV_STR, SETPOS (cob_core_filename)},
{"COB_DUMP_FILE", "dump_file", NULL, NULL, GRP_MISC, ENV_FILE, SETPOS (cob_dump_filename)},
/*
{"COB_PROF_FILE", "prof_file", NULL, NULL, GRP_MISC, ENV_FILE, SETPOS (cob_prof_filename)},
{"COB_PROF_DISABLE", "prof_disable", "0", NULL, GRP_MISC, ENV_BOOL, SETPOS (cob_prof_disable)},
{"COB_PROF_MAX_DEPTH", "prof_max_depth", "255", NULL, GRP_MISC, ENV_UINT, SETPOS (cob_prof_max_depth)},
{"COB_IS_RUNNING_IN_TESTMODE", "testsuite_mode", "0", NULL, GRP_MISC, ENV_BOOL, SETPOS (cob_testsuite_mode)},
*/
{"COB_DUMP_WIDTH", "dump_width", "100", NULL, GRP_MISC, ENV_UINT, SETPOS (cob_dump_width)},
#ifdef _WIN32
/* checked before configuration load if set from environment in cob_common_init() */
Expand Down Expand Up @@ -3021,7 +3019,7 @@ call_exit_handlers_and_terminate (void)
h = h->next;
}
}
// Fabrice cob_prof_end();
cob_prof_end();
cob_terminate_routines ();
}

Expand Down Expand Up @@ -10168,7 +10166,7 @@ cob_init (const int argc, char **argv)
cob_init_numeric (cobglobptr);
cob_init_strings (cobglobptr);
cob_init_move (cobglobptr, cobsetptr);
// Fabrice cob_init_prof (cobglobptr, cobsetptr);
cob_init_prof (cobglobptr, cobsetptr);
cob_init_intrinsic (cobglobptr);
cob_init_fileio (cobglobptr, cobsetptr);
cob_init_call (cobglobptr, cobsetptr, check_mainhandle);
Expand Down

0 comments on commit b964b49

Please sign in to comment.