emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-buffer.gdb


From: Ed Swarthout
Subject: Re: emacs-buffer.gdb
Date: Thu, 9 Jun 2005 21:17:48 -0500

On 6/9/05, Andreas Schwab <address@hidden> wrote:
> > -        set $filename = ' '
> > +        set $filename = " "
> 
> 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 != Qnil
         ygetptr $buf->filename
         set $filename = ((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 = ' '
+        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++




reply via email to

[Prev in Thread] Current Thread [Next in Thread]