modidx field in offline_entry_t overflows for split segments
Created by: snehasish
In PR 2940 [1], the modidx field in _offline_entry_t was reused to represent segments in loaded modules instead of modules themselves. Under certain googletest conditions we find as many as 2400 shared libraries being linked to the test executable where the total number of segments is a little over twice that number. The size of the modidx field only accounts for 4096 entries. This leads to errors reported by raw2trace such as -- "memref entry found outside of bb" or "invalid cti" [3]
We can increase the width of modidx by grabbing more bits from the instr_count field. Clients can control the size of the basic block and can split into two blocks if the instr_count limit is reached.
[1] https://github.com/DynamoRIO/dynamorio/pull/2940 [2] https://github.com/DynamoRIO/dynamorio/blob/a51325f91fc3327b126d10df0a17f95e8357d19a/clients/drcachesim/common/trace_entry.h#L315 [3] https://github.com/DynamoRIO/dynamorio/blob/f0a1f2825e4406e3005e13fecf7134346f1ce9d8/clients/drcachesim/tracer/raw2trace.cpp#L494