unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs C debug help function?
@ 2010-09-10  2:11 Shenli Zhu
  2010-09-10  3:37 ` Stephen J. Turnbull
  2010-09-10  4:02 ` Glenn Morris
  0 siblings, 2 replies; 5+ messages in thread
From: Shenli Zhu @ 2010-09-10  2:11 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Hi Emacs hackers.

I have tried to understand function (debug) on elisp level, and find some
details on C level(e.g. debugger-step-after-exit).
So, I attach emacs process to gdb.

Backtrace is like:
...
#14 0x0818f78b in Ffuncall (nargs=1, args=0xbfa63a00) at eval.c:3021
#15 0x081c8d21 in Fbyte_code (bytestr=154800713, vector=166927821,
maxdepth=16)
    at bytecode.c:680
#16 0x081911b2 in Feval (form=165809550) at eval.c:2352
...

Is there any help function to display form, etc? And is there any
instruction files on hacking C files?

Thanks,
Davy

[-- Attachment #2: Type: text/html, Size: 612 bytes --]

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

* Emacs C debug help function?
  2010-09-10  2:11 Emacs C debug help function? Shenli Zhu
@ 2010-09-10  3:37 ` Stephen J. Turnbull
  2010-09-10  8:43   ` Shenli Zhu
  2010-09-10  4:02 ` Glenn Morris
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen J. Turnbull @ 2010-09-10  3:37 UTC (permalink / raw)
  To: Shenli Zhu; +Cc: emacs-devel

Shenli Zhu writes:

 > Is there any help function to display form, etc?

Yes.  Type "help user" to gdb for an annotated list.  If you don't
understand how to use them from that list, or need help interpreting
results, please ask specifically.

 > And is there any instruction files on hacking C files?

For advice on writing code, as far as I know there is a little bit in
the Emacs Lisp Reference, and for the general structure of C support
for Lisp, online there's

    http://www.xemacs.org/Documentation/21.5/html/internals.html

Warning: Emacs and XEmacs redisplays are completely different, as are
text properties and extents.  The Lisp language implementation is
pretty similar, as are the buffer and string structures.  (You need to
be a little careful with text as XEmacs still uses Mule code
internally, but it has the same formal properties, eg, finding
character boundaries in O(1), etc, and many of the same higher-level
APIs for actually handling encoding as used in Emacs.)

For the style you should use in writing code, there is the GNU coding
standard, which I believe is distributed somewhere with Emacs.  If
not, you can install XEmacs and throw away everything except the
"standards.info" file. :-)  (Sorry, we don't provide an online
version.  Probably somewhere on the GNU site?)



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

* Re: Emacs C debug help function?
  2010-09-10  2:11 Emacs C debug help function? Shenli Zhu
  2010-09-10  3:37 ` Stephen J. Turnbull
@ 2010-09-10  4:02 ` Glenn Morris
  2010-09-10  8:40   ` Shenli Zhu
  1 sibling, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2010-09-10  4:02 UTC (permalink / raw)
  To: Shenli Zhu; +Cc: emacs-devel

Shenli Zhu wrote:

> Backtrace is like:
> ...
> #14 0x0818f78b in Ffuncall (nargs=1, args=0xbfa63a00) at eval.c:3021
> #15 0x081c8d21 in Fbyte_code (bytestr=154800713, vector=166927821,
> maxdepth=16)
>     at bytecode.c:680
> #16 0x081911b2 in Feval (form=165809550) at eval.c:2352
> ...
>
> Is there any help function to display form, etc?

Try reading etc/DEBUG.



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

* Re: Emacs C debug help function?
  2010-09-10  4:02 ` Glenn Morris
@ 2010-09-10  8:40   ` Shenli Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Shenli Zhu @ 2010-09-10  8:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

On Fri, Sep 10, 2010 at 12:02 PM, Glenn Morris <rgm@gnu.org> wrote:

> Shenli Zhu wrote:
>
> > Backtrace is like:
> > ...
> > #14 0x0818f78b in Ffuncall (nargs=1, args=0xbfa63a00) at eval.c:3021
> > #15 0x081c8d21 in Fbyte_code (bytestr=154800713, vector=166927821,
> > maxdepth=16)
> >     at bytecode.c:680
> > #16 0x081911b2 in Feval (form=165809550) at eval.c:2352
> > ...
> >
> > Is there any help function to display form, etc?
>
> Try reading etc/DEBUG.
>

Hi Glenn, it's informative, thank you.

[-- Attachment #2: Type: text/html, Size: 856 bytes --]

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

* Re: Emacs C debug help function?
  2010-09-10  3:37 ` Stephen J. Turnbull
@ 2010-09-10  8:43   ` Shenli Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Shenli Zhu @ 2010-09-10  8:43 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]

On Fri, Sep 10, 2010 at 11:37 AM, Stephen J. Turnbull <stephen@xemacs.org>wrote:

> Shenli Zhu writes:
>
>  > Is there any help function to display form, etc?
>
> Yes.  Type "help user" to gdb for an annotated list.  If you don't
> understand how to use them from that list, or need help interpreting
> results, please ask specifically.
>
>  > And is there any instruction files on hacking C files?
>
> For advice on writing code, as far as I know there is a little bit in
> the Emacs Lisp Reference, and for the general structure of C support
> for Lisp, online there's
>
>    http://www.xemacs.org/Documentation/21.5/html/internals.html
>
> Warning: Emacs and XEmacs redisplays are completely different, as are
> text properties and extents.  The Lisp language implementation is
> pretty similar, as are the buffer and string structures.  (You need to
> be a little careful with text as XEmacs still uses Mule code
> internally, but it has the same formal properties, eg, finding
> character boundaries in O(1), etc, and many of the same higher-level
> APIs for actually handling encoding as used in Emacs.)
>
> For the style you should use in writing code, there is the GNU coding
> standard, which I believe is distributed somewhere with Emacs.  If
> not, you can install XEmacs and throw away everything except the
> "standards.info" file. :-)  (Sorry, we don't provide an online
> version.  Probably somewhere on the GNU site?)
>

Hi Stephen, it's what I need, thank you.

[-- Attachment #2: Type: text/html, Size: 2063 bytes --]

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

end of thread, other threads:[~2010-09-10  8:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10  2:11 Emacs C debug help function? Shenli Zhu
2010-09-10  3:37 ` Stephen J. Turnbull
2010-09-10  8:43   ` Shenli Zhu
2010-09-10  4:02 ` Glenn Morris
2010-09-10  8:40   ` Shenli Zhu

Code repositories for project(s) associated with this public inbox

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

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).