Commit 99d5256f authored by Simon Sobisch's avatar Simon Sobisch

update from 'main/version427' into patch-20

* main/version427:
  Added 'make dev' to tests
  fix indent issue
  Test runner adjustments
  change python3 iterator to be the default
  make: replacing of version string
  Test runner adjustments
parents 198cc4a9 1dfb2849
......@@ -13,21 +13,21 @@ if echo $(uname -o) | grep -qi solaris
SED=gsed
fi
if ! test -f $1 ; then
echo "Couldn't find the target file $1"
if ! test -f "$1" ; then
echo "Couldn't find the target file '$1'"
exit 1
fi
VERSION_FILE=$2
if ! test -f $VERSION_FILE ; then
echo "Couldn't find the version.h file $VERSION_FILE"
if ! test -f "$VERSION_FILE" ; then
echo "Couldn't find the version.h file '$VERSION_FILE'"
exit 1
fi
## Extract '2.4' from '#define VERSION "2.4"'
input="$VERSION_FILE"
while read -r line
while IFS=$'\n\r' read -r line
do
IFS=' '; arrIN=($line); unset IFS;
## Find the line in question:
......@@ -37,10 +37,10 @@ while read -r line
fi
done < "$input"
VERSION_STRING='[Version '$VERSION']'
VERSION_STRING="[Version $VERSION]"
## We need to replace the existing out-of-date version string
## with our new one
echo Updating $1 to $VERSION_STRING
echo "Updating '$1' to '$VERSION_STRING'"
$SED -i -r "s/[[]Version.*[]]/$VERSION_STRING/g" $1
......@@ -4667,7 +4667,8 @@ class CCondition(gdb.Command):
Usage is `ccondition N COND', where N is an integer and COND is a COBOL
expression to be evaluated whenever breakpoint N is reached.
Do "help cbreak" for info on COBOL expressions"""
Do "help cbreak" for info on COBOL expressions."""
def __init__(self):
self.worker = CBLDBG_CBREAK_WORKER
......@@ -5053,11 +5054,11 @@ class CFrameWorker:
else:
old_frame = frame
frame = frame.newer()
if frame is None:
# on the way down we may see an outer COBOL frame last, then take that
if old_frame != gdb.selected_frame() and CFrameWorker.is_cobol_frame(old_frame):
return old_frame
return None
if frame is None:
# on the way down we may see an outer COBOL frame last, then take that
if old_frame != gdb.selected_frame() and CFrameWorker.is_cobol_frame(old_frame):
return old_frame
return None
else:
number = -1
......@@ -5099,7 +5100,7 @@ class CFrameWorker:
frame = CFrameWorker.Frame(up, number)
if not frame:
# note: we raise here to prevent hookpost-defines to be triggered
# note: we raise here to prevent hookpost-defines to be triggered
if up:
ConditionalRaise("Initial COBOL frame selected; you cannot go up.")
else:
......@@ -5152,6 +5153,7 @@ may be used to also stop if the current frame is a COBOL frame."""
def invoke(self, argument, from_tty):
CFrameWorker.Go(argument, False, True)
class CBacktrace (gdb.Command):
"""Print backtrace of all COBOL stack frames (common backtrace, filtered).
For detailed usage see 'help backtrace'."""
......@@ -5188,13 +5190,8 @@ class ElideNonCobolIterator():
def __iter__(self):
return self
# python3 iteration
def __next__(self):
return self.next()
# python2 iteration
def next(self):
if self.next_frame is None:
frame = next(self.input_iterator)
else:
......@@ -5219,6 +5216,10 @@ class ElideNonCobolIterator():
# pass non-COBOL-inner-frames as-is
return frame
# python2 iteration
def next(self):
return self.__next__()
class CobolFrameFilter():
def __init__(self):
self.name = "COBOL-FrameFilter"
......@@ -5255,13 +5256,8 @@ class RemoveNonCobolIterator():
def __iter__(self):
return self
# python3 iteration
def __next__(self):
return self.next()
# python2 iteration
def next(self):
frame = next(self.input_iterator)
real_frame = frame.inferior_frame()
......@@ -5275,7 +5271,11 @@ class RemoveNonCobolIterator():
# we have nothing returned yet, but an outer frame --> return as-is
return frame
return self.next()
return self.__next__()
# python2 iteration
def next(self):
return self.__next__()
class CobolOnlyFrameFilter():
def __init__(self):
......
COBCD?=../../cobcd
PYTHON?=/usr/bin/python3
COBCD?=$(PYTHON) ../../cobcd
COBCDRW?=../../cobcd-rw/cobcd-rw
GDB?=gdb
# For reasons that remain unknown -- probably because of the older
......@@ -24,18 +26,23 @@ all:
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > known-good.txt
../strip-diff known-good.txt >$(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > known-good.txt
$(PYTHON) ../strip-diff known-good.txt >$(knowngood).stripped
test:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
dev:
# For development: launch test under GDB.
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) -x ../../python/cobcd.py test
testprod:
cobcd -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 $(GDB) --batch -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
COBCD?=../../cobcd
PYTHON?=/usr/bin/python3
COBCD?=$(PYTHON) ../../cobcd
COBCDRW?=../../cobcd-rw/cobcd-rw
GDB?=gdb
# For reasons that remain unknown -- probably because of the older
......@@ -26,18 +28,23 @@ all:
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > known-good.txt
../strip-diff known-good.txt >$(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > known-good.txt
$(PYTHON) ../strip-diff known-good.txt >$(knowngood).stripped
test:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
dev:
# For development: launch test under GDB.
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) -x ../../python/cobcd.py test
testprod:
cobcd -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 $(GDB) --batch -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
COBCD?=../../cobcd
PYTHON?=/usr/bin/python3
COBCD?=$(PYTHON) ../../cobcd
COBCDRW?=../../cobcd-rw/cobcd-rw
GDB?=gdb
# For reasons that remain unknown -- probably because of the older
# version of GDB, but who knows? -- the response on RedHat7 isn't quite
# the same as for Ubuntu.
......@@ -28,27 +29,32 @@ all:
# way to override it from inside the GDB test.scr script.
known-good:
COBCDEVEL=1 $(COBCD) -o test -x MAIN.cbl
COBCDEVEL=1 $(COBCD) -m A.cbl
COBCDEVEL=1 $(COBCD) -m B.cbl
COBCDEVEL=1 $(COBCD) -m C.cbl
CPRINT_RAISE=0 CPRINT_V=3 $(GDB) -x test.scr > known-good.txt
../strip-diff known-good.txt >$(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -o test -x MAIN.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -m A.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -m B.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -m C.cbl
CPRINT_RAISE=0 CPRINT_V=3 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > known-good.txt
$(PYTHON) ../strip-diff known-good.txt >$(knowngood).stripped
test:
COBCDEVEL=1 $(COBCD) -o test -x MAIN.cbl
COBCDEVEL=1 $(COBCD) -m A.cbl
COBCDEVEL=1 $(COBCD) -m B.cbl
COBCDEVEL=1 $(COBCD) -m C.cbl
CPRINT_RAISE=0 CPRINT_V=3 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -o test -x MAIN.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -m A.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -m B.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -m C.cbl
CPRINT_RAISE=0 CPRINT_V=3 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
dev:
# For development: launch test under GDB.
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 CPRINT_V=3 COBCDRW=$(COBCDRW) $(GDB) -x ../../python/cobcd.py test
testprod:
cobcd -o test -x MAIN.cbl
cobcd -m A.cbl
cobcd -m B.cbl
cobcd -m C.cbl
CPRINT_RAISE=0 CPRINT_RAISE=0 CPRINT_V=3 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 CPRINT_V=3 $(GDB) --batch -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
COBCD?=../../cobcd
PYTHON?=/usr/bin/python3
COBCD?=$(PYTHON) ../../cobcd
COBCDRW?=../../cobcd-rw/cobcd-rw
GDB?=gdb
# For reasons that remain unknown -- probably because of the older
......@@ -24,18 +26,23 @@ all:
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > known-good.txt
../strip-diff known-good.txt >$(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > known-good.txt
$(PYTHON) ../strip-diff known-good.txt >$(knowngood).stripped
test:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
dev:
# For development: launch test under GDB.
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) -x ../../python/cobcd.py test
testprod:
cobcd -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 $(GDB) --batch -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
COBCD?=../../cobcd
PYTHON?=/usr/bin/python3
COBCD?=$(PYTHON) ../../cobcd
COBCDRW?=../../cobcd-rw/cobcd-rw
GDB?=gdb
# For reasons that remain unknown -- probably because of the older
......@@ -24,18 +26,23 @@ all:
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > known-good.txt
../strip-diff known-good.txt >$(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > known-good.txt
$(PYTHON) ../strip-diff known-good.txt >$(knowngood).stripped
test:
COBCDEVEL=1 $(COBCD) -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
dev:
# For development: launch test under GDB.
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) -x ../../python/cobcd.py test
testprod:
cobcd -x test.cbl
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 $(GDB) --batch -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
COBCD?=../../cobcd
PYTHON?=/usr/bin/python3
COBCD?=$(PYTHON) ../../cobcd
COBCDRW?=../../cobcd-rw/cobcd-rw
GDB?=gdb
UNAME_O := $(shell uname -o)
......@@ -35,30 +37,35 @@ all:
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
ifeq ($(gdbmajor),7)
@echo "This function is suppressed in systems with GDB-7"
else
CPRINT_RAISE=0 $(GDB) -x test.scr > known-good.txt
../strip-diff known-good.txt >$(knowngood).stripped
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > known-good.txt
$(PYTHON) ../strip-diff known-good.txt >$(knowngood).stripped
endif
test:
COBCDEVEL=1 $(COBCD) -x test.cbl
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
ifeq ($(gdbmajor),7)
@echo "This function is suppressed in systems with GDB-7"
else
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) --batch -x ../../python/cobcd.py -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
endif
dev:
# For development: launch test under GDB.
COBCDEVEL=1 COBCDFMODE=0 $(COBCD) -x test.cbl
CPRINT_RAISE=0 COBCDRW=$(COBCDRW) $(GDB) -x ../../python/cobcd.py test
testprod:
cobcd -x test.cbl
ifeq ($(gdbmajor),7)
@echo "This function is suppressed in systems with GDB-7"
else
CPRINT_RAISE=0 $(GDB) -x test.scr > under-test.txt
../strip-diff under-test.txt >under-test.stripped
diff -uw under-test.stripped $(knowngood).stripped
CPRINT_RAISE=0 $(GDB) --batch -x test.scr > under-test.txt
$(PYTHON) ../strip-diff under-test.txt >under-test.stripped
diff -uw $(knowngood).stripped under-test.stripped
endif
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