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))
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))