mdb_fmt.c (f11c6b60) mdb_fmt.c (9c3024a3)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 397 unchanged lines hidden (view full) ---

406}
407
408static mdb_tgt_addr_t
409fmt_instr(mdb_tgt_t *t, mdb_tgt_as_t as, mdb_tgt_addr_t addr, size_t cnt)
410{
411 char buf[BUFSIZ];
412 uintptr_t naddr;
413
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 397 unchanged lines hidden (view full) ---

406}
407
408static mdb_tgt_addr_t
409fmt_instr(mdb_tgt_t *t, mdb_tgt_as_t as, mdb_tgt_addr_t addr, size_t cnt)
410{
411 char buf[BUFSIZ];
412 uintptr_t naddr;
413
414 if (as == MDB_TGT_AS_VIRT)
415 as = MDB_TGT_AS_VIRT_I;
416
414 while (cnt-- != 0) {
415 naddr = mdb_dis_ins2str(mdb.m_disasm, t, as,
416 buf, sizeof (buf), addr);
417 if (naddr == addr)
418 return (addr); /* If we didn't move, we failed */
419 mdb_iob_printf(mdb.m_out, "%s\n", buf);
420 addr = naddr;
421 }

--- 4 unchanged lines hidden (view full) ---

426fmt_dotinstr(mdb_tgt_t *t, mdb_tgt_as_t as, mdb_tgt_addr_t addr, size_t cnt)
427{
428 uint_t oflags = mdb_iob_getflags(mdb.m_out) & MDB_IOB_INDENT;
429
430 char buf[BUFSIZ];
431 uintptr_t naddr;
432 uint32_t i;
433
417 while (cnt-- != 0) {
418 naddr = mdb_dis_ins2str(mdb.m_disasm, t, as,
419 buf, sizeof (buf), addr);
420 if (naddr == addr)
421 return (addr); /* If we didn't move, we failed */
422 mdb_iob_printf(mdb.m_out, "%s\n", buf);
423 addr = naddr;
424 }

--- 4 unchanged lines hidden (view full) ---

429fmt_dotinstr(mdb_tgt_t *t, mdb_tgt_as_t as, mdb_tgt_addr_t addr, size_t cnt)
430{
431 uint_t oflags = mdb_iob_getflags(mdb.m_out) & MDB_IOB_INDENT;
432
433 char buf[BUFSIZ];
434 uintptr_t naddr;
435 uint32_t i;
436
437 if (as == MDB_TGT_AS_VIRT)
438 as = MDB_TGT_AS_VIRT_I;
439
434 for (mdb_iob_clrflags(mdb.m_out, oflags); cnt-- != 0; addr = naddr) {
435 if (mdb_tgt_aread(t, as, &i, sizeof (i), addr) != sizeof (i)) {
436 warn("failed to read data from target");
437 break; /* Fail if we can't read instruction */
438 }
439 naddr = mdb_dis_ins2str(mdb.m_disasm, t, as,
440 buf, sizeof (buf), addr);
441 if (naddr == addr)

--- 420 unchanged lines hidden ---
440 for (mdb_iob_clrflags(mdb.m_out, oflags); cnt-- != 0; addr = naddr) {
441 if (mdb_tgt_aread(t, as, &i, sizeof (i), addr) != sizeof (i)) {
442 warn("failed to read data from target");
443 break; /* Fail if we can't read instruction */
444 }
445 naddr = mdb_dis_ins2str(mdb.m_disasm, t, as,
446 buf, sizeof (buf), addr);
447 if (naddr == addr)

--- 420 unchanged lines hidden ---