Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: Breakpoint when entering of functions on i386
       [not found] <5f7f5dec0711252308r5825abb8j91d43234ef7b617c@mail.gmail.com>
@ 2007-11-26  7:10 ` yichun wang
  2007-11-26 18:23   ` Michael Snyder
  0 siblings, 1 reply; 9+ messages in thread
From: yichun wang @ 2007-11-26  7:10 UTC (permalink / raw)
  To: gdb

Hi,

I'm now working on a script which will print calling graph by stepping
through program with GDB. The script actually works fine in some small
cases, but one big performance bottleneck is that I used "watch $ebp"
to catch the happening of function call, and it will become really
slow when in some cases, local variable/arguments are heavily used. So
my question is:

    Is there any better way in GDB to capture function call event?

Thanks,
-Yichun.


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

* Re: Breakpoint when entering of functions on i386
  2007-11-26  7:10 ` Breakpoint when entering of functions on i386 yichun wang
@ 2007-11-26 18:23   ` Michael Snyder
  2007-11-27  5:52     ` yichun wang
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2007-11-26 18:23 UTC (permalink / raw)
  To: yichun wang; +Cc: gdb

On Mon, 2007-11-26 at 15:10 +0800, yichun wang wrote:
> Hi,
> 
> I'm now working on a script which will print calling graph by stepping
> through program with GDB. The script actually works fine in some small
> cases, but one big performance bottleneck is that I used "watch $ebp"
> to catch the happening of function call, and it will become really
> slow when in some cases, local variable/arguments are heavily used. So
> my question is:
> 
>     Is there any better way in GDB to capture function call event?

What about just setting breakpoints on all functions?

That way, if there is a way to define an "interesting subset"
of functions, you can limit your breakpoints to that subset, 
and save a lot of time.




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

* Re: Breakpoint when entering of functions on i386
  2007-11-26 18:23   ` Michael Snyder
@ 2007-11-27  5:52     ` yichun wang
  2007-11-27  7:25       ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: yichun wang @ 2007-11-27  5:52 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb

Thanks Michael,  to define an "interesting subset" should improve the
performance , but I need generate call graph for many different
applications, and this script won't have any knowledge of the
application, so this might not work...

Thanks,
-Yichun.

On Nov 27, 2007 2:10 AM, Michael Snyder <msnyder@specifix.com> wrote:
>
> On Mon, 2007-11-26 at 15:10 +0800, yichun wang wrote:
> > Hi,
> >
> > I'm now working on a script which will print calling graph by stepping
> > through program with GDB. The script actually works fine in some small
> > cases, but one big performance bottleneck is that I used "watch $ebp"
> > to catch the happening of function call, and it will become really
> > slow when in some cases, local variable/arguments are heavily used. So
> > my question is:
> >
> >     Is there any better way in GDB to capture function call event?
>
> What about just setting breakpoints on all functions?
>
> That way, if there is a way to define an "interesting subset"
> of functions, you can limit your breakpoints to that subset,
> and save a lot of time.
>
>
>
>


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

* Re: Breakpoint when entering of functions on i386
  2007-11-27  5:52     ` yichun wang
@ 2007-11-27  7:25       ` Joel Brobecker
  2007-11-27  7:53         ` yichun wang
  2007-11-27 20:51         ` Michael Snyder
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Brobecker @ 2007-11-27  7:25 UTC (permalink / raw)
  To: yichun wang; +Cc: Michael Snyder, gdb

> Thanks Michael,  to define an "interesting subset" should improve the
> performance , but I need generate call graph for many different
> applications, and this script won't have any knowledge of the
> application, so this might not work...

Is there a reason why you have to use GDB instead of a more specialized
tool?

-- 
Joel


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

* Re: Breakpoint when entering of functions on i386
  2007-11-27  7:25       ` Joel Brobecker
@ 2007-11-27  7:53         ` yichun wang
  2007-11-27 20:51         ` Michael Snyder
  1 sibling, 0 replies; 9+ messages in thread
From: yichun wang @ 2007-11-27  7:53 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Michael Snyder, gdb

GDB is easy to interact and control, for example, one feature of my
script is to start print calling graph after hit some function (just a
breakpoint),  or to print the value of arguments. It can simply give
you many controls of program, for source level to assembly level, with
little programming job.

Other tools could be also possible, for example, a plugin to
valgrind/callgrind will also work, but it may require more knowledge
and programming. Currently I'm using perl+gdb, except performance, the
script works just fine.

-Yichun.

On Nov 27, 2007 3:25 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> > Thanks Michael,  to define an "interesting subset" should improve the
> > performance , but I need generate call graph for many different
> > applications, and this script won't have any knowledge of the
> > application, so this might not work...
>
> Is there a reason why you have to use GDB instead of a more specialized
> tool?
>
> --
> Joel
>


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

* Re: Breakpoint when entering of functions on i386
  2007-11-27  7:25       ` Joel Brobecker
  2007-11-27  7:53         ` yichun wang
@ 2007-11-27 20:51         ` Michael Snyder
  2007-11-27 21:04           ` Joel Brobecker
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2007-11-27 20:51 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: yichun wang, gdb

On Mon, 2007-11-26 at 23:25 -0800, Joel Brobecker wrote:
> > Thanks Michael,  to define an "interesting subset" should improve the
> > performance , but I need generate call graph for many different
> > applications, and this script won't have any knowledge of the
> > application, so this might not work...
> 
> Is there a reason why you have to use GDB instead of a more specialized
> tool?

GDB is the swiss army knife of software development.
;-)




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

* Re: Breakpoint when entering of functions on i386
  2007-11-27 20:51         ` Michael Snyder
@ 2007-11-27 21:04           ` Joel Brobecker
  2007-11-28  0:42             ` Michael Snyder
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2007-11-27 21:04 UTC (permalink / raw)
  To: Michael Snyder; +Cc: yichun wang, gdb

> GDB is the swiss army knife of software development.
> ;-)

Yeah, but then you have to accept sometimes that it won't be as sharp
as a chef's knife :-).

-- 
Joel


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

* Re: Breakpoint when entering of functions on i386
  2007-11-27 21:04           ` Joel Brobecker
@ 2007-11-28  0:42             ` Michael Snyder
  2007-11-28  0:46               ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2007-11-28  0:42 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: yichun wang, gdb

On Tue, 2007-11-27 at 13:04 -0800, Joel Brobecker wrote:
> > GDB is the swiss army knife of software development.
> > ;-)
> 
> Yeah, but then you have to accept sometimes that it won't be as sharp
> as a chef's knife :-).

Nor as heavy as a sledge hammer.  But then, it's sharper than
a sledge hammer, and sometimes all you have is a swiss army 
knife.




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

* Re: Breakpoint when entering of functions on i386
  2007-11-28  0:42             ` Michael Snyder
@ 2007-11-28  0:46               ` Joel Brobecker
  0 siblings, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2007-11-28  0:46 UTC (permalink / raw)
  To: Michael Snyder; +Cc: yichun wang, gdb

> > Yeah, but then you have to accept sometimes that it won't be as sharp
> > as a chef's knife :-).
> 
> Nor as heavy as a sledge hammer.  But then, it's sharper than
> a sledge hammer, and sometimes all you have is a swiss army 
> knife.

Right - Just to be clear, I wasn't trying to imply that GDB shouldn't be
used in this case, but making sure that the user was aware of other more
specialized options that may (or not) work better for him.

-- 
Joel


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

end of thread, other threads:[~2007-11-28  0:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5f7f5dec0711252308r5825abb8j91d43234ef7b617c@mail.gmail.com>
2007-11-26  7:10 ` Breakpoint when entering of functions on i386 yichun wang
2007-11-26 18:23   ` Michael Snyder
2007-11-27  5:52     ` yichun wang
2007-11-27  7:25       ` Joel Brobecker
2007-11-27  7:53         ` yichun wang
2007-11-27 20:51         ` Michael Snyder
2007-11-27 21:04           ` Joel Brobecker
2007-11-28  0:42             ` Michael Snyder
2007-11-28  0:46               ` Joel Brobecker

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