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

Function db_get_value

freebsd/ddb/db_access.c:55–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53};
54
55db_expr_t
56db_get_value(db_addr_t addr, int size, bool is_signed)
57{
58 char data[sizeof(u_int64_t)];
59 db_expr_t value;
60 int i;
61
62 if (db_read_bytes(addr, size, data) != 0) {
63 db_printf("*** error reading from address %llx ***\n",
64 (long long)addr);
65 kdb_reenter();
66 }
67
68 value = 0;
69#if _BYTE_ORDER == _BIG_ENDIAN
70 for (i = 0; i < size; i++)
71#else /* _LITTLE_ENDIAN */
72 for (i = size - 1; i >= 0; i--)
73#endif
74 {
75 value = (value << 8) + (data[i] & 0xFF);
76 }
77
78 if (size < 4) {
79 if (is_signed && (value & db_extend[size]) != 0)
80 value |= db_extend[size];
81 }
82 return (value);
83}
84
85void
86db_put_value(db_addr_t addr, int size, db_expr_t value)

Callers 15

db_numargsFunction · 0.85
db_print_stack_entryFunction · 0.85
db_nextframeFunction · 0.85
db_backtraceFunction · 0.85
db_trace_selfFunction · 0.85
db_nextframeFunction · 0.85
db_backtraceFunction · 0.85
db_trace_selfFunction · 0.85
db_disasm_read_wordFunction · 0.85
db_disasm_read_wordFunction · 0.85
kdb_cpu_set_singlestepFunction · 0.85
db_unaryFunction · 0.85

Calls 3

db_printfFunction · 0.85
kdb_reenterFunction · 0.85
db_read_bytesFunction · 0.50

Tested by

no test coverage detected