Commit 7bf2964c authored by rdubner's avatar rdubner

Use struct.calcsize() for 32/64-bit determination; modify known-good

parent b1564561
......@@ -19,7 +19,7 @@ all: $(project)
# Note that it is this srule/script that will have to be copied elsewhere to
# compile .cbl sources for gdb debugging
$(project) : $(project).cbl
COBCDXM=-x $(COBCD) $<
COBCDXM=-x $(COBCD) $<
# This cleans up the various project files, along with any additional
# $(CLEAN) files specified by the parent Makefile It also clobbers any
......
......@@ -32,6 +32,15 @@
# This module implements the gdb extension commands cprint and cwatch
## Catalog of environment variables interpreted by this module:
##
## os.environ.get('CPRINT_D','0') When non-zero, causes verbose output
## os.environ.get('CPRINT_E') Can be present when cobglobptr isn't available.
## three-character string e.g., ".$," for "decimal, currency, separator"
## os.environ.get('CPRINT_V', '0') Default formatting p/v N value
## os.environ.get('CPRINT_R', '6')) Default p/? range
## os.environ.get('CPRINT', '0')) When non-zero, registers "cprint" instead of "print" as the command
from __future__ import print_function
import re
......@@ -43,6 +52,7 @@ import subprocess
import ctypes
from ctypes import *
from inspect import currentframe, getframeinfo
from struct import calcsize
# This module implements the gdb extension commands cprint and cwatch
#
......@@ -156,14 +166,7 @@ class GlobalVariables() :
self.debug_level = int(os.environ.get('CPRINT_D','0'))
## Let's figure out if we are a 32-bit or 64-bit machine:
self.SizeofPointer = 4 # Assume 32-bit
command="show architecture"
arch = GdbExecute2(currentframe(),command,self.debug_level)
nfound = arch.find("x86-64")
if nfound == -1 :
nfound = arch.find("sparc")
if nfound != -1 :
self.SizeofPointer = 8
self.SizeofPointer = calcsize('P') # Returns 4 or 8
## Establish the size of a c-side int
self.SizeofInt = ctypes.sizeof(ctypes.c_int)
......
......@@ -3,7 +3,7 @@ DIRECTORIES = $(sort $(wildcard */))
.PHONY : known-good test $(DIRECTORIES) all
all :
@echo "Your choices are 'make known-good' and 'make test'"
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good : $(DIRECTORIES)
@for dir in $(DIRECTORIES) ; \
......
......@@ -4,7 +4,7 @@ GDB?=gdb
.PHONY : known-good test all testprod
all:
@echo "Your choices are 'make known-good' and 'make test'"
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
......
......@@ -4,7 +4,7 @@ GDB?=gdb
.PHONY : known-good test all testprod
all:
@echo "Your choices are 'make known-good' and 'make test'"
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -x test.cbl
......
......@@ -4,7 +4,8 @@ GDB?=gdb
.PHONY : known-good test all testprod
all:
@echo "Your choices are 'make known-good' and 'make test'"
@echo "Your choices are 'make known-good' and 'make test' and 'make testprod'"
known-good:
COBCDEVEL=1 $(COBCD) -o test -x MAIN.cbl
COBCDEVEL=1 $(COBCD) -m A.cbl
......
This diff is collapsed.
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