On Fri, Feb 17, 2012 at 09:41, Iustin Pop <ius...@google.com> wrote:
> On Fri, Feb 17, 2012 at 09:39:30AM +0100, René Nussbaumer wrote:
>> On Thu, Feb 16, 2012 at 15:48, Iustin Pop <ius...@google.com> wrote:
>> > On Thu, Feb 16, 2012 at 01:10:07PM +0100, René Nussbaumer wrote:
>> >> ---
>> >>  lib/mcpu.py |    4 ++--
>> >>  1 files changed, 2 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/lib/mcpu.py b/lib/mcpu.py
>> >> index 95f04e0..11b2e00 100644
>> >> --- a/lib/mcpu.py
>> >> +++ b/lib/mcpu.py
>> >> @@ -404,8 +404,8 @@ class Processor(object):
>> >>      if not (resultcheck_fn is None or resultcheck_fn(result)):
>> >>        logging.error("Expected opcode result matching %s, got %s",
>> >>                      resultcheck_fn, result)
>> >> -      raise errors.OpResultError("Opcode result does not match %s" %
>> >> -                                 resultcheck_fn)
>> >> +      raise errors.OpResultError("Opcode result does not match %s, got 
>> >> %s" %
>> >> +                                 resultcheck_fn, result)
>> >
>> > Will this possibly log all the result (which might be big) in the error?
>>
>> Yes it does, sadly :(. There's no easy way to turn a result into a
>> type description. I can also discard this patch, it was just useful
>> for me when I was doing the OP_RESULT patches to see what the actual
>> result looks like and turn it into a type description.
>
> Mmm, no need to drop. Maybe simply ensuring that it's not overly long
> and ensuring the formatting bug is fixed, as in:
>
> … got %s" % (resultcheck_fn, result[:80]))

Nice catch!

Interdiff:
diff --git a/lib/mcpu.py b/lib/mcpu.py
index 11b2e00..96c589b 100644
--- a/lib/mcpu.py
+++ b/lib/mcpu.py
@@ -405,7 +405,7 @@ class Processor(object):
       logging.error("Expected opcode result matching %s, got %s",
                     resultcheck_fn, result)
       raise errors.OpResultError("Opcode result does not match %s, got %s" %
-                                 resultcheck_fn, result)
+                                 (resultcheck_fn, result[:80]))

     return result



René

Reply via email to