Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Breakpoint error marker in Disassembly window(How to put error marker for address breakpoint insertion failure)
Breakpoint error marker in Disassembly window [message #1841024] Fri, 30 April 2021 16:48
Shiva Sharma is currently offline Shiva SharmaFriend
Messages: 5
Registered: January 2014
Junior Member
I have a situation in which a breakpoint cannot be put on certain address on hardware (i.e. hardware breakpoint) and I wish to put error markers on such locations as soon as a debug session is launched.
If not this, then I wish that as soon as user attempts to put a breakpoint on an address in disassembly view, then based on error(...) returned from backend gdb (integrated using CDT-DSF-GDB framework) should be marked using error marker in disassembly windows, like it is done for line breakpoints in source editor. But it is not happening.

When I debug this, I found a bug in CDT code. It is about function addBreakpointProblemMarker in MIBreakpointsManager class.

The issue is that the address breakpoint user puts in disassembly window is instance of CAddressBreakpoint which in turn is instance of ICLineBreakpoint so the if condition:

if (breakpoint instanceof ICLineBreakpoint)) {...} 


becomes true for address breakpoint as well.
But the code inside the if condition will not create a correct error marker in disassembly window because it uses line number for position. I tried using address from the breakpoint object for position attribute but that did not help either.

Can you please guide on HOW TO CREATE ERROR MARKER IN DISASSEMBLY WINDOW ?

Code I tried just above the above mentioned if condition is as following:
        if (breakpoint instanceof ICAddressBreakpoint) {
                IMarker marker = fBreakpointMarkerProblems.remove(breakpoint);
                if (marker != null) {
                        try {
                                marker.delete();
                        } catch (CoreException e) { }
                }
                    
                CAddressBreakpoint addressBreakpoint = (CAddressBreakpoint) breakpoint;
                try {
                        IMarker breakpointMarker = addressBreakpoint.getMarker();
                        breakpointMarker.setAttribute(IMarker.MESSAGE,     description);
                        breakpointMarker.setAttribute(IMarker.SEVERITY,    severity);
                     
                        addressBreakpoint.setMarker(breakpointMarker);
                        addressBreakpoint.setEnabled(false);
                 } catch (CoreException e) { }
        } else if (breakpoint instanceof ICLineBreakpoint)) {...} 


This does not add a new error marker BUT edits the message in the breakpoint marker itself.

Please guide!

[Updated on: Tue, 04 May 2021 12:31]

Report message to a moderator

Previous Topic:Please delete this post. I don't know why is twice
Next Topic:Set cmake run/debug mode through the IDE control
Goto Forum:
  


Current Time: Thu Mar 28 19:58:13 GMT 2024

Powered by FUDForum. Page generated in 0.02414 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top