Commit 43ba2cbe authored by rdubner's avatar rdubner
Browse files

Debugging sym.c

parent 457e69b2
......@@ -426,13 +426,8 @@ CreateCModule(PARAMETERS &params,
params.csym << "// the COBST program.\n";
params.csym << "// For safety's sake, compile with -O0 'no optimization' switch\n";
params.csym << endl;
params.csym << "typedef struct" << endl;
params.csym << " {" << endl;
params.csym << " char const * const p;" << endl;
params.csym << " } ENTRY;" << endl;
params.csym << endl;
// Build an oddball name, to zeroize collision possibilities
params.csym << "volatile ENTRY " << params.cbl_filename.GetFname()
params.csym << "volatile char *" << params.cbl_filename.GetFname()
<< "_o0O0o_Symbols[] = {" << endl;
// You can't change the order of things here unless you also change
......@@ -468,11 +463,11 @@ CreateCModule(PARAMETERS &params,
s.replace(n,3,"||");
}
params.csym << " ENTRY{\"" << s << "\"}," << endl;
params.csym << " \"" << s << "\"," << endl;
}
params.csym << " ENTRY{NULL}" << endl;
params.csym << " };" << endl;
params.csym << " (char *)(0)" << endl;
params.csym << " };" << endl;
params.csym << endl;
}
......
// COBOL-to-C symbol cross reference, generated by
// the COBST program.
// For safety's sake, compile with -O0 'no optimization' switch
char *optfde01_o0O0o_Symbols[] = {
"IN||pgm-input/optfde01|b_10||F|118||||||||",
"IN|1|input-record/pgm-input/optfde01|b_10||A|118|X(118)|||||||",
"IN||pgm-output/optfde01|b_12||F|118||||||||",
"IN|1|output-record/pgm-output/optfde01|b_12||A|118|X(118)||118|33||||",
"WO|1|file-status/optfde01|b_13||A|1|X|||||||",
"WO|1|working-data/optfde01|b_15||G|48||||||||",
"WO|5|pgm-name/working-data/optfde01|b_15||A|9|X(9)||9|33||||",
"WO|5|old-date/working-data/optfde01|b_15|9|N|8|9(8)|||||||",
"WO|5|old-dat1/working-data/optfde01|b_15|9|G|8||||||||",
"WO|10|datmo/old-dat1/working-data/optfde01|b_15|9|A|2|9(2)|||||||",
"WO|10|datda/old-dat1/working-data/optfde01|b_15|11|A|2|9(2)|||||||",
"WO|10|datyr/old-dat1/working-data/optfde01|b_15|13|A|4|9(4)|||||||",
"WO|5|new-date/working-data/optfde01|b_15|17|N|8|9(8)||8|16|8|||",
"WO|5|new-dat1/working-data/optfde01|b_15|17|G|8||||||||",
"WO|10|datyr/new-dat1/working-data/optfde01|b_15|17|A|4|9(4)|||||||",
"WO|10|datmo/new-dat1/working-data/optfde01|b_15|21|A|2|9(2)|||||||",
"WO|10|datda/new-dat1/working-data/optfde01|b_15|23|A|2|9(2)|||||||",
"WO|5|my-counters/working-data/optfde01|b_15|25|G|23|||23|1||||",
"WO|10|FILLER/my-counters/working-data/optfde01|b_15|25|A|18|X(18)|||||||",
"WO|10|custmas-ctr/my-counters/working-data/optfde01|b_15|43|N|5|9(5)||5|16|5|||",
"LO|1|oeit/optfde01|||G|35||||||||",
"LO|5|oeit-custnum/oeit/optfde01|||N|6|9(6)|||||||",
"LO|5|oeit-orddate/oeit/optfde01||6|N|8|9(8)|||||||",
"LO|5|oeit-ordnum/oeit/optfde01||14|N|2|99|||||||",
"LO|5|oeit-rectype/oeit/optfde01||16|A|1|X|||||||",
"LO|5|oeit-lineno/oeit/optfde01||17|N|2|99|||||||",
"LO|5|oeit-ponum/oeit/optfde01||19|A|8|X(8)|||||||",
"LO|5|oeit-filler/oeit/optfde01||27|A|8|X(8)|||||||",
"LO|1|oeitl/optfde01||48|G|35||||||||",
"LO|5|oeitl-custnum/oeitl/optfde01||48|N|6|9(6)|||||||",
"LO|5|oeitl-orddate/oeitl/optfde01||54|N|8|9(8)|||||||",
"LO|5|oeitl-ordnum/oeitl/optfde01||62|N|2|99|||||||",
"LO|5|oeitl-rectype/oeitl/optfde01||64|A|1|X|||||||",
"LO|5|oeitl-lineno/oeitl/optfde01||65|N|2|99|||||||",
"LO|5|oeitl-prodnum/oeitl/optfde01||67|N|8|9(8)|||||||",
"LO|5|oeitl-qty/oeitl/optfde01||75|N|8|9(8)|||||||",
"LO|1|ordmast/optfde01||96|G|24||||||||",
"LO|5|oeit-custnum/ordmast/optfde01||96|N|6|9(6)|||||||",
"LO|5|oeit-orddate/ordmast/optfde01||102|N|8|9(8)|||||||",
"LO|5|oeit-ordnum/ordmast/optfde01||110|N|2|99|||||||",
"LO|5|oeit-ponum/ordmast/optfde01||112|A|8|X(8)|||||||",
"LO|1|ordline/optfde01||128|G|18||||||||",
"LO|5|oeitl-lineno/ordline/optfde01||128|N|2|99|||||||",
"LO|5|oeitl-prodnum/ordline/optfde01||130|N|8|9(8)|||||||",
"LO|5|oeitl-qty/ordline/optfde01||138|N|8|9(8)|||||||",
(char *)(0)
};
*.c
*.sym.c
*.c.*
*.h
*.lst
......
......@@ -28,9 +28,9 @@ ASSEMBLER=$(shell gcc --print-prog-name as)
LOADER=$(shell gcc --print-prog-name ld)
COBC = cobc
# These paths are established for local debugging. Most likely the cobst and
# These paths are established for local debugging. Most likely the cobst and
# obmod executables will find their way into /usr/local/bin/ for production
# purposes. You Have Been Warned.
# purposes. You Have Been Warned.
COBST = ../../cobst/cobst
OBMOD = ../../obmod/obmod
......@@ -51,15 +51,19 @@ $(project) : $(project).cbl $(OBMOD) $(COBST)
@# used by obmod and
$(COBST) $(project).cbl
@# Compile the cobst-generated .sym.c file
gcc -O0 -c -o $(project).sym.o $(project).sym.c
@# obmod creates a modified relocatable .o ELF file from project.tab and
@# the .o file created by cobc
$(OBMOD) -i $(project).o -t $(project).tab -o $(project).cbl.o
@# This second invocation of cobc creates the modified ELF executable from
@# the modified .o ELF relocatable
#$(COBC) -x -o $(project) $(project).cbl.o $(project).sym.o
$(COBC) -x -o $(project) $(project).cbl.o
# This rule creates project.x, which is an unmodified ELF executable created
# with all the same switches as the modified one. The debugging information
# will thus point to the intermediate .c code
......@@ -81,7 +85,7 @@ $(project).s : $(project).cbl
# .txt files that might be lying around; I often create .txt files
# from dwarfdump and hexdump.
.PHONY : clean
suffixes = .c .s *.h .i .lst .cbl.lst .full.tab .tab .o .cbl.o .x
suffixes = .c .s *.h .i .lst .cbl.lst .full.tab .tab .o .cbl.o .x .sym.c .sym.o
clean:
rm -f $(addprefix $(project),$(suffixes)) $(project) *.txt $(CLEAN)
......
......@@ -3,6 +3,7 @@ boat.o
launchso.o
launchso
elbarco.c
elbarco.sym.c
elbarco.c.h
elbarco.c.l.h
elbarco.c.l1.h
......
dd_output
optfde01
optfde01.c
optfde01.sym.c
optfde01.c.h
optfde01.c.l.h
optfde01.cbl.lst
......
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