Re: [PATCH 2/2] perf: disasm: prefer symsrc_filename for filename

From: Adrian Hunter
Date: Thu Jun 13 2024 - 06:26:57 EST


On 13/06/24 12:43, duchangbin wrote:
> On Thu, Jun 13, 2024 at 11:15:28AM +0300, Adrian Hunter wrote:
>> On 13/06/24 09:35, Changbin Du wrote:
>>> If we already found a debugging version when loading symbols for that dso,
>>> then use the same file for disasm instead of looking up in buildid-cache.
>>
>> In the past, there have been cases where the debugging version has not
>> worked for reading object code. I don't remember the details, but the
>> symbols and debugging information was OK while the object code was not.
>>
>> In general, using anything other than the file that was actually executed
>> for reading object code seems like a bad idea.
>>
> Is this a platform specific issue? AFAIK, the binary code in debugging and
> non-debugging version should be identical.

"should be" != "guaranteed to be". Simpler to avoid the issue and
stick with the file that was actually executed. We already support
having separate symbol sources, so there should not really be a
problem.