comparison pytouhou/vm/eclrunner.py @ 365:238d06c6603e

Add more information to ECL debug messages
author Thibaut Girka <thib@sitedethib.com>
date Mon, 09 Jul 2012 22:14:55 +0200
parents b07e2f71f240
children 704bea2e4360
comparison
equal deleted inserted replaced
364:b07e2f71f240 365:238d06c6603e
170 170
171 if frame == self.frame: 171 if frame == self.frame:
172 try: 172 try:
173 callback = self._handlers[instr_type] 173 callback = self._handlers[instr_type]
174 except KeyError: 174 except KeyError:
175 logger.warn('unhandled opcode %d (args: %r)', instr_type, args) 175 logger.warn('[%d %r - %04d] unhandled opcode %d (args: %r)',
176 id(self), [self.sub] + [e[0] for e in self.stack],
177 self.frame, instr_type, args)
176 else: 178 else:
179 logger.debug('[%d %r - %04d] ins_%d%r', id(self),
180 [self.sub] + [e[0] for e in self.stack],
181 self.frame, instr_type, args)
177 callback(self, *args) 182 callback(self, *args)
178 logger.debug('executed opcode %d (args: %r)', instr_type, args)
179 183
180 self.frame += 1 184 self.frame += 1
181 185
182 186
183 def _getval(self, value): 187 def _getval(self, value):