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

[WIP] Backport GC4 new dump feature to GC3 #131

Draft
wants to merge 1 commit into
base: gcos4gnucobol-3.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2788,6 +2788,8 @@ cobc_def_dump_opts (const char *opt, const int on)
} else {
cb_flag_dump = COB_DUMP_NONE;
}
if (cb_flag_dump)
cb_flag_symbols = 1;
return;
}

Expand Down Expand Up @@ -2823,6 +2825,8 @@ cobc_def_dump_opts (const char *opt, const int on)
} else {
cb_flag_dump ^= dump_to_set;
}
if (cb_flag_dump)
cb_flag_symbols = 1;
cobc_free (p);
}

Expand Down Expand Up @@ -3256,6 +3260,7 @@ process_command_line (const int argc, char **argv)
cb_flag_c_line_directives = 1;
cb_flag_c_labels = 1;
#endif
cb_flag_symbols = 1;
#ifdef COB_DEBUG_FLAGS
COBC_ADD_STR (cobc_cflags, " ", cobc_debug_flags, NULL);
#endif
Expand All @@ -3267,6 +3272,7 @@ process_command_line (const int argc, char **argv)
cb_flag_stack_extended = 1;
cb_flag_stack_check = 1;
cb_flag_memory_check = CB_MEMCHK_ALL;
cb_flag_symbols = 1;
cobc_wants_debug = 1;
break;

Expand Down Expand Up @@ -4198,6 +4204,9 @@ process_command_line (const int argc, char **argv)
cb_flag_trace = 1;
cb_flag_source_location = 1;
}
if (cb_flag_trace) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add || cb_flag_dump != COB_DUMP_NONE here, then you can remove it from cobc_def_dump_opts () completely

cb_flag_symbols = 1;
}

/* If C debug, never strip output */
if (cb_source_debugging) {
Expand Down Expand Up @@ -8937,6 +8946,8 @@ finish_setup_compiler_env (void)

if (getenv ("COBC_GEN_DUMP_COMMENTS")) {
cb_wants_dump_comments = 1;
/* Disable "new" symbol table if requesting dump comments */
cb_flag_symbols = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please leave cb_wants_dump_comments outside of that; if it is set then the old dump code should be generated - but only as comments (this should already be in its code)
please add a separate if (getenv ("COBC_GEN_DUMP_AS_CODE")) {cb_flag_symbols = 0;] here, so we can enable it if necessary - and until 4 also to test the backward compatibility of libcob.

}
}

Expand Down
10 changes: 0 additions & 10 deletions cobc/cobc.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,16 +426,6 @@ extern int cb_ml_tree_id;
extern int cb_flag_functions_all;

extern int cb_flag_dump;
#define COB_DUMP_NONE 0x0000 /* No dump */
#define COB_DUMP_FD 0x0001 /* FILE SECTION -> FILE DESCRIPTION */
#define COB_DUMP_WS 0x0002 /* WORKING-STORAGE SECTION */
#define COB_DUMP_RD 0x0004 /* REPORT SECTION */
#define COB_DUMP_SD 0x0008 /* FILE SECTION -> SORT DESCRIPTION */
#define COB_DUMP_SC 0x0010 /* SCREEN SECTION */
#define COB_DUMP_LS 0x0020 /* LINKAGE SECTION */
#define COB_DUMP_LO 0x0040 /* LOCAL-STORAGE SECTION */
#define COB_DUMP_ALL (COB_DUMP_FD|COB_DUMP_WS|COB_DUMP_RD|COB_DUMP_SD|COB_DUMP_SC|COB_DUMP_LS|COB_DUMP_LO)


extern int cb_unix_lf;

Expand Down
Loading
Loading