diff options
| author | Eli Zaretskii | 2015-01-08 15:53:09 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-01-08 15:53:09 +0200 |
| commit | ad83cdacb6808377e2ef4f96e60ffb68dbf01cd9 (patch) | |
| tree | b8e07e06c561c7accbf0b37e1229052683e93303 /src | |
| parent | daa18b5e85559ccea84bd9e8a5f8ac57cfa73189 (diff) | |
| download | emacs-ad83cdacb6808377e2ef4f96e60ffb68dbf01cd9.tar.gz emacs-ad83cdacb6808377e2ef4f96e60ffb68dbf01cd9.zip | |
Fix GDB accesses to the 'nil's name.
src/.gdbinit (xsymname): New subroutine.
(xprintsym, initial-tbreak): Use it to access the name of a symbol
in a way that doesn't cause GDB to barf when it tries to
dereference a NULL pointer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 18 | ||||
| -rw-r--r-- | src/ChangeLog | 5 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 0f2138284a0..1a2a973e694 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -70,6 +70,16 @@ define xgettype | |||
| 70 | set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : (EMACS_UINT) $bugfix >> VALBITS) | 70 | set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : (EMACS_UINT) $bugfix >> VALBITS) |
| 71 | end | 71 | end |
| 72 | 72 | ||
| 73 | # Access the name of a symbol | ||
| 74 | define xsymname | ||
| 75 | if (CHECK_LISP_OBJECT_TYPE) | ||
| 76 | set $bugfix = $arg0.i | ||
| 77 | else | ||
| 78 | set $bugfix = $arg0 | ||
| 79 | end | ||
| 80 | set $symname = ((struct Lisp_Symbol *) ((char *)lispsym + $bugfix))->name | ||
| 81 | end | ||
| 82 | |||
| 73 | # Set up something to print out s-expressions. | 83 | # Set up something to print out s-expressions. |
| 74 | # We save and restore print_output_debug_flag to prevent the w32 port | 84 | # We save and restore print_output_debug_flag to prevent the w32 port |
| 75 | # from calling OutputDebugString, which causes GDB to display each | 85 | # from calling OutputDebugString, which causes GDB to display each |
| @@ -1073,8 +1083,8 @@ end | |||
| 1073 | 1083 | ||
| 1074 | define xprintsym | 1084 | define xprintsym |
| 1075 | xgetptr $arg0 | 1085 | xgetptr $arg0 |
| 1076 | set $sym = (struct Lisp_Symbol *) $ptr | 1086 | xsymname $ptr |
| 1077 | xgetptr $sym->name | 1087 | xgetptr $symname |
| 1078 | set $sym_name = (struct Lisp_String *) $ptr | 1088 | set $sym_name = (struct Lisp_String *) $ptr |
| 1079 | xprintstr $sym_name | 1089 | xprintstr $sym_name |
| 1080 | end | 1090 | end |
| @@ -1258,8 +1268,8 @@ tbreak init_sys_modes | |||
| 1258 | commands | 1268 | commands |
| 1259 | silent | 1269 | silent |
| 1260 | xgetptr globals.f_Vinitial_window_system | 1270 | xgetptr globals.f_Vinitial_window_system |
| 1261 | set $tem = (struct Lisp_Symbol *) $ptr | 1271 | xsymname $ptr |
| 1262 | xgetptr $tem->name | 1272 | xgetptr $symname |
| 1263 | set $tem = (struct Lisp_String *) $ptr | 1273 | set $tem = (struct Lisp_String *) $ptr |
| 1264 | set $tem = (char *) $tem->data | 1274 | set $tem = (char *) $tem->data |
| 1265 | # If we are running in synchronous mode, we want a chance to look | 1275 | # If we are running in synchronous mode, we want a chance to look |
diff --git a/src/ChangeLog b/src/ChangeLog index 21bdc81d797..4365222ff7b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2015-01-08 Eli Zaretskii <eliz@gnu.org> | 1 | 2015-01-08 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * .gdbinit (xsymname): New subroutine. | ||
| 4 | (xprintsym, initial-tbreak): Use it to access the name of a symbol | ||
| 5 | in a way that doesn't cause GDB to barf when it tries to | ||
| 6 | dereference a NULL pointer. | ||
| 7 | |||
| 3 | * xdisp.c (next_element_from_c_string): Use Lisp integer zero as | 8 | * xdisp.c (next_element_from_c_string): Use Lisp integer zero as |
| 4 | the object. | 9 | the object. |
| 5 | (set_cursor_from_row, try_cursor_movement, dump_glyph) | 10 | (set_cursor_from_row, try_cursor_movement, dump_glyph) |