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

Function db_disasm

freebsd/amd64/amd64/db_disasm.c:1244–1757  ·  view source on GitHub ↗

* Disassemble instruction at 'loc'. 'altfmt' specifies an * (optional) alternate format. Return address of start of * next instruction. */

Source from the content-addressed store, hash-verified

1242 * next instruction.
1243 */
1244db_addr_t
1245db_disasm(db_addr_t loc, bool altfmt)
1246{
1247 int inst;
1248 int size;
1249 int short_addr;
1250 const char * seg;
1251 const struct inst * ip;
1252 const char * i_name;
1253 int i_size;
1254 int i_mode;
1255 int rex = 0;
1256 int regmodrm = 0;
1257 boolean_t first;
1258 int displ;
1259 int prefix;
1260 int rep, repne;
1261 int imm;
1262 int imm2;
1263 long imm64;
1264 int len;
1265 struct i_addr address;
1266
1267 get_value_inc(inst, loc, 1, FALSE);
1268 short_addr = FALSE;
1269 size = LONG;
1270 seg = NULL;
1271
1272 /*
1273 * Get prefixes
1274 */
1275 rep = FALSE;
1276 repne = FALSE;
1277 prefix = TRUE;
1278 do {
1279 switch (inst) {
1280 case 0x66: /* data16 */
1281 size = WORD;
1282 break;
1283 case 0x67:
1284 short_addr = TRUE;
1285 break;
1286 case 0x26:
1287 seg = "%es";
1288 break;
1289 case 0x36:
1290 seg = "%ss";
1291 break;
1292 case 0x2e:
1293 seg = "%cs";
1294 break;
1295 case 0x3e:
1296 seg = "%ds";
1297 break;
1298 case 0x64:
1299 seg = "%fs";
1300 break;
1301 case 0x65:

Callers

nothing calls this directly

Calls 6

db_printfFunction · 0.85
strcmpFunction · 0.85
db_printsymFunction · 0.85
db_disasm_escFunction · 0.70
db_read_addressFunction · 0.70
db_print_addressFunction · 0.70

Tested by

no test coverage detected