unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: 6420@debbugs.gnu.org
Subject: bug#6420: Some enhancements to debugging
Date: Sat, 19 Sep 2020 23:17:43 +0200	[thread overview]
Message-ID: <87sgbdlb48.fsf@gnus.org> (raw)
In-Reply-To: <AANLkTik99WC9EFutx_OApcCx6ATeMVmqhdsZ73AFrzGk@mail.gmail.com> (Lennart Borgman's message of "Mon, 14 Jun 2010 08:11:59 +0200")

(This was ten years ago, but didn't get a lot of attention at the time.)

Lennart Borgman <lennart.borgman@gmail.com> writes:

> Here are some patches to make debugging easier.
>
> The first patch adds thread id to the output when running on w32. That
> is very important information when you try to debug system calls and
> thread usage. (w32proc-debprint-thread-0.diff)
>
> The second patch adds a way to print output to the debugger from lisp.
> (gdb-deb-print-0.diff)
>
> The third patch lets you output tracing of functions to the debugger
> too. This patch also have some convenience things like making the
> function at point default for function name.
> (trace-to-debugger-0.diff)

[...]

> +  /* On NT add thread id */
> +#ifdef WINDOWSNT
> +  DWORD thread_id = GetCurrentThreadId ();
> +  sprintf (buf_pos, "[Th%04x]  ", thread_id);
> +  buf_pos = buf_pos + 10;
> +#endif
>  
>    va_start (args, fmt);
> -  vsprintf (buf, fmt, args);
> +  vsprintf (buf_pos, fmt, args);
>    va_end (args);
>    OutputDebugString (buf);
>  }

This patch has nothing to do with the rest, I guess?  Eli had comments
on the style, but not the utility of the change.  Eli, would adding this
be useful (after fixing the coding issues)?

The rest of the patch set is about adding support for DebPrint from
Lisp, which I have no opinion about, because I've never used DebPrint:

> +DEFUN ("gdb-deb-print", Fgdb_deb_print, Sgdb_deb_print, 1, MANY, 0,
> +       doc: /* Display a message in the debugger.
> +Does nothing unless Emacs is compiled with debugging support.
> +
> +The first argument is a format control string, and the rest are data
> +to be formatted under control of the string.  See `format' for
> +details.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2020-09-19 21:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  6:11 bug#6420: Some enhancements to debugging Lennart Borgman
2010-06-14 17:58 ` Eli Zaretskii
2010-06-14 18:02   ` Lennart Borgman
2020-09-19 21:17 ` Lars Ingebrigtsen [this message]
2021-05-10 11:11   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgbdlb48.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=6420@debbugs.gnu.org \
    --cc=lennart.borgman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).