예제 #1
0
    def do_binstr(self, line):
        '''
        Display a binary representation of the given value expression
        (padded to optional width in bits)

        Usage: binstr <val_expr> [<bitwidth_expr>]
        '''
        argv = splitargs(line)
        if len(argv) == 0:
            return self.do_help('binstr')
        bitwidth = None
        value = self.parseExpression(argv[0])
        if len(argv) > 1:
            bitwidth = self.parseExpression(argv[1])
        binstr = e_bits.binrepr(value, bitwidth=bitwidth)
        self.canvas.addText("0x%.8x (%d) %s\n" % (value, value, binstr))
예제 #2
0
파일: cli.py 프로젝트: Fitblip/vdb-fork
 def do_binstr(self, line):
     """
     Display a binary representation of the given value expression
     (padded to optional width in bits)
     
     Usage: binstr <val_expr> [<bitwidth_expr>]
     """
     argv = splitargs(line)
     if len(argv) == 0:
         return self.do_help("binstr")
     bitwidth = None
     value = self.parseExpression(argv[0])
     if len(argv) > 1:
         bitwidth = self.parseExpression(argv[1])
     binstr = e_bits.binrepr(value, bitwidth=bitwidth)
     self.canvas.addText("0x%.8x (%d) %s\n" % (value, value, binstr))