From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ed Swarthout Newsgroups: gmane.emacs.devel Subject: Re: emacs-buffer.gdb Date: Thu, 9 Jun 2005 21:17:48 -0500 Message-ID: References: Reply-To: Ed Swarthout NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1118369641 19622 80.91.229.2 (10 Jun 2005 02:14:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2005 02:14:01 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 10 04:13:59 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DgZ1l-0003ZU-Pi for ged-emacs-devel@m.gmane.org; Fri, 10 Jun 2005 04:13:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgZ8o-00070p-0q for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 22:21:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DgZ8e-0006y5-J9 for emacs-devel@gnu.org; Thu, 09 Jun 2005 22:20:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DgZ8c-0006x6-JL for emacs-devel@gnu.org; Thu, 09 Jun 2005 22:20:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgZ8c-0006wv-G8 for emacs-devel@gnu.org; Thu, 09 Jun 2005 22:20:50 -0400 Original-Received: from [64.233.162.197] (helo=zproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DgZ5z-0007wk-0n for emacs-devel@gnu.org; Thu, 09 Jun 2005 22:18:07 -0400 Original-Received: by zproxy.gmail.com with SMTP id 13so333768nzn for ; Thu, 09 Jun 2005 19:17:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Vn3tEV51EI/Nv+F+xieSIqXWcdDc8NMp3fyCfwqMoe7IBvKDt5/hUInQP1iqGxlLZzAcyZekgy1asnklqFAx2O96bh/7YAPFX/vHL4t5EFtVeXMbPDb1sL40s3665smJMhMO5JkMTtXbvggfYURGmiIkRf5qeUa7G16G6e06yas= Original-Received: by 10.36.222.44 with SMTP id u44mr936845nzg; Thu, 09 Jun 2005 19:17:48 -0700 (PDT) Original-Received: by 10.36.2.5 with HTTP; Thu, 9 Jun 2005 19:17:48 -0700 (PDT) Original-To: Andreas Schwab In-Reply-To: Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38485 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38485 On 6/9/05, Andreas Schwab wrote: > > - set $filename =3D ' ' > > + set $filename =3D " " >=20 > This is dangerous because gdb needs to call malloc in the inferior in > order to allocate the string. Thank you. In fact, had I tested it with a core file, I'd have gotten: "You can't do that without a process to debug." Here's a better fix. -Ed Swarthout --- emacs-buffer.gdb 30 May 2005 17:01:09 -0000 1.3 +++ emacs-buffer.gdb 10 Jun 2005 02:05:38 -0000 @@ -117,12 +117,13 @@ if $buf->filename !=3D Qnil ygetptr $buf->filename set $filename =3D ((struct Lisp_String *) $ptr)->data + printf "%2d %c %9d %-20s %-10s %s\n", \ + $i, $modp, ($buf->text->z_byte - 1), $name, $mode, $filename else - set $filename =3D ' ' + printf "%2d %c %9d %-20s %-10ss\n", \ + $i, $modp, ($buf->text->z_byte - 1), $name, $mode end - printf "%2d %c %9d %-20s %-10s %s\n", \ - $i, $modp, ($buf->text->z_byte - 1), $name, $mode, $filename end set $i++