Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] CLI command "hbreak" creates a hardware watchpoint

Hi,

When user types the CLI command "hbreak" in the gdb console, gdb inserts a hardware breakpoint. CDT then sends a command "-break-list" to get the updated list of
breakpoints and watchpoints installed in the target. In the reponse, gdb reports the breakpoint inserted thru hbreak as type "hw breakpoint".

Example interaction between CDT and gdb:

[1,293,012,542,777] 177-interpreter-exec console hbreak
[1,293,012,542,792] ~"Hardware assisted breakpoint 4 at 0x60000aa4: file/
build/tree/RD-2010.0-beta4\
_kuma/tools/swtools-MSWin32-x86/xtensa-elf/src/xtos/crt1-sim.S, line 234.\n"
[1,293,012,542,792] 177^done
[1,293,012,542,792] (gdb)
[1,293,012,542,792] 178-break-list
[1,293,012,542,792]
178^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1"\
,col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4\
",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr=\
"Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_na\
me="what",colhdr="What"}],body=[bkpt={number="4",type="hw
breakpoint",disp="keep",enabled="y",addr="\
0x60000aa4",file="/build/tree/RD-2010.0-beta4_kuma/tools/swtools-MSWin32-x86/xtensa-elf/src/xtos/crt\
1-sim.S",line="234",times="0"}]}
[1,293,012,542,792] (gdb)

In the method, MIBreakpoint.parse(...), any breakpoint whose typename starts with "hw" is treated as a watchpoint. Only those breakpoints whose typename is "hw watchpoint" should be treated as watchpoint.

Have attached two patches, one for the MIBreakpoint class in CDI, and one for the MIBreakpoint class in DSF. Should I file a bug for this?

Thanks
Abeer Bagul
Tensilica India

### Eclipse Workspace Patch 1.0
#P org.eclipse.cdt.debug.mi.core
Index: mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java,v
retrieving revision 1.13
diff -u -r1.13 MIBreakpoint.java
--- mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java	3 Jun 2010 14:20:55 -0000	1.13
+++ mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java	27 Jan 2011 05:29:29 -0000
@@ -202,8 +202,11 @@
 				//type="hw watchpoint"
 				if (type.startsWith("hw")) { //$NON-NLS-1$
 					isHdw = true;
-					isWWpt = true;
-					isWpt = true;
+					if (type.indexOf("watchpoint") != -1)
+					{
+						isWWpt = true;
+						isWpt = true;
+					}
 				}
 				//type="acc watchpoint"
 				if (type.startsWith("acc")) { //$NON-NLS-1$
#P org.eclipse.cdt.dsf.gdb
Index: src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java,v
retrieving revision 1.6
diff -u -r1.6 MIBreakpoint.java
--- src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java	26 Aug 2010 17:58:46 -0000	1.6
+++ src/org/eclipse/cdt/dsf/mi/service/command/output/MIBreakpoint.java	27 Jan 2011 05:29:31 -0000
@@ -433,8 +433,11 @@
                 //type="hw watchpoint"
                 if (type.startsWith("hw")) { //$NON-NLS-1$
                     isHdw = true;
-                    isWWpt = true;
-                    isWpt = true;
+					if (type.indexOf("watchpoint") != -1)
+					{
+						isWWpt = true;
+						isWpt = true;
+					}
                 }
                 //type="acc watchpoint"
                 if (type.startsWith("acc")) { //$NON-NLS-1$

Back to the top