Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !4952

i#4865 emulate: Add new emulation instrumentation API

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i4865-emulation-api into master Jun 18, 2021
  • Overview 49
  • Commits 5
  • Pipelines 0
  • Changes 13

Adds a new emulation instrumentation interface with simpler convenience routines for identifying the original application instruction fetch and operands.

Uses the new interface in memtrace_simple. Separate commits will update memval_simple, memtrace_x86, and drmemtrace.

Adds an x86 test that runs the memtrace_simple sample on the allasm_repstr app and ensures we see 2-byte "rep movs" instructions instead of the 1-byte "movs" that the existing sample client records due to not being emulation-aware. Adds a -log_to_stderr flag to the sample to make the test simpler and not have to deal with log files.

Adding new events is separated into #4947 which we may attempt in the future. Removing rep string non-fetched instructions is #4948.


Testing:

memtrace_simple before: $ bin64/drrun -c api/bin/libmemtrace_simple.so -- suite/tests/bin/allasm_repstr && cat ls -1td api/bin/*.log|head -1 Format: : , <(r)ead/(w)rite/opcode> 0x401018: 1, movs 0x40200e: 1, r 0x402000: 1, w 0x401018: 1, movs 0x40200f: 1, r 0x402001: 1, w 0x401018: 1, movs 0x402010: 1, r 0x402002: 1, w 0x401018: 1, movs 0x402011: 1, r 0x402003: 1, w 0x401018: 1, movs 0x402012: 1, r 0x402004: 1, w After: Format: : , <(r)ead/(w)rite/opcode> 0x401018: 2, rep movs 0x40200e: 1, r 0x402000: 1, w 0x401018: 2, rep movs 0x40200f: 1, r 0x402001: 1, w 0x401018: 2, rep movs 0x402010: 1, r 0x402002: 1, w 0x401018: 2, rep movs 0x402011: 1, r 0x402003: 1, w 0x401018: 2, rep movs 0x402012: 1, r 0x402004: 1, w

memtrace_simple on a gather expansion: $ ninja && bin64/drrun -c api/bin/libmemtrace_simple.so -log_to_stderr -- suite/tests/bin/allasm_scattergather Format: : , <(r)ead/(w)rite/opcode> 0x40105c: 11, mov 0x402022: 4, w 0x401067: 11, mov 0x402026: 4, w 0x401072: 11, mov 0x40202a: 4, w 0x40108a: 7, mov 0x402026: 4, r 0x40108a: 7, mov 0x40202e: 4, r 0x40108a: 7, mov 0x40202a: 4, r => Format: : , <(r)ead/(w)rite/opcode> 0x40105c: 11, mov 0x402022: 4, w 0x401067: 11, mov 0x402026: 4, w 0x401072: 11, mov 0x40202a: 4, w 0x40108a: 10, vpgatherdd 0x402026: 4, r 0x40202e: 4, r 0x40202a: 4, r

Issue: #4865 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i4865-emulation-api