Bug 397322 - [disassembly] view scrolled to top when stepping to a label
Summary: [disassembly] view scrolled to top when stepping to a label
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-02 12:14 EST by Patrick Chuong CLA
Modified: 2020-09-04 15:20 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Chuong CLA 2013-01-02 12:14:43 EST
When stepping to a label in the disassembly view, the label is set to the top of the view. This should not happen if the label is already visible in the visible area of the disassembly view. I am not sure if this is a requirement or not for setting the label to the top of the view.

Here is a very simple example:

int main() {
	int a = 1;
	int b = a;
	
	asm("test:");
	b = a;
	asm("jmp test");
	
	return 0;
}
Comment 1 Patrick Chuong CLA 2013-01-15 14:49:46 EST
It looks like the DisassemblyPart::gotoPosition is causing the line to jump to the top. 

if (previousPos instanceof LabelPosition) {
    revealOffset = previousPos.offset;
    onTop = true;
}

If I remove the line "onTop = true", then the view doesn't jump to the top when the position is a label. Is this the correct fix?