Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-dd-dev] Retrieving platform breakpoints in the BreakpointsMediator

Hello,

I am working with DSF 1.0RC4 release.

In our DSF debugger implementation, I am currently using the
BreakpointsMediator DSF service class to transform platform breakpoints
into target-specific ones.

However, I did not find an API way of translating a target breakpoint
back to a platform one, given the target breakpoint's
IBreakpointDMContext. The GDB reference implementation uses an augmented
version of BreakpointsMediator which makes that possible
(MIBreakpointsManager), but the process seems to be very GDB-specific.

Since the breakpoint maps in BreakpointsMediator are private, I have
added the following method to the BreakpointsMediator class:

//////////////////////////////////////////////////////

    public void findPlatformBreakpoint(IBreakpointsTargetDMContext
target,
            IBreakpointDMContext bdmc, DataRequestMonitor<IBreakpoint>
dataRequestMonitor) {
        Map<IBreakpoint, List<IBreakpoints.IBreakpointDMContext>>
platformBPs = fBreakpointDMContexts
                .get(target);

        dataRequestMonitor.setData(null);
        if (platformBPs != null)
        {
            for(Entry<IBreakpoint, List<IBreakpointDMContext>> e:
platformBPs.entrySet())
            {
                // Stop at the first occurrence
                if(e.getValue().contains(bdmc))
                {
                    dataRequestMonitor.setData(e.getKey());
                    break;
                }
            }    
        }        
        dataRequestMonitor.done();
    }

///////////////////////////////////////////////////////

The method returns the first IBreakpoint associated to the given target
breakpoint context (as I understood, there should be at most one).

Should such method be part of the BreakpointsMediator service? Or am I
missing some other API way of tracing target breakpoints to their
platform counterparts?

Also, should the breakpoint maps in BreakpointsMediator be made
protected instead of private so that the breakpoint translation process
can be extended?

Thanks!

/Mario




Back to the top