* restart for remote target @ 2006-07-25 15:45 Efim Monyak 2006-07-25 16:01 ` Daniel Jacobowitz 0 siblings, 1 reply; 10+ messages in thread From: Efim Monyak @ 2006-07-25 15:45 UTC (permalink / raw) To: gdb Hi all, I need an restart command for remote target. Set Program Counter to i.e. 0 is not an option because interrupts. I implemented it as user-defined command but all breakpoints must be delete before load. After load all breakpoints are lost. Is it possible to save breakpoint data in order restore it after application reload? Thanks ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 15:45 restart for remote target Efim Monyak @ 2006-07-25 16:01 ` Daniel Jacobowitz 2006-07-25 16:24 ` Efim Monyak 0 siblings, 1 reply; 10+ messages in thread From: Daniel Jacobowitz @ 2006-07-25 16:01 UTC (permalink / raw) To: Efim Monyak; +Cc: gdb On Tue, Jul 25, 2006 at 05:42:14PM +0200, Efim Monyak wrote: > Hi all, > > I need an restart command for remote target. Set Program Counter to i.e. > 0 is not an > option because interrupts. > I implemented it as user-defined command but all breakpoints must be > delete before load. > After load all breakpoints are lost. > Is it possible to save breakpoint data in order restore it after > application reload? Sorry, but your explanation omits too much; we need more information. Load should not remove breakpoints. Would it help you to connect using 'target extended-remote', and then use "run" to restart the target? That sends an 'R' packet to the stub, which can do whatever it needs to. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 16:01 ` Daniel Jacobowitz @ 2006-07-25 16:24 ` Efim Monyak 2006-07-25 16:28 ` Daniel Jacobowitz 0 siblings, 1 reply; 10+ messages in thread From: Efim Monyak @ 2006-07-25 16:24 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb Daniel Jacobowitz schrieb: > On Tue, Jul 25, 2006 at 05:42:14PM +0200, Efim Monyak wrote: > >> Hi all, >> >> I need an restart command for remote target. Set Program Counter to i.e. >> 0 is not an >> option because interrupts. >> I implemented it as user-defined command but all breakpoints must be >> delete before load. >> After load all breakpoints are lost. >> Is it possible to save breakpoint data in order restore it after >> application reload? >> > > Sorry, but your explanation omits too much; we need more information. > Load should not remove breakpoints. > > Would it help you to connect using 'target extended-remote', and then > use "run" to restart the target? That sends an 'R' packet to the stub, > which can do whatever it needs to. > > You are right. I delete all breakpoints before load the applications again because my Hardware supports only two breakpoints. In other case I receive error from GDB. The load is multistep. In one of steps I must set an breakpoint to particular address and only one way I found to put it away is command delete all breakpoints. As I see no command deletes breakpoint on address. Use breakpoint to source line is not very good on this place. It is not possible for stub restart the application. They are often problem if a remote target is used. As I wrote set PC to start address works not properly if i.e. interrupts are enabled. If application runs from RAM it is lost after Hardware reset. The only handy way I see is to reload application set all used breakpoints and start it again. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 16:24 ` Efim Monyak @ 2006-07-25 16:28 ` Daniel Jacobowitz 2006-07-25 17:48 ` Efim Monyak 2006-07-27 13:34 ` Efim Monyak 0 siblings, 2 replies; 10+ messages in thread From: Daniel Jacobowitz @ 2006-07-25 16:28 UTC (permalink / raw) To: Efim Monyak; +Cc: gdb On Tue, Jul 25, 2006 at 06:19:51PM +0200, Efim Monyak wrote: > I delete all breakpoints before load the applications again because my > Hardware supports only two > breakpoints. In other case I receive error from GDB. The load is > multistep. In one of steps I must set > an breakpoint to particular address and only one way I found to put it > away is command delete all breakpoints. > As I see no command deletes breakpoint on address. Use breakpoint to > source line is not very good on this place. "delete *0x3000000" should work. Also, it sounds like you want "disable", not "delete". > It is not possible for stub restart the application. They are often > problem if a remote target is used. > As I wrote set PC to start address works not properly if i.e. interrupts > are enabled. > If application runs from RAM it is lost after Hardware reset. > > The only handy way I see is to reload application set all used > breakpoints and start it again. In many cases the stub can handle all of this automatically, manually disabling interrupts et cetera. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 16:28 ` Daniel Jacobowitz @ 2006-07-25 17:48 ` Efim Monyak 2006-07-25 18:22 ` Daniel Jacobowitz 2006-07-27 13:34 ` Efim Monyak 1 sibling, 1 reply; 10+ messages in thread From: Efim Monyak @ 2006-07-25 17:48 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb Daniel Jacobowitz schrieb: > On Tue, Jul 25, 2006 at 06:19:51PM +0200, Efim Monyak wrote: > >> I delete all breakpoints before load the applications again because my >> Hardware supports only two >> breakpoints. In other case I receive error from GDB. The load is >> multistep. In one of steps I must set >> an breakpoint to particular address and only one way I found to put it >> away is command delete all breakpoints. >> As I see no command deletes breakpoint on address. Use breakpoint to >> source line is not very good on this place. >> > > "delete *0x3000000" should work. > > Also, it sounds like you want "disable", not "delete". > > >> It is not possible for stub restart the application. They are often >> problem if a remote target is used. >> As I wrote set PC to start address works not properly if i.e. interrupts >> are enabled. >> If application runs from RAM it is lost after Hardware reset. >> >> The only handy way I see is to reload application set all used >> breakpoints and start it again. >> > > In many cases the stub can handle all of this automatically, > manually disabling interrupts et cetera. > > debug session breaks because error. hier is my user-defined command: set $myvar = 0 define run if $myvar printf "\n 000000000000000000000000000 \n" disable printf "\n 44444444444444444444444444444 \n" k set remotebaud 300 target remote /dev/ttyS3 load reset.elf symbol-file reset.elf # set breakpoint to reset vector b * 0 printf "\n 555555555555555555555555555555 \n" # start program c delete * 0 printf "\n 666666666666666666666666666666 \n" # kill program k printf "\n 222222222222222222222222222 \n" set remotebaud 300 target remote /dev/ttyS3 load init.elf symbol-file init.elf # set breakpoint to end of program b end_init # start program c # delete all breakpoints (werden nicht mehr benutzt) clear end_init #kill program k printf "\n 33333333333333333333333333333 \n" set remotebaud 300 target remote /dev/ttyS3 load sample.elf symbol-file sample.elf set $myvar = 1 enable continue else set $myvar = 1 printf "\n 111111111111111111111111111 \n" continue end and hier GDB messages: 156-exec-run (gdb) 156^running (gdb) ~"\n 000000000000000000000000000 \n" ~"\n 44444444444444444444444444444 \n" 156+download,{section="startup",section-size="32",total-size ="19040"} 156+download,{section="startup1",section-size="264",total-si ze="19040"} 156+download,{section="prog",section-size="100",total-size=" 19040"} &"Error in re-setting breakpoint 3:\n" &"No line 120 in file \"../src/main.c\".\n" ~"\n 555555555555555555555555555555 \n" &"warning: bad breakpoint number at or near '* 0'\n" &"warning: bad breakpoint number at or near '0'\n" ~"\n 666666666666666666666666666666 \n" ~"\n 222222222222222222222222222 \n" 156+download,{section="startup",section-size="32",total-size ="25297"} 156+download,{section="prog",section-size="4900",total-size= "25297"} 156+download,{section="prog",section-sent="4051",section-siz e="4900",total-sent=\ "4083",total-size="25297"} ~"\n 33333333333333333333333333333 \n" 156+download,{section="startup",section-size="516",total-siz e="1132725"} 156+download,{section="text",section-size="1916",total-size= "1132725"} 156+download,{section=".data",section-size="2",total-size="1 132725"} &"Warning:\n" &"Cannot insert breakpoint 6.\n" &"Error accessing memory address 0x0: Unknown error 42949672 95.\n" &"\n" 156^error,msg="Warning:\nCannot insert breakpoint 6.\nError accessing memory add\ ress 0x0: Unknown error 4294967295.\n" -- Mit freundlichen Gruessen Efim Monjak Lipowsky Industrie-Elektronik GmbH 64291 Darmstadt, Roemerstr. 57 Telefon: +49-(0)6151-93591-0 Telefax: +49-(0)6151-93591-28 Email: ymonyak@lipowsky.de Homepage: http://www.lipowsky.de DIN EN ISO 9001:2000 certified by DQS ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 17:48 ` Efim Monyak @ 2006-07-25 18:22 ` Daniel Jacobowitz 2006-07-26 13:05 ` Efim Monyak 0 siblings, 1 reply; 10+ messages in thread From: Daniel Jacobowitz @ 2006-07-25 18:22 UTC (permalink / raw) To: Efim Monyak; +Cc: gdb On Tue, Jul 25, 2006 at 06:54:09PM +0200, Efim Monyak wrote: > symbol-file reset.elf If you want to use symbol files, you're out of luck. When you change the symbol file you're going to mess up all your breakpoints. You might be able to get things to work by not changing the symbol file. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 18:22 ` Daniel Jacobowitz @ 2006-07-26 13:05 ` Efim Monyak 2006-07-26 14:10 ` Daniel Jacobowitz 0 siblings, 1 reply; 10+ messages in thread From: Efim Monyak @ 2006-07-26 13:05 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb Daniel Jacobowitz schrieb: > On Tue, Jul 25, 2006 at 06:54:09PM +0200, Efim Monyak wrote: > >> symbol-file reset.elf >> > > If you want to use symbol files, you're out of luck. When you change > the symbol file you're going to mess up all your breakpoints. > > You might be able to get things to work by not changing the symbol > file. > > Thanks, without line "symbol-file reset.elf" I have no more error &"Error in re-setting breakpoint 3:\n" &"No line 120 in file \"../src/main.c\".\n" but still 156^error,msg="Warning:\nCannot insert breakpoint 6.\nError accessing memory add\ ress 0x0: Unknown error 4294967295.\n" Only after I use "tbreak * 0" ensteed "b * 0" and "delete * 0" it works. Possibly delete * 0 don't working for GDB with ARM remote target. I see Z0,0 command to stub after this breakpoint must be deleted by delete * 0, it is a third breakpoint and it is an error for stub because only two breakpoints are allowed. The lines "symbol-file init.elf" and "b end_init" are not changed and they make no problem. Is the error depend for particular breakpoint type? I mean breakpoint to address is handled in other way as i.e. breakpoint to function. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-26 13:05 ` Efim Monyak @ 2006-07-26 14:10 ` Daniel Jacobowitz 0 siblings, 0 replies; 10+ messages in thread From: Daniel Jacobowitz @ 2006-07-26 14:10 UTC (permalink / raw) To: Efim Monyak; +Cc: gdb On Wed, Jul 26, 2006 at 09:37:40AM +0200, Efim Monyak wrote: > Only after I use "tbreak * 0" ensteed "b * 0" and "delete * 0" it works. > Possibly delete * 0 don't working for GDB with ARM remote target. > I see Z0,0 command to stub after this breakpoint must be deleted > by delete * 0, it is a third breakpoint and it is an error for stub because > only two breakpoints are allowed. > > The lines "symbol-file init.elf" and "b end_init" are not changed and > they make no problem. Is the error depend for particular breakpoint type? > I mean breakpoint to address is handled in other way as i.e. breakpoint to > function. No. I have no idea what that error might be, sorry. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-25 16:28 ` Daniel Jacobowitz 2006-07-25 17:48 ` Efim Monyak @ 2006-07-27 13:34 ` Efim Monyak 2006-07-28 15:37 ` Daniel Jacobowitz 1 sibling, 1 reply; 10+ messages in thread From: Efim Monyak @ 2006-07-27 13:34 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: gdb Daniel Jacobowitz schrieb: > On Tue, Jul 25, 2006 at 06:19:51PM +0200, Efim Monyak wrote: > >> I delete all breakpoints before load the applications again because my >> Hardware supports only two >> breakpoints. In other case I receive error from GDB. The load is >> multistep. In one of steps I must set >> an breakpoint to particular address and only one way I found to put it >> away is command delete all breakpoints. >> As I see no command deletes breakpoint on address. Use breakpoint to >> source line is not very good on this place. >> > > "delete *0x3000000" should work. > > Also, it sounds like you want "disable", not "delete". > > Yes, is where a possibility to save breakpoint state (number, enable or disable) before disable breakpoints and apply it after enable? Because after "disable" command the information about breakpoint state is lost. They all are disabled. I must do it by GDB script. Or is it possible to define an array as long as maximal possible number of breakpoints? I don't found a maximal possible value for $bpnum. >> It is not possible for stub restart the application. They are often >> problem if a remote target is used. >> As I wrote set PC to start address works not properly if i.e. interrupts >> are enabled. >> If application runs from RAM it is lost after Hardware reset. >> >> The only handy way I see is to reload application set all used >> breakpoints and start it again. >> > > In many cases the stub can handle all of this automatically, > manually disabling interrupts et cetera. > > stub receives command "insert breakpoint" for all enabled breakpoints before program step or continue and "remove breakpoint" after program stop. stub don't know breakpoints to be used on the next program step or continue. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: restart for remote target 2006-07-27 13:34 ` Efim Monyak @ 2006-07-28 15:37 ` Daniel Jacobowitz 0 siblings, 0 replies; 10+ messages in thread From: Daniel Jacobowitz @ 2006-07-28 15:37 UTC (permalink / raw) To: Efim Monyak; +Cc: gdb On Thu, Jul 27, 2006 at 01:37:05PM +0200, Efim Monyak wrote: > Yes, is where a possibility to save breakpoint state (number, enable or > disable) before disable > breakpoints and apply it after enable? No. None of these things you want to do are possible in the GDB scripting language; it just isn't complex enough. Sorry. You could possibly drive GDB using something external and the machine interface (MI). There are tentative plans to hook up a real scripting language, but they aren't ready yet - it may be a while. > Because after "disable" command the information about breakpoint state > is lost. They all are disabled. > I must do it by GDB script. > Or is it possible to define an array as long as maximal possible number > of breakpoints? > I don't found a maximal possible value for $bpnum. There isn't a maximum. > >In many cases the stub can handle all of this automatically, > >manually disabling interrupts et cetera. > > > > > > stub receives command "insert breakpoint" for all enabled breakpoints > before program step or continue and > "remove breakpoint" after program stop. > > stub don't know breakpoints to be used on the next program step or continue. I meant have the stub completely handle the restart operation, loading, executing the bootloader, et cetera. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-07-27 13:34 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-07-25 15:45 restart for remote target Efim Monyak 2006-07-25 16:01 ` Daniel Jacobowitz 2006-07-25 16:24 ` Efim Monyak 2006-07-25 16:28 ` Daniel Jacobowitz 2006-07-25 17:48 ` Efim Monyak 2006-07-25 18:22 ` Daniel Jacobowitz 2006-07-26 13:05 ` Efim Monyak 2006-07-26 14:10 ` Daniel Jacobowitz 2006-07-27 13:34 ` Efim Monyak 2006-07-28 15:37 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox