draperlaboratory / hope-policy-tool

Policy language tools
Other
0 stars 0 forks source link

Readability of debug output #19

Closed sbrookes closed 5 years ago

sbrookes commented 5 years ago

Debug output is hard to grok as is... currently:

Policy input:
  pc = {}
  ci = {loadUpperGrp, allGrp}
  op1 = <null>
  op2 = <null>
  op3 = <null>
  mem = <null>

Evaluating: ppacPol
rule match: loadUpperGrp<code=_, env=_>
Result ppacPol: Success

  pc = {}
  rd = {}

Evaluating: usrTypePol
rule match: loadUpperGrp<code=_, env=_>
Result usrTypePol: Success

  pc = {}
  rd = {}
Policy input:
  pc = {}
  ci = {immArithGrp, allGrp}
  op1 = {}
  op2 = <null>
  op3 = <null>
  mem = <null>
.... 

Better whitespace and slightly more verbosity would help:

Instruction: [address of instruction? Hex of instruction opcode?]  
  Policy input:
    pc = {}
    ci = {loadUpperGrp, allGrp}
    op1 = <null>
    op2 = <null>
    op3 = <null>
    mem = <null> [wth is mem vs op1, op2, op3?]

  Evaluating: ppacPol
    Rule: loadUpperGrp<code=_, env=_> [ What is the output half of the matched rule?]
    Result: Success
      pc = {}
      rd = {}
      [mem = ? other results?]

  Evaluating: usrTypePol
    Rule: loadUpperGrp<code=_, env=_>  [ What is the output half of the matched rule?]
    Result: Success
      pc = {}
      rd = {}
sbrookes commented 5 years ago

https://github.com/draperlaboratory/hope-policy-tool/commit/d12df20212edb156bced0f086998eefab12fc458