DynamoRIO / DynamoRIO/dynamorio

Sign extension in instr_disassemble impedes debugging

Open
#1,778 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

I'm new to DR, so it took me quite some time to figure out why this code:

```
dr_insert_clean_call(drcontext, ilist, where, memwrite_callback2, false,
2, opnd_create_reg(reg), src);
```

generates something which DR considers invalid:

```
ERROR: Could not find encoding for: mov $0x0000000000000004 -> %rsi
```

With sign_extend_immed commented out of internal_instr_disassemble, I'm getting the correct error message:

```
ERROR: Could not find encoding for: mov $0x04 -> %rsi
```

I'm not sure why sign_extend_immed exists - the comment says what it does, but not _why_.

Feel free to close this issue if that's expected.

Related issues: #1707, #614, #616

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.