[Top][All Lists]

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

Re: Is it time to remove INTERNAL_FIELD?

From: Eli Zaretskii
Subject: Re: Is it time to remove INTERNAL_FIELD?
Date: Thu, 23 Apr 2015 14:17:01 +0300

> From: Oleh Krehel <address@hidden>
> Cc: Paul Eggert <address@hidden>,  address@hidden
> Date: Thu, 23 Apr 2015 12:56:38 +0200
> I don't know what to do with src/.gdbinit though.

Any reference to SOMETHING_ there should be replaced with SOMETHING
now.  Otherwise GDB will say there's no field named SOMETHING_ in
such-and-such struct.  E.g., try this:

 $ cd src
 $ gdb ./emacs
 (gdb) break set_cursor_from_row
 (gdb) r -Q
 Breakpoint 3, set_cursor_from_row (w=0x17ceae8 <dumped_data+2395368>,
    row=0x52740b8, matrix=0x5273be8, delta=0, delta_bytes=0, dy=0, dvpos=0)
    at xdisp.c:14185
 14185     struct glyph *glyph = row->glyphs[TEXT_AREA];
 (gdb) p w->contents
 $2 = 16446781
 (gdb) xbuffer
 $3 = (struct buffer *) 0xfaf538
 (unsigned char *) 0xfb8a80 " *Echo Area 1*"
The highlighted part access the buffer name via the name_ field.
After your change, you will see something like this instead:

  (gdb) xbuffer
  $2 = (struct buffer *) 0xfaf538
  There is no member named name_.

More generally, src/.gdbinit defines additional commands for GDB that
are useful for debugging Emacs, and in particular there are commands
there to display Lisp objects in human-readable format, like the
'xbuffer' command I used above.  So any changes in struct field names
should be reflected there, or else those commands will become broken.

reply via email to

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