public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Recursive call to stepi and "Max user call depth exceeded"
@ 2011-11-04 17:04 Thomas Baruchel
  2011-11-04 17:23 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Baruchel @ 2011-11-04 17:04 UTC (permalink / raw)
  To: gdb

Hi,

I tried to use the following trick:

define s
info float
stepi
s
end

(based on an idea found there:
http://stackoverflow.com/questions/7940963/trace-application-compiled-by-gcc )

But I soon encountered the error:
   Max user call depth exceeded -- command aborted.

What I am trying to do is: print the fpu register after each machine instruction
(of course output is parsed by an external program), but using a recursive
function obviously is a bad idea. How can I run my program step by step
and print the fpu after each step? Regards,

-- 
Thomas Baruchel

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

* Re: Recursive call to stepi and "Max user call depth exceeded"
  2011-11-04 17:04 Recursive call to stepi and "Max user call depth exceeded" Thomas Baruchel
@ 2011-11-04 17:23 ` Pedro Alves
  2011-11-04 17:47   ` Run until some FPU register has changed Thomas Baruchel
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2011-11-04 17:23 UTC (permalink / raw)
  To: gdb, baruchel

On Friday 04 November 2011 17:03:53, Thomas Baruchel wrote:
> Hi,
> 
> I tried to use the following trick:
> 
> define s
> info float
> stepi
> s
> end
> 
> (based on an idea found there:
> http://stackoverflow.com/questions/7940963/trace-application-compiled-by-gcc )
> 
> But I soon encountered the error:
>    Max user call depth exceeded -- command aborted.
>
> What I am trying to do is: print the fpu register after each machine instruction
> (of course output is parsed by an external program), but using a recursive
> function obviously is a bad idea. How can I run my program step by step
> and print the fpu after each step? Regards,

Right, don't make the command recursive.  That was bogus advice.

  (gdb) define mystepi
   > si
   > info float
   > end
  (gdb) while 1
    > mystepi
    > end

Or instead:

  (gdb) define hook-stop
   > info float
   > end
  (gdb) while 1
   > si
   > end

-- 
Pedro Alves

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

* Run until some FPU register has changed
  2011-11-04 17:23 ` Pedro Alves
@ 2011-11-04 17:47   ` Thomas Baruchel
  2011-11-04 17:55     ` Jonas Maebe
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Baruchel @ 2011-11-04 17:47 UTC (permalink / raw)
  To: gdb

On Fri, 4 Nov 2011, Pedro Alves wrote:
>  (gdb) define hook-stop
>   > info float
>   > end
>  (gdb) while 1
>   > si
>   > end

Thank you. Now I have something runnable. Maybe the following refinement would
be highly appreciable: instead of "stepi", is there a way to tell:

   "run until any register in FPU has changed"

(or at least):

   "run until register 0 in FPU has changed"

Regards,

-- 
Thomas Baruchel

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

* Re: Run until some FPU register has changed
  2011-11-04 17:47   ` Run until some FPU register has changed Thomas Baruchel
@ 2011-11-04 17:55     ` Jonas Maebe
  2011-11-04 18:37       ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Jonas Maebe @ 2011-11-04 17:55 UTC (permalink / raw)
  To: gdb


On 04 Nov 2011, at 18:47, Thomas Baruchel wrote:

>  "run until register 0 in FPU has changed"

The "watch" command also works with registers, so
  watch $f0
  c

should work (replace f0 with the actual name of floating point register 0). You can oif course set watchpoints on all floating point registers, although I don't know how much extra slowdown that will cause.


Jonas

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

* Re: Run until some FPU register has changed
  2011-11-04 17:55     ` Jonas Maebe
@ 2011-11-04 18:37       ` Pedro Alves
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2011-11-04 18:37 UTC (permalink / raw)
  To: gdb; +Cc: Jonas Maebe

On Friday 04 November 2011 17:55:12, Jonas Maebe wrote:
> 
> On 04 Nov 2011, at 18:47, Thomas Baruchel wrote:
> 
> >  "run until register 0 in FPU has changed"
> 
> The "watch" command also works with registers, so
>   watch $f0
>   c
> 
> should work (replace f0 with the actual name of floating point register 0). You can oif course set watchpoints on all floating point registers, although I don't know how much extra slowdown that will cause.

I assume pretty much negligible compared to watching a single register.
GDB will need to force single-stepping of the target behind the scenes in
both cases, and pulling a single float register out of the target is
already likely pulling them all.

-- 
Pedro Alves

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

end of thread, other threads:[~2011-11-04 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-04 17:04 Recursive call to stepi and "Max user call depth exceeded" Thomas Baruchel
2011-11-04 17:23 ` Pedro Alves
2011-11-04 17:47   ` Run until some FPU register has changed Thomas Baruchel
2011-11-04 17:55     ` Jonas Maebe
2011-11-04 18:37       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).