DynamoRIO / DynamoRIO/drmemory

add MacOS support to DrSyscall

Open
#1,440 0 comments 0 reactions 0 assignees View on GitHub
Component-DrSyscall Migrated OpSys-OSX Priority-Medium Type-Feature
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on February 11, 2014 22:55:05_

Split from issue #1438 Xref the changes to DR's syscall routines for Mac in DRr2502. Some notes regarding those changes:

*\* TODO update drsyscall
**\* TODO drsys_syscall_succeeded() takes in an integer value!

Usually called like this though:
drsys_syscall_succeeded(syscall, dr_syscall_get_result(drcontext), &success)
So could have a dynamic context-sensitive version.

**\* TODO 64-bit return values only for certain Mac 32-bit syscalls

DR bailed on it, so drsyscall should try to provide them

**\* TODO how fit 64-bit arg and return types for 32-bit syscalls?

For 32-bit syscalls:
drsys_arg_t has "ptr_uint_t value" -- but for return or for general
args (see below) it can be 64-bit! Make "void *start_addr" into a union
that can hold the high portion of a return (or arg) value?

Plus individual args can be 64-bit (xref SYS_proc_info in
memquery_file_backing()). Ideally we would mark them and not treat as an
extra arg (like DR is likely going to do) -- but xref formal arg splitting
("arg_low", "arg_high") idea above.

drsys_pre_syscall_arg() has "OUT ptr_uint_t *value".

**\* TODO add drsys_{get,set}_errno() to normalize Linux vs MacOS?

Invert errno on Linux. Except DR is already doing this in
dr_syscall_get_result_ex().

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=1440_

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.