Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 404253

Summary: [debug] Add linux ptrace single stepping support for ARM
Product: [Tools] TCF Reporter: Martin Oberhuber <mober.at+eclipse>
Component: AgentAssignee: Project Inbox <tcf.agent-inbox>
Status: RESOLVED FIXED QA Contact: Eugene Tarassov <eugene>
Severity: enhancement    
Priority: P3 CC: emmanuel.touron, mober.at+eclipse, stas.yakovlev
Version: 1.1   
Target Milestone: 1.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 403422    
Bug Blocks:    

Description Martin Oberhuber CLA 2013-03-25 05:22:59 EDT
Based on initial debug support from bug 403422, we would like to contribute linux ptrace single stepping support for ARM, especially for the Raspberry Pi (armv6l).

It turns out that this is not an easy task, because
- The PTRACE API does not provide native single stepping support on newer
  Linux Kernels, and the Raspberry Pi in particular
- The Linux Kernel restricts access to the "IMVA mismatch" property of the
  hardware breakpoint support, so we cannot have the "next address" calculated
  by the CPU automatically

Therefore, it looks like a software emulation of single stepping is needed, where every step needs to calculate the next address, plant a software breakpoint, and resume. This is tedious since there are many possibilities what the next address can be for an instruction step and even more so a source line step.
Comment 1 Emmanuel Mising name CLA 2013-03-25 06:27:01 EDT
I've implemented preliminary single stepping support, please consider pulling from 
https://github.com/wind-river-cdt/tcf.agent/commits/master
I confirm that I have written the code from scratch. I am contributing the code under the EPL and the EDL and I have the right from my employer to do so. I understand the Eclipse CoO as per http://www.eclipse.org/legal/CoO.php

Known limitation : stepping load operations affecting the PC is not yet implemented.
Comment 2 Eugene Tarassov CLA 2013-03-27 14:53:38 EDT
I have committed stepping support patch from github.

I also merged back armv6l directory back into arm directory, and changed the Makefile instead to make it build-able on RPI. Having a separate armv6l directory creates too much of unnecessary code duplication.

Thanks!