annotate src/.gdbinit-union @ 53233:fe9b37bee5f7

Fully eliminated global tty state variables. lib-src/emacsclient.c (main.c): Fix error message. lisp/frame.el (make-frame-on-tty): New function. lisp/server.el (server-process-filter): Notify emacsclient if there was on error during evaluation. src/cm.c: Fix remaining cases of direct Wcm references. src/dispextern.h: Updated prototypes. src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call. (init_display): Remove reference to meta_key. src/frame.c (make_terminal_frame): Renamed first parameter to tty_name. Call term_init before creating the frame. (Fmake_terminal_frame): Look up the `tty' and `tty-type' frame parameters from the currently selected terminal before the global default. (Fdelete_frame): Make sure that the new selected frame is live. src/keyboard.c (meta_key): Moved to struct tty_output. (read_avail_input): Fix C syntax. Update references to meta_key. (Fsuspend_emacs): pass current tty to init_sys_modes via record_unwind_protect. (Fset_input_mode): Update references to meta_key. (Fcurrent_input_mode): Ditto. src/sysdep.c (init_sys_modes): Updated old_tty and meta_key references. Don't call set_terminal_modes, it needs termcap strings. (reset_sys_modes): Call tty_reset_terminal_modes instead of reset_terminal_modes. Updated old_tty references. src/term.c: Massive updates throuout the file. (TS_*, TN_*): Moved to struct tty_output. (RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto. (standout_mode, specified_window, tty_cursor_hidden): Ditto. (tty_set_terminal_modes, tty_reset_terminal_modes): New functions. (turn_on_insert, turn_off_insert): Added tty parameter. (turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter. (tty_hide_cursor, tty_show_cursor): Ditto. (background_highlight, highlight_if_desired): Ditto. (tty_capable_p): Changed first parameter to tty_output. (term_init): Make sure top_frame is initialized. Don't exit on errors if this would have been a secondary terminal. Call set_terminal_modes on the end. (delete_tty): New function. (delete_tty_1): New function. (print_all_frames): New function, marginally useful for debugging. src/termchar.h (struct tty_output): Changed old_tty to be a pointer. Removed old_tty_valid member. Added tty-specific variables from term.c. src/xfaces.c (Ftty_supports_face_attributes_p): Update for new tty_capable_p. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 27 Dec 2003 10:00:19 +0000
parents 695cf19ef79e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
50998
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
2 # Free Software Foundation, Inc.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
3 #
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
4 # This file is part of GNU Emacs.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
5 #
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
6 # GNU Emacs is free software; you can redistribute it and/or modify
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
7 # it under the terms of the GNU General Public License as published by
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
8 # the Free Software Foundation; either version 2, or (at your option)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
9 # any later version.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
10 #
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
11 # GNU Emacs is distributed in the hope that it will be useful,
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
14 # GNU General Public License for more details.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
15 #
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
16 # You should have received a copy of the GNU General Public License
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
17 # along with GNU Emacs; see the file COPYING. If not, write to the
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
18 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
19 # Boston, MA 02111-1307, USA.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
20
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
21 # Force loading of symbols, enough to give us gdb_valbits etc.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
22 set main
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
23
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
24 # Find lwlib source files too.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
25 dir ../lwlib
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
26 #dir /gd/gnu/lesstif-0.89.9/lib/Xm
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
27
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
28 # Don't enter GDB when user types C-g to quit.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
29 # This has one unfortunate effect: you can't type C-c
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
30 # at the GDB to stop Emacs, when using X.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
31 # However, C-z works just as well in that case.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
32 handle 2 noprint pass
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
33
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
34 # Don't pass SIGALRM to Emacs. This makes problems when
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
35 # debugging.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
36 handle SIGALRM ignore
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
37
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
38 # Set up a mask to use.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
39 # This should be EMACS_INT, but in some cases that is a macro.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
40 # long ought to work in all cases right now.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
41 set $valmask = ((long)1 << gdb_valbits) - 1
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
42 set $nonvalbits = gdb_emacs_intbits - gdb_valbits
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
43
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
44 # Set up something to print out s-expressions.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
45 define pr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
46 set debug_print ($)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
47 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
48 document pr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
49 Print the emacs s-expression which is $.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
50 Works only when an inferior emacs is executing.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
51 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
52
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
53 define xtype
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
54 output (enum Lisp_Type) (($.i >> gdb_valbits) & 0x7)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
55 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
56 output ((($.i >> gdb_valbits) & 0x7) == Lisp_Misc ? (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($.i & $valmask) | gdb_data_seg_bits))->type) : (($.i >> gdb_valbits) & 0x7) == Lisp_Vectorlike ? ($size = ((struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits))->size, (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)) : 0)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
57 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
58 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
59 document xtype
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
60 Print the type of $, assuming it is an Emacs Lisp value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
61 If the first type printed is Lisp_Vector or Lisp_Misc,
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
62 the second line gives the more precise type.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
63 Otherwise the second line doesn't mean anything.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
64 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
65
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
66 define xvectype
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
67 set $size = ((struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits))->size
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
68 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
69 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
70 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
71 document xvectype
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
72 Print the vector subtype of $, assuming it is a vector or pseudovector.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
73 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
74
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
75 define xmisctype
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
76 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($.i & $valmask) | gdb_data_seg_bits))->type)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
77 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
78 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
79 document xmisctype
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
80 Print the specific type of $, assuming it is some misc type.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
81 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
82
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
83 define xint
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
84 print (($.i & $valmask) << $nonvalbits) >> $nonvalbits
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
85 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
86 document xint
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
87 Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
88 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
89
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
90 define xptr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
91 print (void *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
92 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
93 document xptr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
94 Print the pointer portion of $, assuming it is an Emacs Lisp value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
95 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
96
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
97 define xmarker
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
98 print (struct Lisp_Marker *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
99 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
100 document xmarker
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
101 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
102 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
103
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
104 define xoverlay
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
105 print (struct Lisp_Overlay *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
106 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
107 document xoverlay
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
108 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
109 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
110
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
111 define xmiscfree
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
112 print (struct Lisp_Free *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
113 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
114 document xmiscfree
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
115 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
116 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
117
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
118 define xintfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
119 print (struct Lisp_Intfwd *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
120 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
121 document xintfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
122 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
123 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
124
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
125 define xboolfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
126 print (struct Lisp_Boolfwd *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
127 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
128 document xboolfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
129 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
130 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
131
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
132 define xobjfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
133 print (struct Lisp_Objfwd *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
134 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
135 document xobjfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
136 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
137 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
138
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
139 define xbufobjfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
140 print (struct Lisp_Buffer_Objfwd *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
141 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
142 document xbufobjfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
143 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
144 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
145
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
146 define xkbobjfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
147 print (struct Lisp_Kboard_Objfwd *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
148 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
149 document xkbobjfwd
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
150 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
151 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
152
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
153 define xbuflocal
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
154 print (struct Lisp_Buffer_Local_Value *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
155 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
156 document xbuflocal
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
157 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
158 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
159
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
160 define xsymbol
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
161 print (struct Lisp_Symbol *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
162 xprintsymptr $
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
163 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
164 document xsymbol
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
165 Print the name and address of the symbol $.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
166 This command assumes that $ is an Emacs Lisp symbol value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
167 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
168
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
169 define xstring
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
170 print (struct Lisp_String *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
171 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
172 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
173 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
174 document xstring
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
175 Print the contents and address of the string $.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
176 This command assumes that $ is an Emacs Lisp string value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
177 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
178
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
179 define xvector
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
180 print (struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
181 output ($->size > 50) ? 0 : ($->contents[0])@($->size)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
182 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
183 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
184 document xvector
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
185 Print the contents and address of the vector $.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
186 This command assumes that $ is an Emacs Lisp vector value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
187 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
188
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
189 define xprocess
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
190 print (struct Lisp_Process *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
191 output *$
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
192 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
193 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
194 document xprocess
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
195 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
196 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
197
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
198 define xframe
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
199 print (struct frame *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
200 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
201 document xframe
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
202 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
203 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
204
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
205 define xcompiled
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
206 print (struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
207 output ($->contents[0])@($->size & 0xff)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
208 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
209 document xcompiled
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
210 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
211 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
212
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
213 define xwindow
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
214 print (struct window *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
215 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
216 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
217 document xwindow
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
218 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
219 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
220 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
221
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
222 define xwinconfig
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
223 print (struct save_window_data *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
224 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
225 document xwinconfig
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
226 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
227 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
228
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
229 define xsubr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
230 print (struct Lisp_Subr *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
231 output *$
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
232 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
233 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
234 document xsubr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
235 Print the address of the subr which the Lisp_Object $ points to.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
236 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
237
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
238 define xchartable
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
239 print (struct Lisp_Char_Table *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
240 printf "Purpose: "
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
241 output (char*)&((struct Lisp_Symbol *) (($->purpose.i & $valmask) | gdb_data_seg_bits))->name->data
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
242 printf " %d extra slots", ($->size & 0x1ff) - 388
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
243 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
244 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
245 document xchartable
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
246 Print the address of the char-table $, and its purpose.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
247 This command assumes that $ is an Emacs Lisp char-table value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
248 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
249
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
250 define xboolvector
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
251 print (struct Lisp_Bool_Vector *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
252 output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
253 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
254 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
255 document xboolvector
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
256 Print the contents and address of the bool-vector $.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
257 This command assumes that $ is an Emacs Lisp bool-vector value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
258 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
259
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
260 define xbuffer
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
261 print (struct buffer *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
262 output ((struct Lisp_String *) (($->name.i & $valmask) | gdb_data_seg_bits))->data
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
263 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
264 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
265 document xbuffer
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
266 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
267 Print the name of the buffer.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
268 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
269
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
270 define xhashtable
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
271 print (struct Lisp_Hash_Table *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
272 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
273 document xhashtable
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
274 Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
275 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
276
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
277 define xcons
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
278 print (struct Lisp_Cons *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
279 output/x *$
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
280 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
281 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
282 document xcons
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
283 Print the contents of $, assuming it is an Emacs Lisp cons.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
284 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
285
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
286 define nextcons
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
287 p $.cdr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
288 xcons
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
289 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
290 document nextcons
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
291 Print the contents of the next cell in a list.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
292 This assumes that the last thing you printed was a cons cell contents
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
293 (type struct Lisp_Cons) or a pointer to one.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
294 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
295
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
296 define xcar
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
297 print/x ((($.i >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($.i & $valmask) | gdb_data_seg_bits))->car : 0)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
298 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
299 document xcar
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
300 Print the car of $, assuming it is an Emacs Lisp pair.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
301 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
302
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
303 define xcdr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
304 print/x ((($.i >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($.i & $valmask) | gdb_data_seg_bits))->cdr : 0)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
305 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
306 document xcdr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
307 Print the cdr of $, assuming it is an Emacs Lisp pair.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
308 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
309
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
310 define xfloat
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
311 print ((struct Lisp_Float *) (($.i & $valmask) | gdb_data_seg_bits))->data
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
312 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
313 document xfloat
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
314 Print $ assuming it is a lisp floating-point number.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
315 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
316
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
317 define xscrollbar
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
318 print (struct scrollbar *) (($.i & $valmask) | gdb_data_seg_bits)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
319 output *$
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
320 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
321 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
322 document xscrollbar
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
323 Print $ as a scrollbar pointer.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
324 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
325
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
326 define xprintsym
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
327 set $sym = ((struct Lisp_Symbol *) (($arg0.i & $valmask) | gdb_data_seg_bits))
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
328 xprintsymptr $sym
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
329 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
330 document xprintsym
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
331 Print argument as a symbol.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
332 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
333 define xprintsymptr
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
334 set $sym = $arg0
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
335 set $sym_name = ((struct Lisp_String *)(($sym->xname.i & $valmask) | gdb_data_seg_bits))
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
336 output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
337 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
338 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
339
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
340 define xbacktrace
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
341 set $bt = backtrace_list
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
342 while $bt
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
343 set $type = (enum Lisp_Type) (((*$bt->function).i >> gdb_valbits) & 0x7)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
344 if $type == Lisp_Symbol
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
345 xprintsym (*$bt->function)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
346 else
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
347 printf "0x%x ", (*$bt->function).i
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
348 if $type == Lisp_Vectorlike
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
349 set $size = ((struct Lisp_Vector *) (((*$bt->function).i & $valmask) | gdb_data_seg_bits))->size
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
350 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
351 else
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
352 printf "Lisp type %d", $type
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
353 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
354 echo \n
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
355 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
356 set $bt = $bt->next
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
357 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
358 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
359 document xbacktrace
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
360 Print a backtrace of Lisp function calls from backtrace_list.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
361 Set a breakpoint at Fsignal and call this to see from where
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
362 an error was signaled.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
363 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
364
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
365 define xreload
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
366 set $valmask = ((long)1 << gdb_valbits) - 1
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
367 set $nonvalbits = gdb_emacs_intbits - gdb_valbits
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
368 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
369 document xreload
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
370 When starting Emacs a second time in the same gdb session under
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
371 FreeBSD 2.2.5, gdb 4.13, $valmask and $nonvalbits have lost
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
372 their values. (The same happens on current (2000) versions of GNU/Linux
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
373 with gdb 5.0.)
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
374 This function reloads them.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
375 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
376
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
377 define hook-run
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
378 xreload
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
379 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
380
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
381 # Call xreload if a new Emacs executable is loaded.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
382 define hookpost-run
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
383 xreload
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
384 end
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
385
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
386 set print pretty on
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
387 set print sevenbit-strings
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
388
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
389 # show environment DISPLAY
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
390 # show environment TERM
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
391 # set args -geometry 80x40+0+0
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
392
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
393 # Don't let abort actually run, as it will make
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
394 # stdio stop working and therefore the `pr' command above as well.
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
395 # break abort
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
396
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
397 # If we are running in synchronous mode, we want a chance to look around
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
398 # before Emacs exits. Perhaps we should put the break somewhere else
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
399 # instead...
e37bc45a2001 New file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
400 # break x_error_quitter
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 50998
diff changeset
401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 50998
diff changeset
402 # arch-tag: 08f4d20d-0254-4374-a80c-179d5a517915