Commit c1be1457 authored by rdubner's avatar rdubner

Modified CBL-GDB scripts and code to compile on SPARC/SOLARIS

parent 4bd3335f
......@@ -7,6 +7,12 @@
##
## Usage is version-replace in-file version.h
SED=sed
if echo $(uname -o) | grep -qi solaris
then
SED=gsed
fi
if ! test -f $1 ; then
echo "Couldn't find the target file $1"
exit 1
......@@ -27,7 +33,7 @@ while read -r line
## Find the line in question:
if test X"${arrIN[0]}" == X"#define" && test X"${arrIN[1]}" == X"VERSION" ; then
# Remove the leading and trailing double-quotes:
VERSION=$(sed -e 's/^"//' -e 's/"$//' <<<"${arrIN[2]}")
VERSION=$($SED -e 's/^"//' -e 's/"$//' <<<"${arrIN[2]}")
fi
done < "$input"
......@@ -36,5 +42,5 @@ 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
sed -i -r "s/[[]Version.*[]]/$VERSION_STRING/g" $1
$SED -i -r "s/[[]Version.*[]]/$VERSION_STRING/g" $1
......@@ -211,7 +211,7 @@ def Main() :
## The text "Version x.x" has to appear in square brackets. #
## Don't mess with it! #
###########################################################################
SCRIPT_VERSION="[Version 4.5]"
SCRIPT_VERSION="[Version 4.6]"
SHOW_TIME = True # For timing analysis. Won't work on Python2
SHOW_TIME = False
......
......@@ -44,13 +44,17 @@
#include <stdio.h>
#include <string.h>
#ifndef __sun
#include "getopt.h"
#endif
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
optopt, /* character checked for validity */
optreset = 0; /* reset getopt */
#ifndef __sun
char const * optarg; /* argument associated with option */
#endif
#undef BADCH
#define BADCH (int)'?'
......@@ -101,7 +105,7 @@ getopt(int nargc, char * const * nargv, const char * ostr)
} else {
/* need an argument */
if (*place) /* no white space */
optarg = place;
optarg = (char *)place;
else if (nargc <= ++optind) { /* no arg */
place = EMSG;
if (*ostr == ':')
......
......@@ -44,13 +44,17 @@
#include <stdio.h>
#include <string.h>
#ifndef __sun
#include "getopt.h"
#endif
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
optopt, /* character checked for validity */
optreset = 0; /* reset getopt */
#ifndef __sun
char const * optarg; /* argument associated with option */
#endif
#undef BADCH
#define BADCH (int)'?'
......@@ -101,7 +105,7 @@ getopt(int nargc, char * const * nargv, const char * ostr)
} else {
/* need an argument */
if (*place) /* no white space */
optarg = place;
optarg = (char *)place;
else if (nargc <= ++optind) { /* no arg */
place = EMSG;
if (*ostr == ':')
......
......@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::## Don't mess with it! #
::###########################################################################
::
set VERSION=[Version 4.5]
set VERSION=[Version 4.6]
::
::
:: 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.5"
#define VERSION "4.6"
......@@ -4,9 +4,6 @@ project=cobcd.py
prefix ?=/usr/local
AUTO_LOAD_FOUND := $(shell grep -s -e "^[ \t]*set auto-load safe-path /" ~/.gdbinit | wc -l)
AUTO_SCRIPTS_FOUND := $(shell grep -s -e "^[ \t]*set auto-load python-scripts on" ~/.gdbinit | wc -l)
.PHONY: all
all : cobcd.py
......
......@@ -2456,7 +2456,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.5]')
print('registering CPrint (Usage is "' + actual_command + '" <COBOL identifier>") [Version 4.6]')
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