# ========== Copyright Header Begin ==========================================
# OpenSPARC T2 Processor File: SS_Break.py
# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
# The above named program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License version 2 as published by the Free Software Foundation.
# The above named program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public
# License along with this work; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
# ========== Copyright Header End ============================================
def __init__(self
,strand
,vonk
,breakp
):
return self
.__breakp
__.enabled
self
.__strand
__.break_enable(self
.__breakp
__.id)
self
.__strand
__.break_disable(self
.__breakp
__.id)
type_name
= break_type_name
[self
.__breakp
__.type]
s
+= '('+str(self
.__breakp
__.tt
)+')'
elif (type_name
== 'inst_va'):
s
+= '('+str(self
.__breakp
__.va
)+')'
elif (type_name
== 'inst_pa'):
s
+= '('+str(self
.__breakp
__.pa
)+')'
type_name
= break_type_name
[self
.__breakp
__.type]
s
= 'brk['+str(self
.__breakp
__.id)+'] '+type_name
+' '
if type_name
== 'trap' or type_name
== 'all_trap':
return s
+'tt='+self
.__vonk
__.get_trap_info(tt
).name
+'('+hex(tt
)+')'
elif type_name
== 'red_mode':
def __init__(self
,strand
,vonk
):
self
.__breakp
__ = strand
.break_points
self
.__breakp
__ = self
.__breakp
__.next
return (breakp
.id, BreakPoint(self
.__strand
__,self
.__vonk
__,breakp
))
def __init__(self
,strand
,vonk
):
break_trap_info
= vonk
.get_trap_info
if len(break_type_name
) == 0:
for on
in vonk
.SS_BreakPoint
.__dict
__:
break_type_name
[vonk
.SS_BreakPoint
.__dict
__[on
]] = on
[3:].lower()
return BreakIter(self
.__strand
__,self
.__vonk
__)
for b
in self
.__iter
__():
for id,bp
in self
.__iter
__():
for id,bp
in self
.__iter
__():
for id,bp
in self
.__iter
__():
def __getitem__(self
,index
):
for id,bp
in self
.__iter
__():
def __setitem__(self
,index
):
raise Exception('Breakpoint dictionary is read-only')
def __delitem__(self
,index
):
if self
.__strand
__.break_delete(index
) != 0:
def on_inst_va(self
,va
,callback
=None):
id = self
.__strand
__.break_on_inst_va(va
)
self
.callback
[id] = callback
def on_red_mode(self
,callback
=None):
id = self
.__strand
__.break_on_red_mode()
self
.callback
[id] = callback
def on_trap(self
,traptype
,callback
=None):
id = self
.__strand
__.break_on_trap(traptype
)
self
.callback
[id] = callback
bp
= self
.__strand
__.break_hit
bp
= self
.__strand
__.break_hit
return BreakPoint(self
.__strand
__,self
.__vonk
__,bp
)
bp
= self
.__strand
__.break_hit
return bp
.id,BreakPoint(self
.__strand
__,self
.__vonk
__,bp
)