Commit d523cc05 authored by rdubner's avatar rdubner

First appearance of 2.9. Correct big-/little-endian display in CPRINT. -b handling in cobcd script

parent 4bf71fde
......@@ -6,7 +6,7 @@
## Don't mess with it! #
###########################################################################
# [Version 2.8]
# [Version 2.9]
# This script, nominally named cobcd, packages up the process of compiling
# a single COBOL source module and processing it so that gdb can be used for
......@@ -38,7 +38,7 @@
#
# COBCDFLAGS ## Use for things like --free
#
# COBCDXM=[-x|-m] ## cobc assumes a default of -m
# COBCDXM=[-x|-m|-b] ## cobc assumes a default of -m
set +e ## This kind of needs to be +e in order to make sure intermediate files
## get cleaned up in the event of compilation errors
......@@ -226,6 +226,7 @@ while (( $# )) ; do
# This is a -o switch.
# Save the parameter as our ultimate target
shift
PARM=$1
TARGET=$PARM
elif test X$FIRSTTHREE = X"-t=" || test X$FIRSTTHREE = X"-T=" ; then
# We know a -t=this or -T=that switch will break our compilation, so just ignore it
......@@ -235,7 +236,7 @@ while (( $# )) ; do
# ignore the switch and the following parameter
ORIGINALRUN="yes"
shift
elif test X$PARM = X"-x" || test X$PARM = X"-m" ; then
elif test X$PARM = X"-x" || test X$PARM = X"-m" || test X$PARM = X"-b" ; then
# A command-line parameter overwhelms anything
# we inherited
COBCDXM=$PARM
......@@ -263,7 +264,7 @@ while (( $# )) ; do
done
if test X$COBCDXM = X"" ; then
# If neither -x nor -m was specified, explicitly match the COBC default of -m
# If neither -x nor -m nor -b was specified, explicitly match the COBC default of -m
COBCDXM=-m
fi
......@@ -274,7 +275,7 @@ BASENAME="${BASENAME##/*}"
# it'll be put in the current working directory
if test X$TARGET = X"" ; then
TARGET=$BASENAME
if test X$COBCDXM = X"-m" ; then
if test X$COBCDXM = X"-m" || test X$COBCDXM = X"-b" ; then
TARGET=$TARGET.so
fi
fi
......
......@@ -5,7 +5,7 @@
::## Don't mess with it! #
::###########################################################################
::
::# [Version 2.8]
::# [Version 2.9]
::
@ECHO OFF
SETLOCAL
......
......@@ -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 "2.8"
#define VERSION "2.9"
......@@ -1177,14 +1177,21 @@ class CobolVariable() :
print("Usage: " , self.Usage )
print("Size: " , self.ListSize )
print("pic_data: (HEX) [" , end= " ")
for byte in self.data :
## At this point, if BINARY_SWAP is on, our data are reversed.
## We want to unreverse them for this display:
output_bytes = self.data
if (self.AttrFlags & COB_FLAG_BINARY_SWAP) != 0 :
output_bytes.reverse()
for byte in output_bytes :
hexout = hex(byte)[-2:]
if hexout[0:1] == 'x' :
hexout = '0' + hexout[-1:]
print(hexout,end=" ")
print("]")
print("pic_data: (ASCII) \"", end = "")
for byte in self.data :
for byte in output_bytes :
if 32 <= byte < 128 : # valid ASCII characters
print(chr(byte),end="")
else :
......@@ -2060,6 +2067,7 @@ class CobolVariable() :
if (self.AttrFlags & COB_FLAG_BINARY_SWAP) != 0 :
our_bytes.reverse()
# we need to figure out if we are dealing with a signed
# we need to figure out if we are dealing with a signed
# and negative number.
......@@ -3145,7 +3153,7 @@ if 'gdb' in sys.modules :
## The text "Version x.x" has to appear in square brackets. #
## Don't mess with it! #
###########################################################################
print('registering CPrint (Usage is "print <COBOL identifier>") [Version 2.8]')
print('registering CPrint (Usage is "print <COBOL identifier>") [Version 2.9]')
self.Worker = CPrintWorker()
self.TabFile = TabFileInformation();
......
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