Commit 6aaaacd4 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Dumper: Remove unused variables

Add a missing call to removeTempFile

Change-Id: Iea21102ed54e372f6c2991ac31fef008962f0638
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent b93751e2
......@@ -189,7 +189,7 @@ try:
block = block.superblock
else:
# Assuming gdb 7.0 release or 6.8-symbianelf.
filename, file = createTempFile()
filename = createTempFile()
#warn("VARLIST: %s " % varList)
#warn("FILENAME: %s " % filename)
gdb.execute("set logging off")
......@@ -230,7 +230,7 @@ try:
temp.close()
except:
pass
removeTempFile(filename, file)
removeTempFile(filename)
#warn("VARLIST: %s " % varList)
for name in varList:
#warn("NAME %s " % name)
......@@ -260,7 +260,7 @@ try:
return gdb.execute(command, to_string=True).split("\n")
except:
pass
filename, file = createTempFile()
filename = createTempFile()
gdb.execute("set logging off")
gdb.execute("set logging redirect off")
gdb.execute("set logging file %s" % filename)
......@@ -280,13 +280,14 @@ try:
if len(msg):
# Having that might confuse result handlers in the gdbengine.
#warn("CLI ERROR: %s " % msg)
removeTempFile(filename)
return "CLI ERROR: %s " % msg
temp = open(filename, "r")
lines = []
for line in temp:
lines.append(line)
temp.close()
removeTempFile(filename, file)
removeTempFile(filename)
return lines
def selectedInferior():
......
......@@ -24,11 +24,12 @@ tempFileCounter = 0
try:
# Test if 2.6 is used (Windows), trigger exception and default
# to 2nd version.
tempfile.NamedTemporaryFile(prefix="py_",delete=True)
file = tempfile.NamedTemporaryFile(prefix="py_",delete=True)
file.close()
def createTempFile():
file = tempfile.NamedTemporaryFile(prefix="py_",delete=False)
file = tempfile.NamedTemporaryFile(prefix="py_",delete=True)
file.close()
return file.name, file
return file.name
except:
def createTempFile():
......@@ -36,9 +37,9 @@ except:
tempFileCounter += 1
fileName = "%s/py_tmp_%d_%d" \
% (tempfile.gettempdir(), os.getpid(), tempFileCounter)
return fileName, None
return fileName
def removeTempFile(name, file):
def removeTempFile(name):
try:
os.remove(name)
except:
......
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