Bug 562785 - [Disassembly] Disassembly view loses source data while refreshing
Summary: [Disassembly] Disassembly view loses source data while refreshing
Status: NEW
Alias: None
Product: TCF
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-04 12:26 EDT by Deep Amin CLA
Modified: 2020-05-27 15:35 EDT (History)
0 users

See Also:


Attachments
Disassembly view screens compared with and without refresh (359.37 KB, image/jpeg)
2020-05-04 12:26 EDT, Deep Amin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deep Amin CLA 2020-05-04 12:26:06 EDT
Created attachment 282692 [details]
Disassembly view screens compared with and without refresh

When the sources are loaded and the refresh action is pressed in disassembly view, data seems to be lost sometimes.
Comment 1 Eugene Tarassov CLA 2020-05-05 12:26:58 EDT
Do you mean missing "main: ..." lines?

I cannot reproduce.
Could you provide a test case?
Comment 2 Deep Amin CLA 2020-05-05 12:48:20 EDT
Not the '...' lines. I have attached a screenshot for comparison, if you see the lines from 4844-4847 are not visible on right side after refresh. 
I was debugging "ffmpeg" with latest sources and latest tcf-agent, set a breakpoint in main method in ffmpeg.c, and then refresh the disassembly. Let me know if you need more input.
Comment 3 Deep Amin CLA 2020-05-15 05:11:47 EDT
@Eugene, any update on this? or any pointer which could be helpful to look into?
Comment 4 Eugene Tarassov CLA 2020-05-15 12:59:13 EDT
I made some improvements in x86 disassembly back-end.
However, I'm not sure it will address same problem.
If you provide your ffmpeg file, it would help to reproduce the issue.
Comment 5 Deep Amin CLA 2020-05-18 04:33:19 EDT
if you mean the source code by "ffmpeg", here is the link to source code https://ffmpeg.org/releases/ffmpeg-4.2.2.tar.bz2, standard make/gcc toolchain used to build on Ubuntu 18.02.
Comment 6 Deep Amin CLA 2020-05-27 08:30:10 EDT
Were you able to re-produce the issue? Any pointers on what could be causing it?
Comment 7 Eugene Tarassov CLA 2020-05-27 15:35:25 EDT
No, I cannot reproduce the issue.
I have built ffmpeg, and disassembly looks OK, does not change on refresh.

However, the problem looks familiar.
It is known problem with variable instruction length, like x86 instructions.
When disassembler miscalculates start address on an instruction, the view gets messed up.

This can happen because of:

1. missing symbol file. In particular, installing libc6-dbg package helps a lot.

2. disassembler does not recognize or misinterpret an instruction.

I cannot do much about #1, it is up to user to provide symbol files.

As for #2, I know that the x86 disassembler is incomplete. I work for Xilinx, which has little interest in perfecting Intel disassembler, we are mostly interested in ARM. However, I already committed some disassembler improvements, and I will look into it more when I have time. Contributions are welcome.