mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset c10672836664 (bug 1180984)
This commit is contained in:
parent
058164cadc
commit
717754c6c3
@ -15,7 +15,7 @@ import traceback
|
||||
try:
|
||||
# testlibdir is set on the GDB command line, via:
|
||||
# --eval-command python testlibdir=...
|
||||
exec(open(os.path.join(testlibdir, 'prologue.py')).read())
|
||||
execfile(os.path.join(testlibdir, 'prologue.py'))
|
||||
except Exception as err:
|
||||
sys.stderr.write('Error running GDB prologue:\n')
|
||||
traceback.print_exc()
|
||||
|
@ -23,9 +23,9 @@ def run_fragment(fragment, function='breakpoint'):
|
||||
# Assert that |actual| is equal to |expected|; if not, complain in a helpful way.
|
||||
def assert_eq(actual, expected):
|
||||
if actual != expected:
|
||||
raise AssertionError("""Unexpected result:
|
||||
raise AssertionError, """Unexpected result:
|
||||
expected: %r
|
||||
actual: %r""" % (expected, actual))
|
||||
actual: %r""" % (expected, actual)
|
||||
|
||||
# Assert that |value|'s pretty-printed form is |form|. If |value| is a
|
||||
# string, then evaluate it with gdb.parse_and_eval to produce a value.
|
||||
@ -44,10 +44,10 @@ def assert_subprinter_registered(printer, subprinter):
|
||||
pat = r'^( +)%(printer)s *\n(\1 +.*\n)*\1 +%(subprinter)s *\n' % names
|
||||
output = gdb.execute('info pretty-printer', to_string=True)
|
||||
if not re.search(pat, output, re.MULTILINE):
|
||||
raise AssertionError("assert_subprinter_registered failed to find pretty-printer:\n"
|
||||
" %s:%s\n"
|
||||
"'info pretty-printer' says:\n"
|
||||
"%s" % (printer, subprinter, output))
|
||||
raise AssertionError, ("assert_subprinter_registered failed to find pretty-printer:\n"
|
||||
" %s:%s\n"
|
||||
"'info pretty-printer' says:\n"
|
||||
"%s" % (printer, subprinter, output))
|
||||
|
||||
# Request full stack traces for Python errors.
|
||||
gdb.execute('set python print-stack full')
|
||||
@ -64,7 +64,7 @@ gdb.execute('set width 0')
|
||||
try:
|
||||
# testscript is set on the GDB command line, via:
|
||||
# --eval-command python testscript=...
|
||||
exec(open(testscript).read())
|
||||
execfile(testscript)
|
||||
except AssertionError as err:
|
||||
sys.stderr.write('\nAssertion traceback:\n')
|
||||
(t, v, tb) = sys.exc_info()
|
||||
|
@ -18,7 +18,7 @@ class JSSymbolPtr(mozilla.prettyprinters.Pointer):
|
||||
self.value = value
|
||||
|
||||
def to_string(self):
|
||||
code = int(self.value['code_']) & 0xffffffff
|
||||
code = int(self.value['code_'])
|
||||
desc = str(self.value['description_'])
|
||||
if code == InSymbolRegistry:
|
||||
return "Symbol.for({})".format(desc)
|
||||
|
@ -18,10 +18,6 @@ class Common(object):
|
||||
# the template member holds the referent directly.
|
||||
handle = False
|
||||
|
||||
# If True, we should strip typedefs from our referent type. (Rooted<T>
|
||||
# uses template magic that gives the referent a noisy type.)
|
||||
strip_typedefs = False
|
||||
|
||||
# Initialize a pretty-printer for |value|, using |cache|.
|
||||
#
|
||||
# If given, |content_printer| is a pretty-printer constructor to use for
|
||||
@ -46,8 +42,6 @@ class Common(object):
|
||||
ptr = self.value[self.member]
|
||||
if self.handle:
|
||||
ptr = ptr.dereference()
|
||||
if self.strip_typedefs:
|
||||
ptr = ptr.cast(ptr.type.strip_typedefs())
|
||||
if self.content_printer:
|
||||
return self.content_printer(ptr, self.cache).to_string()
|
||||
else:
|
||||
@ -59,7 +53,7 @@ class Common(object):
|
||||
|
||||
@template_pretty_printer("JS::Rooted")
|
||||
class Rooted(Common):
|
||||
strip_typedefs = True
|
||||
pass
|
||||
|
||||
@template_pretty_printer("JS::Handle")
|
||||
class Handle(Common):
|
||||
|
@ -25,7 +25,7 @@ def on_stop(event):
|
||||
AsmJSFaultHandler = gdb.parse_and_eval("AsmJSFaultHandler")
|
||||
if buf['__sigaction_handler']['sa_handler'] == AsmJSFaultHandler:
|
||||
# Advise the user that magic is happening.
|
||||
print("js/src/gdb/mozilla/asmjs.py: Allowing AsmJSFaultHandler to run.")
|
||||
print "js/src/gdb/mozilla/asmjs.py: Allowing AsmJSFaultHandler to run."
|
||||
|
||||
# If AsmJSFaultHandler doesn't handle this segfault, it will unhook
|
||||
# itself and re-raise.
|
||||
|
@ -161,7 +161,7 @@ class Test(TaskPool.Task):
|
||||
'--ex', 'file %s' % (os.path.join(OPTIONS.builddir, 'gdb-tests'),),
|
||||
'--eval-command', 'python testlibdir=%r' % (testlibdir,),
|
||||
'--eval-command', 'python testscript=%r' % (self.test_path,),
|
||||
'--eval-command', 'python exec(open(%r).read())' % os.path.join(testlibdir, 'catcher.py')]
|
||||
'--eval-command', 'python execfile(%r)' % os.path.join(testlibdir, 'catcher.py')]
|
||||
|
||||
def start(self, pipe, deadline):
|
||||
super(Test, self).start(pipe, deadline)
|
||||
|
Loading…
Reference in New Issue
Block a user