Lines Matching +full:- +full:- +full:depth
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
44 u_int depth);
51 * Pretty-prints a CTF_INT type.
54 db_pprint_int(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) in db_pprint_int() argument
59 type_struct_size = (type->ctt_size == CTF_V3_LSIZE_SENT) ? in db_pprint_int()
80 * Pretty-prints a struct. Nested structs are pretty-printed up 'depth' nested
84 db_pprint_struct(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) in db_pprint_struct() argument
93 type_struct_size = (type->ctt_size == CTF_V3_LSIZE_SENT) ? in db_pprint_struct()
96 struct_size = ((type->ctt_size == CTF_V3_LSIZE_SENT) ? in db_pprint_struct()
98 type->ctt_size); in db_pprint_struct()
99 vlen = CTF_V3_INFO_VLEN(type->ctt_info); in db_pprint_struct()
104 if (depth > max_depth) { in db_pprint_struct()
120 mtype = db_ctf_typeid_to_type(&sym_data, mp->ctm_type); in db_pprint_struct()
121 maddr = addr + (mp->ctm_offset / NBBY); in db_pprint_struct()
122 mname = db_ctf_stroff_to_str(&sym_data, mp->ctm_name); in db_pprint_struct()
123 db_indent = depth; in db_pprint_struct()
130 db_pprint_type(maddr, mtype, depth + 1); in db_pprint_struct()
143 mtype = db_ctf_typeid_to_type(&sym_data, mp->ctlm_type); in db_pprint_struct()
145 mname = db_ctf_stroff_to_str(&sym_data, mp->ctlm_name); in db_pprint_struct()
146 db_indent = depth; in db_pprint_struct()
153 db_pprint_type(maddr, mtype, depth + 1); in db_pprint_struct()
157 db_indent = depth - 1; in db_pprint_struct()
162 * Pretty-prints an array. Each array member is printed out in a separate line
163 * indented with 'depth' spaces.
166 db_pprint_arr(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) in db_pprint_arr() argument
174 type_struct_size = (type->ctt_size == CTF_V3_LSIZE_SENT) ? in db_pprint_arr()
178 elem_type = db_ctf_typeid_to_type(&sym_data, arr->cta_contents); in db_pprint_arr()
179 elem_size = ((elem_type->ctt_size == CTF_V3_LSIZE_SENT) ? in db_pprint_arr()
181 elem_type->ctt_size); in db_pprint_arr()
183 end = addr + (arr->cta_nelems * elem_size); in db_pprint_arr()
185 db_indent = depth; in db_pprint_arr()
193 db_pprint_type(elem_addr, elem_type, depth); in db_pprint_arr()
199 db_indent = depth - 1; in db_pprint_arr()
204 * Pretty-prints an enum value. Also prints out symbolic name of value, if any.
207 db_pprint_enum(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) in db_pprint_enum() argument
215 type_struct_size = (type->ctt_size == CTF_V3_LSIZE_SENT) ? in db_pprint_enum()
218 vlen = CTF_V3_INFO_VLEN(type->ctt_info); in db_pprint_enum()
227 if (val == ep->cte_value) { in db_pprint_enum()
228 valname = db_ctf_stroff_to_str(&sym_data, ep->cte_name); in db_pprint_enum()
240 * Pretty-prints a pointer. If the 'depth' parameter is less than the
246 db_pprint_ptr(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) in db_pprint_ptr() argument
257 tid = type->ctt_type; in db_pprint_ptr()
260 kind = CTF_V3_INFO_KIND(ref_type->ctt_info); in db_pprint_ptr()
267 tid = ref_type->ctt_type; in db_pprint_ptr()
271 tid = ref_type->ctt_type; in db_pprint_ptr()
275 tid = ref_type->ctt_type; in db_pprint_ptr()
279 tid = ref_type->ctt_type; in db_pprint_ptr()
282 tid = ref_type->ctt_type; in db_pprint_ptr()
290 if (depth < max_depth && (val != 0)) { in db_pprint_ptr()
292 db_pprint_type(val, ref_type, depth + 1); in db_pprint_ptr()
294 name = db_ctf_stroff_to_str(&sym_data, ref_type->ctt_name); in db_pprint_ptr()
295 db_indent = depth; in db_pprint_ptr()
306 * Pretty-print dispatching function.
309 db_pprint_type(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) in db_pprint_type() argument
320 switch (CTF_V3_INFO_KIND(type->ctt_info)) { in db_pprint_type()
322 db_pprint_int(addr, type, depth); in db_pprint_type()
326 db_pprint_struct(addr, type, depth); in db_pprint_type()
330 db_indent = depth; in db_pprint_type()
334 db_pprint_ptr(addr, type, depth); in db_pprint_type()
341 type->ctt_type); in db_pprint_type()
342 db_pprint_type(addr, ref_type, depth); in db_pprint_type()
346 db_pprint_enum(addr, type, depth); in db_pprint_type()
349 db_pprint_arr(addr, type, depth); in db_pprint_type()
359 * Symbol pretty-printing command.
360 * Syntax: pprint [/d depth] <sym_name>
378 if (ELF_ST_TYPE(sym_data.sym->st_info) != STT_OBJECT) { in db_pprint_symbol_cmd()
381 addr = sym_data.sym->st_value; in db_pprint_symbol_cmd()
386 type_name = db_ctf_stroff_to_str(&sym_data, type->ctt_name); in db_pprint_symbol_cmd()
397 * Command for pretty-printing arbitrary addresses.
398 * Syntax: pprint [/d depth] struct <struct_name> <addr>
429 /* Set default depth */ in db_pprint_cmd()
438 /* Parse desired depth level */ in db_pprint_cmd()
442 db_error("Invalid depth provided\n"); in db_pprint_cmd()