Commit a2596b28 authored by rdubner's avatar rdubner

Debugging

parent f0ea1487
......@@ -412,94 +412,6 @@ CreateCSV(PARAMETERS &params,
csv.Generate(params.csv);
}
static void
CreateCModule(PARAMETERS &params,
const COB_LABELS &cob_labels,
const VARIABLE_TREE &var_tree)
{
/* This routine puts the COBOL-identifier/C-identifier cross-reference
information into a .c module destined to be compiled and linked into
the the executable.
*/
params.csym << "// COBOL-to-C symbol cross reference, generated by \n";
params.csym << "// the COBST program.\n";
params.csym << "// For safety's sake, compile with -O0 'no optimization' switch\n";
params.csym << endl;
// Build an oddball name, to zeroize collision possibilities
params.csym << "volatile char *" << params.cbl_filename.GetFname()
<< "_o0O0o_Symbols[] = {" << endl;
// Do the line/address information from the .text in the minimal form
// used by cprint.py to figure out which program a trap has occurred in.
string current_program = "";
for(int i=0; i<cob_labels.size(); i++) {
COB_LABEL cs = cob_labels[i];
if( cs.section EQ "Linkage" ) {
// This information was previously transferred to the
// data_description information, so don't put it out here because
// it's potentially confusing.
continue;
}
stringstream ss;
ios_base::fmtflags deflags = ss.flags();
if( cs.program != current_program) {
current_program = cs.program;
ss << "P|";
ss << cs.line_number << "|";
ss << cs.program << "|";
params.csym << " \"" << ss.str() << "\"," << endl;
}
}
// You can't change the order of things here unless you also change
// the ordering in cprint.py They are tightly linked, and that's that!
for(int i=0; i<var_tree.size(); i++) {
const VAR_NODE var = var_tree[i];
stringstream ss;
ss << "D|";
ss << var.GetSection().substr(0,2) << "|";
ss << var.GetLevel() << "|" ;
ss << var.GetCanonicalName() << "|" ;
ss << var.GetBaseSymbol() << "|" ;
ss << var.GetOffset() << "|" ;
ss << var.GetType().substr(0,1) << "|" ;
ss << var.GetSize() << "|" ;
ss << var.GetPicture() << "|" ;
ss << var.GetOccurs() << "|" ;
ss << var.GetFieldSize() << "|" ;
ss << var.GetAttrType() << "|" ;
ss << var.GetAttrDigits() << "|" ;
ss << var.GetAttrScale() << "|" ;
ss << var.GetAttrFlags() << "|";
// To save bytes, let's assume that any "||" will be interpreted as
// being the same as "|0|"
string s = ss.str();
for(;;) {
size_t n = s.find("|0|");
if( n EQ string::npos ) {
break;
}
s.replace(n,3,"||");
}
params.csym << " \"" << s << "\"," << endl;
}
params.csym << " (char *)(0)" << endl;
params.csym << " };" << endl;
params.csym << endl;
}
int main(int argc, char *argv[])
{
PROFILER;
......@@ -588,9 +500,5 @@ int main(int argc, char *argv[])
// Create our actual useful .TAB file.
CreateCSV(params,cob_labels,variable_tree);
// Create our C-code cross-reference module
CreateCModule(params,cob_labels,variable_tree);
return 0;
}
......@@ -85,8 +85,6 @@ public:
// // we know in it.
FILENAME csv_filename; // Our output file, destined to be read
// // downstream
FILENAME csym_filename; // Our output file, destined to be
// // compiled into the executable
std::ifstream cbl; // Streams for the above files
std::ifstream cbl_lst;
......@@ -95,7 +93,6 @@ public:
std::ifstream lst;
std::ofstream full_csv;
std::ofstream csv;
std::ofstream csym;
bool quiet;
};
......
......@@ -292,7 +292,7 @@ class VarTrie() :
payload.Section = "WORKING-STORAGE"
elif payload.Section == "LO" :
payload.Section = "LOCAL-STORAGE"
elif payload.Section == "L" :
elif payload.Section == "LI" :
payload.Section = "LINKAGE"
if payload.ListType == "A" :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment