all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gdb doc
@ 2007-03-21 13:39 A Soare
  2007-03-21 19:58 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: A Soare @ 2007-03-21 13:39 UTC (permalink / raw)
  To: Emacs   Dev  [emacs-devel]

I do not find in documentation how can I set a condition for gdb to stop to a breakpoint in Feval when such a condition is accomplished:

1. lisp function name that is evaluated is "+".

or

2. number of arguments is eq with 10.

Thanks.

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

* Re: gdb doc
  2007-03-21 13:39 A Soare
@ 2007-03-21 19:58 ` Eli Zaretskii
  2007-03-22 15:38   ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2007-03-21 19:58 UTC (permalink / raw)
  To: alinsoar; +Cc: emacs-devel

> From: A Soare <alinsoar@voila.fr>
> Date: Wed, 21 Mar 2007 14:39:27 +0100 (CET)
> 
> I do not find in documentation how can I set a condition for gdb to stop to a breakpoint in Feval when such a condition is accomplished:
> 
> 1. lisp function name that is evaluated is "+".

Compare the car of the Feval's argument with Qplus.

> 2. number of arguments is eq with 10.

Try calling Flength on the cdr of the Feval's arguments, and compare
the result with 10.

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

* Re: gdb doc
@ 2007-03-22 11:40 A Soare
  0 siblings, 0 replies; 9+ messages in thread
From: A Soare @ 2007-03-22 11:40 UTC (permalink / raw)
  To: Emacs   Dev  [emacs-devel]


> > I do not find in documentation how can I set a condition for gdb to stop to a breakpoint in Feval when such a condition is accomplished:
> > 
> > 1. lisp function name that is evaluated is "+".
> 
> Compare the car of the Feval's argument with Qplus.
> 
> > 2. number of arguments is eq with 10.
> 
> Try calling Flength on the cdr of the Feval's arguments, and compare
> the result with 10.


Thanks

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

* Re: gdb doc
@ 2007-03-22 11:59 A Soare
  2007-03-23 13:04 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: A Soare @ 2007-03-22 11:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs   Help  [help-gnu-emacs], Emacs   Dev  [emacs-devel]

> > I do not find in documentation how can I set a condition for gdb to stop to a breakpoint in Feval when such a condition is accomplished:
> > 
> > 1. lisp function name that is evaluated is "+".
> 
> Compare the car of the Feval's argument with Qplus.


I tried t

(gdb) br Feval
Breakpoint 3 at 0x8152849: file eval.c, line 2205.o do so:
(gdb) r
Starting program: /mnt/gnu/emacs/src/emacs -geometry 80x40+0+0
[Thread debugging using libthread_db enabled]
[New Thread -1208109376 (LWP 2650)]
[Switching to Thread -1208109376 (LWP 2650)]
Breakpoint 4 at 0x80c88e6: file xterm.c, line 7859.

Breakpoint 3, Feval (form=139269229) at eval.c:2205
(gdb) p form
$1 = 139269229
(gdb) xcar form
$2 = 0x8540b91

Now I wish to do 

(gdb) commands

and here I do not know how to write CONDITION in

  if <CONDITION>
    break
  end
  continue
end

Can you help me a little mode to write the condition please?

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

* Re: gdb doc
@ 2007-03-22 12:50 A Soare
  0 siblings, 0 replies; 9+ messages in thread
From: A Soare @ 2007-03-22 12:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs   Help  [help-gnu-emacs], Emacs   Dev  [emacs-devel]

> > I do not find in documentation how can I set a condition for gdb to stop to a breakpoint in Feval when such a condition is accomplished:
> > 
> > 1. lisp function name that is evaluated is "+".
> 
> Compare the car of the Feval's argument with Qplus.


I tried t

(gdb) br Feval
Breakpoint 3 at 0x8152849: file eval.c, line 2205.o do so:
(gdb) r
Starting program: /mnt/gnu/emacs/src/emacs -geometry 80x40+0+0
[Thread debugging using libthread_db enabled]
[New Thread -1208109376 (LWP 2650)]
[Switching to Thread -1208109376 (LWP 2650)]
Breakpoint 4 at 0x80c88e6: file xterm.c, line 7859.

Breakpoint 3, Feval (form=139269229) at eval.c:2205
(gdb) p form
$1 = 139269229
(gdb) xcar form
$2 = 0x8540b91

Now I wish to do 

(gdb) commands

and here I do not know how to write CONDITION in

  if <CONDITION>
    break
  end
  continue
end

Can you help me a little mode to write the condition please?



Finally I got it alone...

Alin Soare

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

* Re: gdb doc
  2007-03-21 19:58 ` Eli Zaretskii
