Print this page
saveargs: let disasm do the lifting

*** 22,33 **** /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - #pragma ident "%Z%%M% %I% %E% SMI" - #include <libdisasm.h> #include <stdlib.h> #include <stdio.h> #include "dis_tables.h" --- 22,31 ----
*** 243,247 **** --- 241,254 ---- done: dis_free(hist, sizeof (uint64_t) * n); return (res); } + + int + dis_instrlen(dis_handle_t *dhp, uint64_t pc) + { + if (dis_disassemble(dhp, pc, NULL, 0) != 0) + return (-1); + + return (dhp->dh_addr - pc); + }