Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Pause
@ 2005-01-03 10:39 Russell Shaw
  2005-01-03 13:02 ` Pause Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Russell Shaw @ 2005-01-03 10:39 UTC (permalink / raw)
  To: gdb

Hi,
I set up .gdbinit so that with a single command, gdb can
load a new file to be debugged, and start a simulator:

define simul
     detach
     shell killall -sHUP simulavr
     shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
     file loader_02
     target remote localhost:4242
end

This works ok if i type one line at a time. If i type "simul", the
commands happen too fast and gdb gives an error message before the
simulator has started. Does gdb have a "pause" or delay command?
I need one here:

define simul
     detach
     shell killall -sHUP simulavr
     shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
     file loader_02

     < delay 300ms >

     target remote localhost:4242
end


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pause
  2005-01-03 10:39 Pause Russell Shaw
@ 2005-01-03 13:02 ` Andreas Schwab
  2005-01-03 13:05 ` Pause Russell Shaw
  2005-01-04  4:39 ` Pause Eli Zaretskii
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2005-01-03 13:02 UTC (permalink / raw)
  To: Russell Shaw; +Cc: gdb

Russell Shaw <rjshaw@netspace.net.au> writes:

> Does gdb have a "pause" or delay command?

There is nothing predefined, but as a workaround you could use a counting
loop.  Of course, you need to calibrate it first.

> I need one here:
>
> define simul
>      detach
>      shell killall -sHUP simulavr
>      shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
>      file loader_02
       set $i = 0
       while ($i++ < 100000)
       end
>      target remote localhost:4242
> end
>

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pause
  2005-01-03 10:39 Pause Russell Shaw
  2005-01-03 13:02 ` Pause Andreas Schwab
@ 2005-01-03 13:05 ` Russell Shaw
  2005-01-04  4:39 ` Pause Eli Zaretskii
  2 siblings, 0 replies; 5+ messages in thread
From: Russell Shaw @ 2005-01-03 13:05 UTC (permalink / raw)
  Cc: gdb

Russell Shaw wrote:
> Hi,
> I set up .gdbinit so that with a single command, gdb can
> load a new file to be debugged, and start a simulator:
> 
> define simul
>     detach
>     shell killall -sHUP simulavr
>     shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
>     file loader_02
>     target remote localhost:4242
> end
> 
> This works ok if i type one line at a time. If i type "simul", the
> commands happen too fast and gdb gives an error message before the
> simulator has started. Does gdb have a "pause" or delay command?
> I need one here:
> 
> define simul
>     detach
>     shell killall -sHUP simulavr
>     shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
>     file loader_02
> 
>     < delay 300ms >
> 
>     target remote localhost:4242
> end

On second thoughts, i'll modify simulavr so that it sets itself up
properly before it forks (instead of using the shell fork &).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pause
  2005-01-03 10:39 Pause Russell Shaw
  2005-01-03 13:02 ` Pause Andreas Schwab
  2005-01-03 13:05 ` Pause Russell Shaw
@ 2005-01-04  4:39 ` Eli Zaretskii
  2005-01-04  4:43   ` Pause Russell Shaw
  2 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2005-01-04  4:39 UTC (permalink / raw)
  To: Russell Shaw; +Cc: gdb

> Date: Mon, 03 Jan 2005 21:43:42 +1100
> From: Russell Shaw <rjshaw@netspace.net.au>
> 
> Does gdb have a "pause" or delay command?  I need one here:
> 
> define simul
>      detach
>      shell killall -sHUP simulavr
>      shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
>      file loader_02
> 
>      < delay 300ms >
> 
>      target remote localhost:4242
> end

Would "shell sleep 1" do the trick?  (If 1 second is too long, you
could write a simple program that called nanosleep or some such to
sleep with finer granularity.)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pause
  2005-01-04  4:39 ` Pause Eli Zaretskii
@ 2005-01-04  4:43   ` Russell Shaw
  0 siblings, 0 replies; 5+ messages in thread
From: Russell Shaw @ 2005-01-04  4:43 UTC (permalink / raw)
  Cc: gdb

Eli Zaretskii wrote:
>>Date: Mon, 03 Jan 2005 21:43:42 +1100
>>From: Russell Shaw <rjshaw@netspace.net.au>
>>
>>Does gdb have a "pause" or delay command?  I need one here:
>>
>>define simul
>>     detach
>>     shell killall -sHUP simulavr
>>     shell simulavr -g -p 4242 -d atmega16 -c 16000000 loader_02.bin &
>>     file loader_02
>>
>>     < delay 300ms >
>>
>>     target remote localhost:4242
>>end
> 
> Would "shell sleep 1" do the trick?  (If 1 second is too long, you
> could write a simple program that called nanosleep or some such to
> sleep with finer granularity.)

shell sleep 1 should work well. Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-04  4:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-03 10:39 Pause Russell Shaw
2005-01-03 13:02 ` Pause Andreas Schwab
2005-01-03 13:05 ` Pause Russell Shaw
2005-01-04  4:39 ` Pause Eli Zaretskii
2005-01-04  4:43   ` Pause Russell Shaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox