Wrapped the subclass-specific cleanup call within a try:except: clause.

And removed the informational output from the conditional_break test case.

llvm-svn: 114493
This commit is contained in:
Johnny Chen 2010-09-21 22:34:45 +00:00
parent 6f8bd42ec7
commit 90312a8492
3 changed files with 13 additions and 8 deletions

View File

@ -57,7 +57,7 @@ class ConditionalBreakTestCase(TestBase):
process = target.GetProcess() process = target.GetProcess()
thread = process.GetThreadAtIndex(0) thread = process.GetThreadAtIndex(0)
import lldbutil import lldbutil
lldbutil.PrintStackTrace(thread) #lldbutil.PrintStackTrace(thread)
if thread.GetNumFrames() >= 2: if thread.GetNumFrames() >= 2:
frame0 = thread.GetFrameAtIndex(0) frame0 = thread.GetFrameAtIndex(0)

View File

@ -24,15 +24,16 @@ def stop_if_called_from_a():
# of the leaf function c() is a(). If it's not the right caller, we ask the # of the leaf function c() is a(). If it's not the right caller, we ask the
# command interpreter to continue execution. # command interpreter to continue execution.
print >> sys.stdout, "Checking call frames..." #print >> sys.stdout, "Checking call frames..."
lldbutil.PrintStackTrace(thread) #lldbutil.PrintStackTrace(thread)
if thread.GetNumFrames() >= 2: if thread.GetNumFrames() >= 2:
funcs = lldbutil.GetFunctionNames(thread) funcs = lldbutil.GetFunctionNames(thread)
print >> sys.stdout, funcs[0], "called from", funcs[1] #print >> sys.stdout, funcs[0], "called from", funcs[1]
if (funcs[0] == 'c' and funcs[1] == 'a'): if (funcs[0] == 'c' and funcs[1] == 'a'):
print >> sys.stdout, "Stopped at c() with immediate caller as a()." #print >> sys.stdout, "Stopped at c() with immediate caller as a()."
pass
else: else:
print >> sys.stdout, "Continuing..." #print >> sys.stdout, "Continuing..."
ci.HandleCommand("process continue", res) ci.HandleCommand("process continue", res)
return True return True

View File

@ -96,7 +96,7 @@ OK
$ $
""" """
import os, sys import os, sys, traceback
import re import re
from subprocess import * from subprocess import *
import time import time
@ -305,7 +305,11 @@ class TestBase(unittest2.TestCase):
if getattr(cls, "classCleanup", None): if getattr(cls, "classCleanup", None):
if traceAlways: if traceAlways:
print "Call class-specific cleanup function for class:", cls print "Call class-specific cleanup function for class:", cls
cls.classCleanup() try:
cls.classCleanup()
except:
exc_type, exc_value, exc_tb = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_tb)
# Restore old working directory. # Restore old working directory.
if traceAlways: if traceAlways: