Bug #18565 2012-04-16 08:36

titanping

Can't remove break point

I am use embedded linux ,codeblock use GDB(arm_linux_gdb) connect to gdbserver for debug work , I have setup a break point , and program is break in the breakpoint , and next step I remove this breakpoint , but Codeblock does not seem to successfully remove it , it is break for next loop .

Category
Debugger
Group
Platform:Linux
Status
Open
Close date
 
Assigned to
tpetrov
ollydbg 2012-04-18 08:13

I suggest: You need to enable the debugger plugin debug log, and post the log here or on the forum.

titanping 2012-04-18 09:17
Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
Adding source dir: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
Adding file: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
Changing directory to: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/.

[debug]LD_LIBRARY_PATH=.:
[debug]Command-line: /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/bin/arm-hisi-linux-gdb -nx -fullname  -quiet  -args /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
[debug]Working dir : /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR

Starting debugger: /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/bin/arm-hisi-linux-gdb -nx -fullname  -quiet  -args /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
done

[debug](gdb) 
[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Connecting to remote target
Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb 6.8
[debug]Copyright (C) 2008 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb 6.8

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]>>>>>>cb_gdb:
[debug]> source /usr/local/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> handle SIG32 nostop noprint
handle SIG33 nostop noprint
handle SIGSEGV nostop noprint
handle SIGPIPE nostop noprint
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> directory /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
[debug]>>>>>>cb_gdb:
[debug]> target remote tcp:192.168.1.97:1000
[debug]Queued:[tty /dev/pts/0]
[debug][New Thread 512]
[debug]0x000080b0 in _start ()
[debug]>>>>>>cb_gdb:

Connected

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2566"

In _start () ()

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2566"
[debug]Breakpoint 1 at 0x6cf68: file dvr.c, line 2566.
[debug]>>>>>>cb_gdb:Breakpoint 2 at 0x6cf68: file dvr.c, line 2566.
[debug]> tty /dev/pts/0
[debug]>>>>>>cb_gdb:
[debug]> continue
[debug]>>>>>>cb_gdb:
[debug]Breakpoint 1, main () at dvr.c:2566
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2566:61761:beg:0x6cf68
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2566

[debug]> delete breakpoints 1                 <<<<<<<<<<<<<<< here is removed breakpoint
[debug]>>>>>>cb_gdb:

Continuing...
[debug]> cont
[debug]Breakpoint 2, main () at dvr.c:2566     <<<<<<<<<<<<<<<<  it is break , why can't normal removed breakpoint. 
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2566:61761:beg:0x6cf68
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2566
titanping 2012-04-19 04:29
I have found a prcblem , I am make a break point , but use "info breakpoint" GDB command is show two breakpoint list , please see below infomation :
Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
Adding source dir: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
Adding file: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
Changing directory to: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/.

[debug]LD_LIBRARY_PATH=.:
[debug]Command-line: /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/bin/arm-hisi-linux-gdb -nx -fullname  -quiet  -args /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
[debug]Working dir : /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR

Starting debugger: /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/bin/arm-hisi-linux-gdb -nx -fullname  -quiet  -args /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Connecting to remote target
Setting breakpoints

[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb 6.8
[debug]Copyright (C) 2008 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb 6.8

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]>>>>>>cb_gdb:
[debug]> source /usr/local/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> handle SIG32 nostop noprint
handle SIG33 nostop noprint
handle SIGSEGV nostop noprint
handle SIGPIPE nostop noprint
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> directory /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
[debug]>>>>>>cb_gdb:
[debug]> target remote tcp:192.168.1.97:1000
[debug][New Thread 526]
[debug]0x000080b0 in _start ()
[debug]>>>>>>cb_gdb:

Connected

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2565"

In _start () ()

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2565"
[debug]Breakpoint 1 at 0x6d75c: file dvr.c, line 2565.
[debug]>>>>>>cb_gdb:Breakpoint 2 at 0x6d75c: file dvr.c, line 2565.
[debug]> bt 30
[debug]>>>>>>cb_gdb:
[debug]#0  0x000080b0 in _start ()
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/1
[debug]Queued:[tty /dev/pts/1]
[debug]>>>>>>cb_gdb:
[debug]> continue
[debug]Breakpoint 1, main () at dvr.c:2565
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2565:61735:beg:0x6d75c
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:2565
> info breakpoint

[debug]> info breakpoint
[debug]Num     Type           Disp Enb Address    What
[debug]1       breakpoint     keep y   0x0006d75c in main at dvr.c:2565
[debug]	breakpoint already hit 1 time
[debug]2       breakpoint     keep y   0x0006d75c in main at dvr.c:2565
[debug]	breakpoint already hit 1 time
[debug]>>>>>>cb_gdb:

Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x0006d75c in main at dvr.c:2565
	breakpoint already hit 1 time
2       breakpoint     keep y   0x0006d75c in main at dvr.c:2565
	breakpoint already hit 1 time
tpetrov 2012-04-22 12:10

Hm, for some reason the debugger is inserting two breakpoints.

Can you try newer version of gdb, 6.8 is quite old already...

titanping 2012-05-08 06:59
Dear tpetrov :
I have change GDB to V7.4 , but is occur other problem , when I add two breakpoints at the same time  (breakpoint in line 295,314),  break in line 295,314 after remove them , but Codeblocks only remove a breakpoint (295) , the 314 breakpoint cannot removed , please see below debug info , thanks .
 
Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
Adding source dir: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
Adding file: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
Changing directory to: /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/.

[debug]LD_LIBRARY_PATH=.:
[debug]Command-line: /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/bin/arm-hisi-linux-gdb74 -nx -fullname  -quiet  -args /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
[debug]Working dir : /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR

Starting debugger: /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/bin/arm-hisi-linux-gdb74 -nx -fullname  -quiet  -args /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr
done

[debug]Reading symbols from /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr...
[debug]done.
[debug](gdb) 
[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Connecting to remote target
Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.4
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-hismall-linux".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.4

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/local/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> handle SIG32 nostop noprint
handle SIG33 nostop noprint
handle SIGSEGV nostop noprint
handle SIGPIPE nostop noprint
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> directory /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/
[debug]>>>>>>cb_gdb:
[debug]> target remote tcp:192.168.1.97:1000
[debug]0x000080b0 in _start ()
[debug]>>>>>>cb_gdb:

Connected

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:295"

In _start () ()

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:295"
[debug]Breakpoint 2 at 0x9648: file dvr.c, line 295.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x9648: file dvr.c, line 295.
[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:314"
[debug]>>>>>>cb_gdb:



[debug]> bt 30
[debug]Breakpoint 4 at 0x97a8: file dvr.c, line 314.
[debug]>>>>>>cb_gdb:#0  0x000080b0 in _start ()
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/0
[debug]Queued:[tty /dev/pts/0]
[debug]>>>>>>cb_gdb:
[debug]> continue
[debug]Breakpoint 2, BuildSMSCommandStru (penv=0x479ab8) at dvr.c:295
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:295:10133:beg:0x9648
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:295
Continuing...
[debug]> cont
[debug]Breakpoint 4, BuildSMSCommandStru (penv=0x479ab8) at dvr.c:314
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:314:10840:beg:0x97a8
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:314
> info breakpoint

[debug]> info breakpoint
[debug]Num     Type           Disp Enb Address    What
[debug]1       breakpoint     keep y   <PENDING>  exception throw
[debug]2       breakpoint     keep y   0x00009648 in BuildSMSCommandStru at dvr.c:295
[debug]	breakpoint already hit 1 time
[debug]3       breakpoint     keep y   0x00009648 in BuildSMSCommandStru at dvr.c:295
[debug]	breakpoint already hit 1 time
[debug]4       breakpoint     keep y   0x000097a8 in BuildSMSCommandStru at dvr.c:314
[debug]	breakpoint already hit 1 time
[debug]>>>>>>cb_gdb:

Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <PENDING>  exception throw
2       breakpoint     keep y   0x00009648 in BuildSMSCommandStru at dvr.c:295
	breakpoint already hit 1 time
3       breakpoint     keep y   0x00009648 in BuildSMSCommandStru at dvr.c:295
	breakpoint already hit 1 time
4       breakpoint     keep y   0x000097a8 in BuildSMSCommandStru at dvr.c:314
	breakpoint already hit 1 time
	
<<<<<<<<<<<<<< here ,I have delete 295 and 314 breakpoint , but Codeblocks only remove 295 break point ,why?
[debug]> delete breakpoints 2     
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:315:10873:beg:0x97b4
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:315
<<<<<<<<<<<<<< here ,I am add line 314 breakpoint again ,but it add in break point 5 ,the breakpoint 4 cannot  removed always .

[debug]> break "/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:314"
[debug]Breakpoint 5 at 0x97a8: file dvr.c, line 314.
[debug]>>>>>>cb_gdb:
[debug]> delete breakpoints 5
[debug]>>>>>>cb_gdb:

> info breakpoint

[debug]> info breakpoint
[debug]Num     Type           Disp Enb Address    What
[debug]1       breakpoint     keep y   <PENDING>  exception throw
[debug]3       breakpoint     keep y   0x00009648 in BuildSMSCommandStru at dvr.c:295
[debug]	breakpoint already hit 1 time
[debug]4       breakpoint     keep y   0x000097a8 in BuildSMSCommandStru at dvr.c:314
[debug]	breakpoint already hit 1 time
[debug]>>>>>>cb_gdb:

Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <PENDING>  exception throw
3       breakpoint     keep y   0x00009648 in BuildSMSCommandStru at dvr.c:295
	breakpoint already hit 1 time
4       breakpoint     keep y   0x000097a8 in BuildSMSCommandStru at dvr.c:314
	breakpoint already hit 1 time
Continuing...
[debug]> cont
[debug]Breakpoint 4, BuildSMSCommandStru (penv=0x485f68) at dvr.c:314
[debug]/usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:314:10840:beg:0x97a8
[debug]>>>>>>cb_gdb:

At /usr/src/HiSilicon/Hi3515_SDK_V1.0.5.0.c1/DVRWork/HI3515-DVR/dvr.c:314
tpetrov 2012-05-08 10:29

I see no "delete breakpoint 4" command and so no one has deleted the breakpoint.

Can you open the "Breakpoints" dialog and tell me what is the index of the breakpoint just before you delete it? I guess it will be -1 and for some reason you log is pretty garbled and the commands and their results are interleaved, which messes up the debugger.

Can you reproduce this with non embedded debugger and executable?

titanping 2012-05-09 02:58

Dear tpetrov :

I have open "Breakpoints" dialog see the breakpoint 'index' value , It really is -1 , so can't delete it , Can you tell me how to solve this problem? Thanks !

ptdev 2012-05-28 09:50

Can confirm that the same thing happens under Windows: once a breakpoint has been added, removing it only happens in the UI: GDB keeps breaking in the same place.

The only workaround for this is to restart the debugging session.