drcachesim function tracing argument count can be wrong for duplicate-PC functions
drcachesim's function tracing -record_heap by default includes several operator delete
functions which take different numbers of args, such as _ZdaPv
with 1, _ZdaPvRKSt9nothrow_t
with 2, _ZdaPvSt11align_val_t
with 2, and _ZdaPvSt11align_val_tRKSt9nothrow_t
with 3. Yet, on some applications these all map to a single PC, often free(), since de-allocation typically doesn't care about alignment or nothrow parameters. The tracer just takes the 1st request, in this case the 1-arg which is listed first, and uses it, recording 1 arg for that PC. But in the recorded list of what functions were traced, it still lists the other variants as having 2 or 3 args. This can cause problems in trace analyzers that expect to then find 2 or 3 args: in fact we hit this in one of our tools.
It seems best for the tracer to emit a warning about varying args for the same PC, and to then modify the arg count in the traced function list. Generally, it's best to take the last one listed to allow overriding, but here we'd prefer the first.