Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cbl-gdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Sobisch
cbl-gdb
Commits
2d22a995
Commit
2d22a995
authored
Aug 12, 2020
by
rdubner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RC 3.14. cobcd script logic to handle combined -abc parameters
parent
449303c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
14 deletions
+89
-14
cobcd
cobcd
+86
-11
cobcd.bat
cobcd.bat
+1
-1
include/version.h
include/version.h
+1
-1
python/cobcd.py
python/cobcd.py
+1
-1
No files found.
cobcd
View file @
2d22a995
...
...
@@ -63,7 +63,7 @@ print_help()
## Don't mess with it! #
###########################################################################
SCRIPT_VERSION
=
"[Version 3.1
3
]"
SCRIPT_VERSION
=
"[Version 3.1
4
]"
# 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
...
...
@@ -197,31 +197,106 @@ DASH_V=""
T_FLAG
=
""
SOURCEFILE
=
""
while
[
"$#"
!=
"0"
]
# This disturbing amount of code addresses the issue of combined
# single-character flags, e.g., "-xgd". It is complex because cobc
# accepts a number of switches that start with a single hyphen, but
# nonetheless have more than one letter, e.g., "-ext". So, although
# we want "-xgd" to turn into "-x -g -d", we need to leave "-ext" alone:
params
=
""
for
p
in
$@
do
if
[
X
"
$1
"
=
X
"--help"
]
if
echo
$p
|
grep
-qs
"^[^-]"
then
## It doesn't start with a single hyphen
params
=
"
$params
$p
"
continue
fi
if
echo
$p
|
grep
-qs
"^[-][-]"
then
## It starts with a double hyphen
params
=
"
$params
$p
"
continue
fi
if
echo
$p
|
grep
-qs
"^[-]f"
then
params
=
"
$params
$p
"
continue
fi
if
echo
$p
|
grep
-qs
"^[-]W"
then
params
=
"
$params
$p
"
continue
fi
if
echo
$p
|
grep
-qs
"^[-]O"
then
params
=
"
$params
$p
"
continue
fi
if
echo
$p
|
grep
-qs
"^[-]list"
then
params
=
"
$params
$p
"
continue
fi
## When you get here, you have a token with a single hyphen:
if
[
${#
p
}
-le
2
]
then
## It is only one or two characters long
params
=
"
$params
$p
"
continue
fi
# We have a hyphen and some letters
# extract those letters:
token
=
$(
echo
$p
|
sed
-E
"s/[-]([^=]+).*/
\\
1/g"
)
case
"
$token
"
in
"help"
|
"version"
|
"info"
|
"brief"
|
"###"
|
"verbose"
|
"vv"
|
"vvv"
|
\
"job"
|
"std"
|
"free"
|
"fixed"
|
"debug"
|
"Xref"
|
"conf"
|
"save-temps"
|
"ext"
\
)
params
=
"
$params
$p
"
continue
esac
## Arriving here means that you have, or you are supposed to have,
## some combined single-character switches
letters
=
$(
echo
$p
|
sed
-E
"s/(.)/
\\
1 /g"
)
for
letter
in
$letters
do
if
[
X
"
$letter
"
=
X
"-"
]
then
continue
fi
params
=
"
$params
-
$letter
"
done
done
for
param
in
$params
do
if
[
X
"
$param
"
=
X
"--help"
]
then
ASKED_FOR_HELP
=
yes
fi
if
[
X
"
$
1
"
=
X
"--version"
]
if
[
X
"
$
param
"
=
X
"--version"
]
then
ASKED_FOR_VERSION
=
yes
fi
if
[
X
"
$
1
"
=
X
"-v"
]
if
[
X
"
$
param
"
=
X
"-v"
]
then
DASH_V
=
-v
fi
if
echo
$
1
|
grep
-iqs
-e
"-t"
if
echo
$
param
|
grep
-iqs
-e
"-t"
then
T_FLAG
=
yes
fi
case
$
1
in
case
$
param
in
-x
|
-m
|
-b
)
COBCDXM
=
$
1
COBCDXM
=
$
param
;;
esac
COMMAND_LINE
=
"
$COMMAND_LINE
$1
"
shift
COMMAND_LINE
=
"
$COMMAND_LINE
$param
"
done
if
[
"
$COBCDXM
"
=
""
]
...
...
@@ -381,7 +456,7 @@ case "$os_name" in
DASH_F
=
""
DASH_S
=
""
esac
if
[
"ECHO"
]
then
DASH_Q
=
-q
...
...
cobcd.bat
View file @
2d22a995
...
...
@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::## Don't mess with it! #
::###########################################################################
::
set
VERSION
=[
Version
3
.1
3
]
set
VERSION
=[
Version
3
.1
4
]
::
::
set
argC
=
0
...
...
include/version.h
View file @
2d22a995
...
...
@@ -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 "3.1
3
"
#define VERSION "3.1
4
"
python/cobcd.py
View file @
2d22a995
...
...
@@ -3319,7 +3319,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 3.1
3
]'
)
print
(
'registering CPrint (Usage is "print <COBOL identifier>") [Version 3.1
4
]'
)
self
.
Worker
=
CPrintWorker
()
self
.
TabFile
=
TabFileInformation
();
self
.
TabFile
.
question_mark_range
=
self
.
Worker
.
question_mark_range
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment