Commit beb4853f authored by rdubner's avatar rdubner
Browse files

First appearance of 'Version4.5'. Handles 'cobcd -x rtest.cbl say.o'

parent 57225f79
2020-11-11 Bob Dubner <rdubner@symas.com>
* First appearance of Version 4.5
* Handles 'cobcd -x rtest.cbl say.o'
* Eliminate traceback from 'cobcd --info'
2020-10-22 Bob Dubner <rdubner@symas.com>
* Initial regression testing seems operable. See ../tests
......
......@@ -210,7 +210,7 @@ def Main() :
## The text "Version x.x" has to appear in square brackets. #
## Don't mess with it! #
###########################################################################
SCRIPT_VERSION="[Version 4.4]"
SCRIPT_VERSION="[Version 4.5]"
SHOW_TIME = True # For timing analysis. Won't work on Python2
SHOW_TIME = False
......@@ -317,6 +317,8 @@ def Main() :
ASKED_FOR_HELP=False
ASKED_FOR_VERSION=False
TO_BE_LINKED_AT_THE_END=[]
DASH_V = ""
end_early = False
resultcode = 0
......@@ -344,6 +346,10 @@ def Main() :
do_not_process = False
params.append(param)
continue
if param[-2:] == ".o" or param[-2:] == ".O" :
## Sequester .o object files until the final link
TO_BE_LINKED_AT_THE_END.append(param)
continue
if param in ("-D","-A","-Q") :
# These three can be followed by a quoted item that has to go through intact,
# because `-Q "l gdb"` is very different from `-Q -l gdb`
......@@ -730,25 +736,26 @@ def Main() :
lap_start = time_now
if resultcode == 0 :
TO_BE_LINKED_AT_THE_END += [FILE_SYM_O,FILE_O]
# It is now time to build up the final link command. Based on the
# -### command we executed up above, we have to replace
# the -o target with our TARGET, and we need to replace either
# "/tmp/cob7653_0.o" (from a -x or -b compilation) or "/tmp/cob7684_0.c"
# (from a -m compilation) with our .o files:
FINAL_COMMAND = FINAL_COMMAND[FINAL_COMMAND.find(':')+2:]
FINAL_COMMAND = FINAL_COMMAND.replace('"','')
C1 = FINAL_COMMAND.split()
FINAL_COMMAND = []
i = 0
while i < len(C1) :
token = C1[i].replace('"','')
token = C1[i]
if token == '-o' :
FINAL_COMMAND.append(token)
FINAL_COMMAND.append(TARGET)
i += 2
continue
elif token[-2:] in (".o",".c") :
FINAL_COMMAND.append(FILE_SYM_O)
FINAL_COMMAND.append(FILE_O)
FINAL_COMMAND += TO_BE_LINKED_AT_THE_END
i += 1
continue
FINAL_COMMAND.append(token)
......@@ -828,13 +835,17 @@ def Main() :
DeleteAFile(FILE_SYM_O)
## Time to delete all the files in FILE_DELETE_US
f = open(FILE_DELETE_US,"r")
all_the_files = f.read()
all_the_files = all_the_files.replace('\r','') # Windows. Always Windows
all_the_files = all_the_files.split('\n')
for file in all_the_files :
DeleteAFile(file)
f.close()
try :
f = open(FILE_DELETE_US,"r")
all_the_files = f.read()
all_the_files = all_the_files.replace('\r','') # Windows. Always Windows
all_the_files = all_the_files.split('\n')
for file in all_the_files :
DeleteAFile(file)
f.close()
except :
## If the file doesn't exist, then it doesn't exist
pass
elif COBCDNOCLEAN == "" and SAVE_TEMPS != "" :
## With just SAVE_TEMPS, we just leave the files that
## COBC historically left around:
......
......@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::## Don't mess with it! #
::###########################################################################
::
set VERSION=[Version 4.4]
set VERSION=[Version 4.5]
::
::
:: Stupendously useful:
......
......@@ -4,4 +4,4 @@
// On the Unix side, there is scripting trickery to propogate this version
// code into cobcd.py and the names of packages when they are created.
#define VERSION "4.4"
#define VERSION "4.5"
project = optfde01
#free = --free
free =
# disable built-in rules:
.SUFFIXES:
......@@ -19,14 +17,12 @@ all: $(project)
# Note that it is this srule/script that will have to be copied elsewhere to
# compile .cbl sources for gdb debugging
$(project) : $(project).cbl
COBCDXM=-x $(COBCD) $<
$(COBCD) -x $<
# This cleans up the various intermediate project files
# This cleans up the various project files, along with any additional
# $(CLEAN) files specified by the parent Makefile It also clobbers any
# .txt files that might be lying around; I often create .txt files
# from dwarfdump and hexdump.
.PHONY : clean
suffixes = .c *.h .i .lst .cbl.lst .full.tab .tab .o .cbl.o
suffixes = .c *.h .i .o .sym.o .sym.c .s
clean:
@rm -f $(addprefix $(project),$(suffixes)) $(project) *.txt $(CLEAN) $(project)-gdb.py
......@@ -2436,7 +2436,7 @@ class CPrint (gdb.Command) :
actual_command = "print"
if self.Worker.use_cprint == 1 :
actual_command = "cprint"
print('registering CPrint (Usage is "' + actual_command + '" <COBOL identifier>") [Version 4.4]')
print('registering CPrint (Usage is "' + actual_command + '" <COBOL identifier>") [Version 4.5]')
super (CPrint, self).__init__ (actual_command, gdb.COMMAND_USER)
def invoke (self, arguments, from_tty):
......
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