From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#6420: Some enhancements to debugging Date: Sat, 19 Sep 2020 23:17:43 +0200 Message-ID: <87sgbdlb48.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24274"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 6420@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 19 23:18:21 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJkFQ-0006Cr-Rq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Sep 2020 23:18:20 +0200 Original-Received: from localhost ([::1]:40304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJkFP-0003y6-UJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Sep 2020 17:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJkF9-0003xr-6A for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 17:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJkF8-0001dW-9Y for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 17:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJkF8-0003Gy-4S for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 17:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Sep 2020 21:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6420 X-GNU-PR-Package: emacs Original-Received: via spool by 6420-submit@debbugs.gnu.org id=B6420.160055028012573 (code B ref 6420); Sat, 19 Sep 2020 21:18:02 +0000 Original-Received: (at 6420) by debbugs.gnu.org; 19 Sep 2020 21:18:00 +0000 Original-Received: from localhost ([127.0.0.1]:48259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJkF6-0003Gj-9r for submit@debbugs.gnu.org; Sat, 19 Sep 2020 17:18:00 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:52260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJkF3-0003GP-BC for 6420@debbugs.gnu.org; Sat, 19 Sep 2020 17:17:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+CpwMwdqVvfxuoY/I1uR5Up98CkDJCPftWW5+dXgPdE=; b=Kg7Pgu4tU/0oM4tW/h3/fnAuE1 ogPuaRE2NA+kONrAuFWmaaBsRoDgU0LY/D4tIidqebQh4mbxhst/EiJL+aPa2jzX5zropGqWvLnmF xbUgwtghi/1RHYXYmkU7jgk8F1dpRkwjo8Wk6UR3u0ikuwqMXyUSH7/FskwOAm3crlMc=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJkEq-0006Vv-UI; Sat, 19 Sep 2020 23:17:50 +0200 X-Now-Playing: The Art of Noise's _In No Sense? Nonsense!_: "Ode to Don Jose" In-Reply-To: (Lennart Borgman's message of "Mon, 14 Jun 2010 08:11:59 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188439 Archived-At: (This was ten years ago, but didn't get a lot of attention at the time.) Lennart Borgman 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