Ghidra is a software reverse engineering (SRE) framework
GT-3199: Corrected logging issue in pcodetest python error handling.
ghidorahrex74281c745d2d
diff --git a/Ghidra/Extensions/SleighDevTools/pcodetest/build.py b/Ghidra/Extensions/SleighDevTools/pcodetest/build.pyindex ca35c2b3ab..988edb84b6 100644--- a/Ghidra/Extensions/SleighDevTools/pcodetest/build.py+++ b/Ghidra/Extensions/SleighDevTools/pcodetest/build.py@@ -35,8 +35,8 @@ class BuildUtil(object):try:sp = subprocess.Popen(cmd, stdout=f, stderr=subprocess.PIPE)except OSError as e:- self.log_err(cmd)- self.log_err(e)+ self.log_err("Command: " + str)+ self.log_err(e.message)return 0,e.message#raiseif stdout: f.close()out, err = sp.communicate()@@ -185,25 +185,30 @@ class BuildUtil(object):self.num_errors = 0self.num_warnings = 0- def log_pr(self, what):+ def log_pr(self, prefix, what):+ if isinstance(what, basestring):+ log_string = prefix + what+ else:+ log_string = prefix + repr(what)+if self.log:- self.log.write(what + '\n')+ self.log.write(log_string + '\n')self.log.flush()else:- print what+ print log_stringsys.stdout.flush()def log_err(self, what):- self.log_pr('# ERROR: ' + what)+ self.log_pr('# ERROR: ', what)self.num_errors += 1def log_warn(self, what):- self.log_pr('# WARNING: ' + what)+ self.log_pr('# WARNING: ', what)self.num_warnings += 1def log_info(self, what):- self.log_pr('# INFO: ' + what)-+ self.log_pr('# INFO: ', what)+# create a file with size, type, and symbol info# the function is here because it is useful and has no dependencies