@ 2007-03-22 15:38   ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2007-03-22 15:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: alinsoar, emacs-devel

    > 1. lisp function name that is evaluated is "+".

    Compare the car of the Feval's argument with Qplus.

    > 2. number of arguments is eq with 10.

    Try calling Flength on the cdr of the Feval's arguments, and compare
    the result with 10.

Those are good examples for teaching people how to
take advantage of these features.
How about adding these examples to etc/DEBUG?

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

* Re: gdb doc
  2007-03-22 11:59 A Soare
@ 2007-03-23 13:04 ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2007-03-23 13:04 UTC (permalink / raw)
  To: emacs-devel, help-gnu-emacs

> From: A Soare <alinsoar@voila.fr>
> Cc: "Emacs   Dev  [emacs-devel]" <emacs-devel@gnu.org>,
> 	"Emacs   Help  [help-gnu-emacs]" <help-gnu-emacs@gnu.org>
> Date: Thu, 22 Mar 2007 12:59:11 +0100 (CET)
> 
> Breakpoint 3, Feval (form=139269229) at eval.c:2205
> (gdb) p form
> $1 = 139269229
> (gdb) xcar form
> $2 = 0x8540b91
> 
> Now I wish to do 
> 
> (gdb) commands
> 
> and here I do not know how to write CONDITION in
> 
>   if <CONDITION>
>     break

No, you need to say "break Feval if <CONDITION>".

> Can you help me a little mode to write the condition please?

I don't have time to write and test a complete script, sorry.  You
will need to look in lisp.h for the definition of the XCAR macro, or
in src/.gdbinit for the definition of `xcar', and use the same
expressions in the condition.  Something like the following
(untested!):

  break Feval if ((struct Lisp_Cons *) ((gdb_use_union ? form.u.val : form & $valmask) | gdb_data_seg_bits))->car == Qplus

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

* Re: gdb doc
@ 2007-03-23 14:51 A Soare
  0 siblings, 0 replies; 9+ messages in thread
From: A Soare @ 2007-03-23 14:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Emacs   Help  [help-gnu-emacs]

 > and here I do not know how to write CONDITION in
 >
 >   if <CONDITION>
 >     break

 No, you need to say "break Feval if <CONDITION>".

 > Can you help me a little mode to write the condition please?

 I don't have time to write and test a complete script, sorry.  You
 will need to look in lisp.h for the definition of the XCAR macro, or
 in src/.gdbinit for the definition of `xcar', and use the same
 expressions in the condition.  Something like the following
 (untested!):

   break Feval if ((struct Lisp_Cons *) ((gdb_use_union ? form.u.val : form & $valmask) | gdb_data_seg_bits))->car == Qplus


Thanks a lot.


Alin Soare.

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

* Re: gdb doc
@ 2007-03-27  9:06 A Soare
  0 siblings, 0 replies; 9+ messages in thread
From: A Soare @ 2007-03-27  9:06 UTC (permalink / raw)
  To: rms; +Cc: Emacs   Dev  [emacs-devel]




> Message du 22/03/07 à 16h40
> De : "Richard Stallman" <rms@gnu.org>
> A : "Eli Zaretskii" <eliz@gnu.org>
> Copie à : alinsoar@voila.fr, emacs-devel@gnu.org
> Objet : Re: gdb doc
> 
>     > 1. lisp function name that is evaluated is "+".
> 
>     Compare the car of the Feval's argument with Qplus.
> 
>     > 2. number of arguments is eq with 10.
> 
>     Try calling Flength on the cdr of the Feval's arguments, and compare
>     the result with 10.
> 
> Those are good examples for teaching people how to
> take advantage of these features.
> How about adding these examples to etc/DEBUG?
> 
> 

When I clarify some many problems about debugging Feval I will add the documentation in etc/DEBUG and maybe a code in src/.gdbinit.

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

end of thread, other threads:[~2007-03-27  9:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-22 12:50 gdb doc A Soare
  -- strict thread matches above, loose matches on Subject: below --
2007-03-27  9:06 A Soare
2007-03-23 14:51 A Soare
2007-03-22 11:59 A Soare
2007-03-23 13:04 ` Eli Zaretskii
2007-03-22 11:40 A Soare
2007-03-21 13:39 A Soare
2007-03-21 19:58 ` Eli Zaretskii
2007-03-22 15:38   ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.