Commit 8f2cd365 authored by rdubner's avatar rdubner

First appearance of 3.13. 'print ?' now finds .cbl source files in other directories.

parent c2fbcde2
......@@ -63,7 +63,7 @@ print_help()
## Don't mess with it! #
###########################################################################
SCRIPT_VERSION="[Version 3.12]"
SCRIPT_VERSION="[Version 3.13]"
# 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
......
......@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::## Don't mess with it! #
::###########################################################################
::
set VERSION=[Version 3.12]
set VERSION=[Version 3.13]
::
::
set argC=0
......
......@@ -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.12"
#define VERSION "3.13"
......@@ -2840,6 +2840,7 @@ class TabFileInformation() :
self.current_trapped_file = ""
self.current_trapped_line = 0
self.question_mark_range = 6
self.current_full_path = ""
def ReadVariableString(self, string_name) :
retval = ""
......@@ -2910,35 +2911,49 @@ class TabFileInformation() :
file_and_line = tokens[-1].split(':')
self.current_trapped_line = int(file_and_line[1])
try :
if file_and_line[0] != self.current_trapped_file :
# We are in a new file
self.current_trapped_file = file_and_line[0]
# Find the address of the VARIABLE_STRING for this file
name_root = self.current_trapped_file
name_root = name_root.split('/')
name_root = name_root[-1]
name_root = name_root.replace('.','_')
string_name = "VARIABLE_STRING_" + name_root.upper()
self.ReadVariableString(string_name)
# We have us a new variable string
# Clear out the tables:
# Load the new tables
self.var_trie = VarTrie()
self.line_list = LineList()
# Pull apart the variable_string
variable_lines = self.current_variable_string.split("~")
for variable_line in variable_lines :
self.line_list.LoadFromLine(variable_line)
self.var_trie.LoadFromLine(variable_line)
# Put a fencepost at the end of the line_list
self.line_list.Insert(self.line_list.EndOfTheWorld,"Ragnarok")
if file_and_line[0] != self.current_trapped_file :
# We are in a new file
self.current_trapped_file = file_and_line[0]
# Find the address of the VARIABLE_STRING for this file
name_root = self.current_trapped_file
name_root = name_root.split('/')
name_root = name_root[-1]
name_root = name_root.replace('.','_')
string_name = "VARIABLE_STRING_" + name_root.upper()
self.ReadVariableString(string_name)
# We have us a new variable string
# Clear out the tables:
# Load the new tables
self.var_trie = VarTrie()
self.line_list = LineList()
# Pull apart the variable_string
variable_lines = self.current_variable_string.split("~")
for variable_line in variable_lines :
self.line_list.LoadFromLine(variable_line)
self.var_trie.LoadFromLine(variable_line)
# Put a fencepost at the end of the line_list
self.line_list.Insert(self.line_list.EndOfTheWorld,"Ragnarok")
# Get the full path for the source file
info_source = gdb.execute("info source",False,True)
info_source = info_source.split('\n')
for line in info_source :
pattern = re.compile(r"Located in (.*)$")
match = re.search(pattern,line)
if match :
self.current_full_path = match.group(1)
break
except :
traceback.print_exc()
def ReadSymbolTableText(self) :
......@@ -2985,12 +3000,12 @@ def MetaPossibilities(args,TabFile,ShortTermMemory,machine_interface_mode,rside)
# rather than NEXT. By keeping one stage of stickiness, the display of variables
# will be a bit more like what the user probably expects.
if len(TabFile.current_trapped_file) > 0 :
if len(TabFile.current_full_path) > 0 :
range = TabFile.question_mark_range;
if range < 0 :
range = 1000000000
return_string = subprocess.check_output(["cobcd-rw", \
TabFile.current_trapped_file, \
TabFile.current_full_path, \
str(TabFile.current_trapped_line), \
str(range) ])
tokens = return_string.split()
......@@ -3294,7 +3309,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.12]')
print('registering CPrint (Usage is "print <COBOL identifier>") [Version 3.13]')
self.Worker = CPrintWorker()
self.TabFile = TabFileInformation();
self.TabFile.question_mark_range = self.Worker.question_mark_range
......
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