Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Integration of timed breakpoints into GDB
@ 2011-09-07 23:11 logitech
  2011-09-08  1:30 ` Keith Seitz
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: logitech @ 2011-09-07 23:11 UTC (permalink / raw)
  To: gdb-patches


Hello,
I have attached a patch file which integrates timed breakpoints into gdb. 
http://old.nabble.com/file/p32418104/patchfile.patch patchfile.patch 
The format of the command is "break 'x's 'y'us" where 's' and 'us' stand for
seconds and microseconds respectively. Eg. break 1s 0us
When the program execution begins, it breaks after 1sec. On continuing, the
program resumes again and breaks after 1 sec. 
To continuously break the program after a specific time interval a separate
script can be written as shown :

break 0s 500us
run
while(1)
p $pc
c
end 
quit

Further details about the implementation can be found here 
http://www.youtube.com/watch?v=PAFQlxqI7qs&feature=player_embedded#! GDB
Timed breakpoint  

I would highly appreciate comments and feedback from your side regarding the
same.
Thank you.

-- 
View this message in context: http://old.nabble.com/Integration-of-timed-breakpoints-into-GDB-tp32418104p32418104.html
Sent from the Sourceware - gdb-patches mailing list archive at Nabble.com.


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

* Re: Integration of timed breakpoints into GDB
  2011-09-07 23:11 Integration of timed breakpoints into GDB logitech
@ 2011-09-08  1:30 ` Keith Seitz
  2011-09-08 12:57 ` Abhijit Halder
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Keith Seitz @ 2011-09-08  1:30 UTC (permalink / raw)
  To: logitech; +Cc: gdb-patches

On 09/07/2011 10:42 AM, logitech wrote:

> Further details about the implementation can be found here
> http://www.youtube.com/watch?v=PAFQlxqI7qs&feature=player_embedded#! GDB
> Timed breakpoint
>
> I would highly appreciate comments and feedback from your side regarding the
> same.

Thank you for submitting your new feature patch.

To help facilitate the review of your patch, I urge you to read through 
CONTRIBUTE (found in src/gdb/ or on the gdb web page 
http://sourceware.org/gdb/contribute/ ) and make any necessary changes 
to your contribution mentioned in that file.

Specifically:

- Generate diffs (for source files) using "-up" options, preferably 
against CVS HEAD. Instructions for getting CVS HEAD are on the web page 
at http://sourceware.org/gdb/current/ . No need to send diffs for 
ChangeLogs and generated files (like gdb/configure).

- Read and follow the GNU coding standards. There is more on this on the 
gdb wiki: 
http://sourceware.org/gdb/current/onlinedocs/gdbint/Coding-Standards.html . 
There is also Joel's excellent "cheat sheet" at 
http://sourceware.org/gdb/wiki/JoelsCodingStyleCheatSheet .

- You are not listed in MAINTAINERS, do you and/or your company (if 
necessary) have an assignment with the FSF?

- You did not supply any ChangeLog entry(-ies).

- I don't see a test case for this. You should write one. It is mostly a 
cut-n-paste job today. Don't be afraid to ask for help. [Hint: start 
with any simple test in gdb.base that uses prepare_for_testing.]

- This will require additions to documentation and probably a NEWS entry.

Thank you!
Keith


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

* Re: Integration of timed breakpoints into GDB
  2011-09-07 23:11 Integration of timed breakpoints into GDB logitech
  2011-09-08  1:30 ` Keith Seitz
@ 2011-09-08 12:57 ` Abhijit Halder
  2011-09-08 13:09   ` logitech
  2011-09-10 12:46 ` Jan Kratochvil
  2011-10-03 17:46 ` Tom Tromey
  3 siblings, 1 reply; 6+ messages in thread
From: Abhijit Halder @ 2011-09-08 12:57 UTC (permalink / raw)
  To: logitech; +Cc: gdb-patches

On Wed, Sep 7, 2011 at 11:12 PM, logitech <supriya.rao17@gmail.com> wrote:
>
> Hello,
> I have attached a patch file which integrates timed breakpoints into gdb.
> http://old.nabble.com/file/p32418104/patchfile.patch patchfile.patch
> The format of the command is "break 'x's 'y'us" where 's' and 'us' stand for
> seconds and microseconds respectively. Eg. break 1s 0us
> When the program execution begins, it breaks after 1sec. On continuing, the
> program resumes again and breaks after 1 sec.
> To continuously break the program after a specific time interval a separate
> script can be written as shown :
>
> break 0s 500us
> run
> while(1)
> p $pc
> c
> end
> quit
>
> Further details about the implementation can be found here
> http://www.youtube.com/watch?v=PAFQlxqI7qs&feature=player_embedded#! GDB
> Timed breakpoint
>
> I would highly appreciate comments and feedback from your side regarding the
> same.
> Thank you.
>
> --
> View this message in context: http://old.nabble.com/Integration-of-timed-breakpoints-into-GDB-tp32418104p32418104.html
> Sent from the Sourceware - gdb-patches mailing list archive at Nabble.com.
>
>

I have not yet seen the patch, but before that I would like to get
answer of few questions:
      1. What happen if your program execution is stuck inside a
blocking syscall when it should break? I believe the time you are
talking about is not a hard bound limit.

      2. What is the usecase of this feature?

-Abhijit


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

