@@ -158,6 +158,8 @@ const ftattr_t ftattrtab[] = {
{ FLDT_CHARNS, "charns", fp_charns, NULL, SI(bitsz(char)), 0, NULL,
NULL },
{ FLDT_CHARS, "chars", fp_num, "%c", SI(bitsz(char)), 0, NULL, NULL },
+ { FLDT_HEXSTRING, "hexstring", fp_hexstr, NULL, SI(bitsz(char)), 0, NULL,
+ NULL },
{ FLDT_REXTLEN, "rextlen", fp_num, "%u", SI(RMAPBT_BLOCKCOUNT_BITLEN),
0, NULL, NULL },
{ FLDT_RFILEOFFD, "rfileoffd", fp_num, "%llu", SI(RMAPBT_OFFSET_BITLEN),
@@ -67,6 +67,7 @@ typedef enum fldt {
FLDT_CFSBLOCK,
FLDT_CHARNS,
FLDT_CHARS,
+ FLDT_HEXSTRING,
FLDT_REXTLEN,
FLDT_RFILEOFFD,
FLDT_REXTFLG,
@@ -54,6 +54,30 @@ fp_charns(
return 1;
}
+int
+fp_hexstr(
+ void *obj,
+ int bit,
+ int count,
+ char *fmtstr,
+ int size,
+ int arg,
+ int base,
+ int array)
+{
+ int i;
+ char *p;
+
+ ASSERT(bitoffs(bit) == 0);
+ ASSERT(size == bitsz(char));
+ for (i = 0, p = (char *)obj + byteize(bit);
+ i < count && !seenint();
+ i++, p++) {
+ dbprintf("%02x", *p & 0xff);
+ }
+ return 1;
+}
+
int
fp_num(
void *obj,
@@ -9,6 +9,8 @@ typedef int (*prfnc_t)(void *obj, int bit, int count, char *fmtstr, int size,
extern int fp_charns(void *obj, int bit, int count, char *fmtstr, int size,
int arg, int base, int array);
+extern int fp_hexstr(void *obj, int bit, int count, char *fmtstr, int size,
+ int arg, int base, int array);
extern int fp_num(void *obj, int bit, int count, char *fmtstr, int size,
int arg, int base, int array);
extern int fp_sarray(void *obj, int bit, int count, char *fmtstr, int size,