From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16068: 24.3; Printing doesn't work Date: Fri, 06 Dec 2013 16:53:19 +0200 Message-ID: <83iov2115s.fsf@gnu.org> References: <83siu61hye.fsf@gnu.org> <83r49q1exg.fsf@gnu.org> <83pppa1b12.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1386342295 27830 80.91.229.3 (6 Dec 2013 15:04:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Dec 2013 15:04:55 +0000 (UTC) Cc: 16068@debbugs.gnu.org To: =?UTF-8?Q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9_?= =?UTF-8?Q?=D0=9F=D0=B0=D1=80=D0=B0=D0=BC=D0=BE=D0=BD=D0=BE=D0=B2?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 16:04:59 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vowxc-0004Vh-F9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 16:04:56 +0100 Original-Received: from localhost ([::1]:59513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vowxb-0000pZ-JE for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 10:04:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VowxS-0000pI-IW for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 10:04:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VowxM-0001Ow-Mx for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 10:04:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VowxM-0001Os-J2 for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 10:04:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vown4-0004n0-FU for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 09:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2013 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16068 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16068-submit@debbugs.gnu.org id=B16068.138634161918378 (code B ref 16068); Fri, 06 Dec 2013 14:54:02 +0000 Original-Received: (at 16068) by debbugs.gnu.org; 6 Dec 2013 14:53:39 +0000 Original-Received: from localhost ([127.0.0.1]:33528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vowmg-0004mK-78 for submit@debbugs.gnu.org; Fri, 06 Dec 2013 09:53:39 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:50526) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vowmc-0004m9-Uq for 16068@debbugs.gnu.org; Fri, 06 Dec 2013 09:53:36 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MXE00I003DT8X00@a-mtaout22.012.net.il> for 16068@debbugs.gnu.org; Fri, 06 Dec 2013 16:53:33 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MXE00H0L415X1A0@a-mtaout22.012.net.il>; Fri, 06 Dec 2013 16:53:29 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81529 Archived-At: > From: Андрей Парамонов > Date: Fri, 6 Dec 2013 16:00:34 +0400 > Cc: 16068@debbugs.gnu.org > > > Is it possible for you to step through default-printer-name with GDB > > and see what happens there? I can send you detailed instructions, if > > you need them. > > > > Please do. See below, and thanks in advance. > Is it correct that default-printer-name is implemented in C (which is why I > need GDB)? Yes, this is correct. I see that you are using Emacs 24.3, which is an official release. I suspect that this binary has been stripped of debugging symbols, so you will be unable to debug it on the C source level. So the first thing I suggest to do after installing GDB (let me know if you need a link for a Windows port of GDB) is type this from the shell prompt: gdb /path/to/emacs.exe If GDB says something like this: Reading symbols from D:\foo\bar\emacs.exe...(no debugging symbols found)...done. ^^^^^^^^^^^^^^^^^^^^^^^^^^ then indeed the binary is stripped. In that case, please download a recent snapshot from here: https://sourceforge.net/projects/emacs-bin/files/snapshots/ and start by verifying that the same problem still exists there. (It could be that it was somehow fixed since 24.3 was released, although I doubt that.) Once you establish that the problem still exists in the snapshot, here's the sequence of commands I'd like you to perform: gdb /path/to/emacs.exe After GDB starts and displays its startup blurb, do this: (gdb) break Fdefault_printer_name (gdb) run -Q The last command runs Emacs. When Emacs starts up, it will show the *scratch* buffer. Type into that buffer: (default-printer-name) Then go to the right parenthesis and type C-j. This evaluates the expression. (Please forgive me if I'm telling you things you know very well.) When you evaluate that expression, the breakpoint you have set will break, Emacs will stop, and GDB will take control. Switch to the window where you run GDB, you should see there something like this: Breakpoint 1, Fdefault_printer_name () at w32fns.c:7217 7217 PRINTER_INFO_2 *ppi2 = NULL; (gdb) (Since you don't have the sources, you will probably not see the second line.) If you want to see the source code of default-printer-name, you can find it here: http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/src/w32fns.c (The function's source starts around line 7210 in that file.) We want to get to line #7252, which is marked in the snippet below: err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned); ClosePrinter (hPrn); if (!err) { xfree (ppi2); return Qnil; } if (ppi2) <<<<<<<<<<<<<<<<<<<<<<<<<<<<< { if (ppi2->Attributes & PRINTER_ATTRIBUTE_SHARED && ppi2->pServerName) { The GDB command to do that is: (gdb) until 7252 (The "(gdb)" part is GDB's prompt, you don't need to type it.) GDB will step Emacs till that line, and respond like this: Fdefault_printer_name () at w32fns.c:7252 7252 if (ppi2) (gdb) Now please tell GDB to display the contents of the ppi2 structure, which holds the printer information Windows returned due to the call to GetPrinter API: (gdb) print *ppi2 And post here everything you see. If you will do this in Emacs 24.3 (in case it does have the debugging symbols), then please use "until 6943" instead of 7252 above, because the source line numbers of the snippet I show above are different in that version. Thanks again for your help.