* Re: Integration of timed breakpoints into GDB
  2011-09-08 12:57 ` Abhijit Halder
@ 2011-09-08 13:09   ` logitech
  0 siblings, 0 replies; 6+ messages in thread
From: logitech @ 2011-09-08 13:09 UTC (permalink / raw)
  To: gdb-patches


Hi,
This breakpoint functions as any normal breakpoint in gdb with the only
added advantage that it can be invoked at a particular time. If in a
blocking syscall, the program execution would be interrupted at the
specified time as it would receive a SIGINT signal. Basically it would
function the same as having a normal break statement in gdb.

The use of this feature is in Real time systems which have a strict time
constraint and if we want to know how much the program has executed in a
specified time. It can also help in sampling data at a particular frequency.
Cheers.

Abhijit Halder wrote:
> 
> On Wed, Sep 7, 2011 at 11:12 PM, logitech <supriya.rao17@gmail.com> wrote:
>>
>> Hello,
>> I have attached a patch file which integrates timed breakpoints into gdb.
>> http://old.nabble.com/file/p32418104/patchfile.patch patchfile.patch
>> The format of the command is "break 'x's 'y'us" where 's' and 'us' stand
>> for
>> seconds and microseconds respectively. Eg. break 1s 0us
>> When the program execution begins, it breaks after 1sec. On continuing,
>> the
>> program resumes again and breaks after 1 sec.
>> To continuously break the program after a specific time interval a
>> separate
>> script can be written as shown :
>>
>> break 0s 500us
>> run
>> while(1)
>> p $pc
>> c
>> end
>> quit
>>
>> Further details about the implementation can be found here
>> http://www.youtube.com/watch?v=PAFQlxqI7qs&feature=player_embedded#! GDB
>> Timed breakpoint
>>
>> I would highly appreciate comments and feedback from your side regarding
>> the
>> same.
>> Thank you.
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Integration-of-timed-breakpoints-into-GDB-tp32418104p32418104.html
>> Sent from the Sourceware - gdb-patches mailing list archive at
>> Nabble.com.
>>
>>
> 
> I have not yet seen the patch, but before that I would like to get
> answer of few questions:
>       1. What happen if your program execution is stuck inside a
> blocking syscall when it should break? I believe the time you are
> talking about is not a hard bound limit.
> 
>       2. What is the usecase of this feature?
> 
> -Abhijit
> 
> 

-- 
View this message in context: http://old.nabble.com/Integration-of-timed-breakpoints-into-GDB-tp32418104p32423483.html
Sent from the Sourceware - gdb-patches mailing list archive at Nabble.com.


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

* Re: Integration of timed breakpoints into GDB
  2011-09-07 23:11 Integration of timed breakpoints into GDB logitech
  2011-09-08  1:30 ` Keith Seitz
  2011-09-08 12:57 ` Abhijit Halder
@ 2011-09-10 12:46 ` Jan Kratochvil
  2011-10-03 17:46 ` Tom Tromey
  3 siblings, 0 replies; 6+ messages in thread
From: Jan Kratochvil @ 2011-09-10 12:46 UTC (permalink / raw)
  To: logitech; +Cc: gdb-patches

On Wed, 07 Sep 2011 19:42:36 +0200, logitech wrote:
> I have attached a patch file which integrates timed breakpoints into gdb. 
> http://old.nabble.com/file/p32418104/patchfile.patch patchfile.patch 
> The format of the command is "break 'x's 'y'us" where 's' and 'us' stand for
> seconds and microseconds respectively. Eg. break 1s 0us
> When the program execution begins, it breaks after 1sec. On continuing, the
> program resumes again and breaks after 1 sec. 

You can do:
(gdb) set target-async on
(gdb) continue &
(gdb) shell sleep 1
(gdb) interrupt


You could also rather code it by the Python scripting.

Isn't this a feature you can implement on top of GDB instead of inside GDB?


Thanks,
Jan


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

* Re: Integration of timed breakpoints into GDB
  2011-09-07 23:11 Integration of timed breakpoints into GDB logitech
                   ` (2 preceding siblings ...)
  2011-09-10 12:46 ` Jan Kratochvil
@ 2011-10-03 17:46 ` Tom Tromey
  3 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2011-10-03 17:46 UTC (permalink / raw)
  To: logitech; +Cc: gdb-patches

>>>>> ">" == logitech  <supriya.rao17@gmail.com> writes:

>> I have attached a patch file which integrates timed breakpoints into gdb. 
>> http://old.nabble.com/file/p32418104/patchfile.patch patchfile.patch 

In addition to the other comments given:

>> The format of the command is "break 'x's 'y'us" where 's' and 'us' stand for
>> seconds and microseconds respectively. Eg. break 1s 0us

I don't think reusing "break" for this is ok.

Instead, make a "catch" subcommand.

I glanced at the implementation and it has various issues.  But I will
reserve detailed comment for a resubmission following Keith's comments.

Tom


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

end of thread, other threads:[~2011-10-03 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-07 23:11 Integration of timed breakpoints into GDB logitech
2011-09-08  1:30 ` Keith Seitz
2011-09-08 12:57 ` Abhijit Halder
2011-09-08 13:09   ` logitech
2011-09-10 12:46 ` Jan Kratochvil
2011-10-03 17:46 ` Tom Tromey

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