googleprojectzero / TinyInst

A lightweight dynamic instrumentation library
Apache License 2.0
1.18k stars 119 forks source link

Generate coverage of main module on MacOS attach mode #60

Closed dgh05t closed 2 years ago

dgh05t commented 2 years ago

Hi ifratric, Can Tinyinst generate coverage of main module on MacOS attach mode? I tried sudo ./litecov -instrument_module test -coverage_file coverage.txt -pid 13845 but no coverage generated. It seems attach mode on Mac can only instrument dylib?

ifratric commented 2 years ago

That should certainly be supported, but it's possible that particular combination of flags wasn't sufficiently tested and there's a bug somewhere. I can take a look next week (I'm away currently). Are you running on Intel or Arm (M1)?

dgh05t commented 2 years ago

I'm running on Intel now, I'll test the M1 ASAP.

ifratric commented 2 years ago

This should be fixed now. Can you confirm?

dgh05t commented 2 years ago

The commit resolve the issue, thanks!