MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_examine

Function db_examine

freebsd/ddb/db_examine.c:68–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68static void
69db_examine(db_addr_t addr, char *fmt, int count)
70{
71 int c;
72 db_expr_t value;
73 int size;
74 int width;
75 char * fp;
76
77 while (--count >= 0 && !db_pager_quit) {
78 fp = fmt;
79 size = 4;
80 while ((c = *fp++) != 0) {
81 switch (c) {
82 case 'b':
83 size = 1;
84 break;
85 case 'h':
86 size = 2;
87 break;
88 case 'l':
89 size = 4;
90 break;
91 case 'g':
92 size = 8;
93 break;
94 case 'a': /* address */
95 size = sizeof(void *);
96 /* always forces a new line */
97 if (db_print_position() != 0)
98 db_printf("\n");
99 db_prev = addr;
100 db_printsym(addr, DB_STGY_ANY);
101 db_printf(":\t");
102 break;
103 default:
104 if (db_print_position() == 0) {
105 /* Print the address. */
106 db_printsym(addr, DB_STGY_ANY);
107 db_printf(":\t");
108 db_prev = addr;
109 }
110
111 width = size * 4;
112 switch (c) {
113 case 'r': /* signed, current radix */
114 value = db_get_value(addr, size, true);
115 addr += size;
116 db_printf("%+-*lr", width, (long)value);
117 break;
118 case 'x': /* unsigned hex */
119 value = db_get_value(addr, size, false);
120 addr += size;
121 db_printf("%-*lx", width, (long)value);
122 break;
123 case 'z': /* signed hex */
124 value = db_get_value(addr, size, true);
125 addr += size;

Callers 1

db_examine_cmdFunction · 0.85

Calls 6

db_print_positionFunction · 0.85
db_printfFunction · 0.85
db_printsymFunction · 0.85
db_get_valueFunction · 0.85
db_end_lineFunction · 0.85
db_disasmFunction · 0.50

Tested by

no test coverage detected