mirror of
https://github.com/opnsense/src.git
synced 2026-06-06 23:32:52 -04:00
ddb: Properly pretty-print non-labeled enum values
The ddb pretty-printer currently does not print out enum values that
are not labeled (e.g. X | Y).
The enum printer was reworked to print non-labeled values.
Reported by: jrtc27
Fixes: c21bc6f ("ddb: Add CTF-based pretty printing")
Approved by: markj (mentor)
This commit is contained in:
parent
87e63f2e7f
commit
aada453dcb
1 changed files with 6 additions and 5 deletions
|
|
@ -225,13 +225,14 @@ db_pprint_enum(db_addr_t addr, struct ctf_type_v3 *type, u_int depth)
|
||||||
for (; ep < endp; ep++) {
|
for (; ep < endp; ep++) {
|
||||||
if (val == ep->cte_value) {
|
if (val == ep->cte_value) {
|
||||||
valname = db_ctf_stroff_to_str(&sym_data, ep->cte_name);
|
valname = db_ctf_stroff_to_str(&sym_data, ep->cte_name);
|
||||||
if (valname != NULL)
|
if (valname != NULL) {
|
||||||
db_printf("%s (0x%lx)", valname, (long)val);
|
db_printf("%s (0x%lx)", valname, val);
|
||||||
else
|
break;
|
||||||
db_printf("(0x%lx)", (long)val);
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ep == endp)
|
||||||
|
db_printf("0x%lx", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue