Mercurial > hg > xemacs-beta
annotate etc/dbxrc.in @ 5258:1ed4cefddd12
Add a couple of extra docstring backslashes, #'format-time-string
2010-09-05 Aidan Kehoe <kehoea@parhasard.net>
* editfns.c (Fformat_time_string):
Use two backslashes so that there is at least one present in the
output of describe function, when describing the Roman month
number syntax in this function's docstring. Thanks for provoking
me to look at this, Stephen Turnbull.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 05 Sep 2010 19:22:37 +0100 |
parents | b785049378e3 |
children | 308d34e9f07d |
rev | line source |
---|---|
3418 | 1 ## dbx init file for XEmacs -*- ksh -*- |
2 ## This is the source file for src/.dbxrc. Edit it, and rerun configure. | |
3 ## (Running config.status is not enough.) | |
4 ## The generated file depends on src/config.h (currently only in one place). | |
5 | |
6 ## Copyright (C) 1998 Free Software Foundation, Inc. | |
5069
14f0dd1fabdb
move test-harness to lisp/ directory so it gets byte-compiled
Ben Wing <ben@xemacs.org>
parents:
3418
diff
changeset
|
7 ## Copyright (C) 2010 Ben Wing. |
3418 | 8 |
9 ## This file is part of XEmacs. | |
10 | |
11 ## XEmacs is free software; you can redistribute it and/or modify it | |
12 ## under the terms of the GNU General Public License as published by the | |
13 ## Free Software Foundation; either version 2, or (at your option) any | |
14 ## later version. | |
15 | |
16 ## XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
17 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
18 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
19 ## for more details. | |
20 | |
21 ## You should have received a copy of the GNU General Public License | |
22 ## along with XEmacs; see the file COPYING. If not, write to | |
23 ## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
24 ## Boston, MA 02110-1301 USA | |
25 | |
26 ## Author: Martin Buchholz | |
27 | |
28 ## Other contributors you could ask for help: Ivan Golubev, Jerry James, | |
29 ## Stephen Turnbull. | |
30 | |
31 ## You can use this file to debug XEmacs using Sun WorkShop's dbx. | |
32 | |
33 ## Some functions defined here require a running process, but most | |
34 ## don't. Considerable effort has been expended to this end. | |
35 | |
36 ## Since this file is called `.dbxrc', it will be read by dbx | |
37 ## automatically when dbx is run in the build directory, which is where | |
38 ## developers usually debug their xemacs. | |
39 | |
40 ## See also the comments in .gdbinit. | |
41 | |
42 ## See also the question of the XEmacs FAQ, titled | |
43 ## "How to Debug an XEmacs problem with a debugger". | |
44 | |
45 ## gdb sources the ./.gdbinit in _addition_ to ~/.gdbinit. | |
46 ## But dbx does _not_ source ~/.dbxrc if it found ./.dbxrc. | |
47 ## So we simulate the gdb algorithm by doing it ourselves here. | |
48 | |
49 #define NOT_C_CODE | |
50 #include "config.h" | |
51 | |
52 if test -r $HOME/.dbxrc; then . $HOME/.dbxrc; fi | |
53 | |
54 dbxenv language_mode ansic | |
55 | |
56 ignore POLL | |
57 ignore IO | |
58 | |
59 #ifdef VDB_POSIX | |
60 ignore SIGSEGV | |
61 ignore SIGBUS | |
62 #endif | |
63 | |
64 document lbt << 'end' | |
65 Usage: lbt | |
66 Print the current Lisp stack trace. | |
67 Requires a running xemacs process. | |
68 end | |
69 | |
70 function lbt { | |
71 call debug_backtrace() | |
72 } | |
73 | |
74 document ldp << 'end' | |
75 Usage: ldp lisp_object | |
76 Print a Lisp Object value using the Lisp printer. | |
77 Requires a running xemacs process. | |
78 end | |
79 | |
80 function ldp { | |
81 call debug_print ($1); | |
82 } | |
83 | |
84 Lisp_Type_Int=-2 | |
85 | |
86 ## A bug in dbx prevents string variables from having values beginning with `-'!! | |
87 function XEmacsInit { | |
88 function ToInt { eval "$1=\$[(int) \`alloc.c\`$1]"; } | |
89 ToInt dbg_USE_UNION_TYPE | |
90 ToInt Lisp_Type_Char | |
91 ToInt Lisp_Type_Record | |
92 ToInt dbg_valbits | |
93 ToInt dbg_gctypebits | |
94 function ToLong { eval "$1=\$[(\`alloc.c\`unsigned long) \`alloc.c\`$1]"; } | |
95 ToLong dbg_valmask | |
96 ToLong dbg_typemask | |
97 xemacs_initted=yes | |
98 } | |
99 | |
100 function printvar { | |
101 for i in $*; do eval "echo $i=\$$i"; done | |
102 } | |
103 | |
104 document decode_object << 'end' | |
105 Usage: decode_object lisp_object | |
106 Extract implementation information from a Lisp Object. | |
107 Defines variables $val, $type and $imp. | |
108 end | |
109 | |
110 ## Various dbx bugs cause ugliness in following code | |
111 function decode_object { | |
112 if test -z "$xemacs_initted"; then XEmacsInit; fi; | |
113 if test $dbg_USE_UNION_TYPE = 1; then | |
114 ## Repeat after me... dbx sux, dbx sux, dbx sux... | |
115 ## Allow both `pobj Qnil' and `pobj 0x82746834' to work | |
116 case $(whatis $1) in | |
117 *Lisp_Object*) obj="$[(`alloc.c`unsigned long)(($1).i)]";; | |
118 *) obj="$[(`alloc.c`unsigned long)($1)]";; | |
119 esac | |
120 else | |
121 obj="$[(`alloc.c`unsigned long)($1)]"; | |
122 fi | |
123 if test $[(int)($obj & 1)] = 1; then | |
124 ## It's an int | |
125 val=$[(long)(((unsigned long long)$obj) >> 1)] | |
126 type=$Lisp_Type_Int | |
127 else | |
128 type=$[(int)(((void*)$obj) & $dbg_typemask)] | |
129 if test $type = $Lisp_Type_Char; then | |
130 val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)] | |
131 else | |
132 ## It's a record pointer | |
133 val=$[(void*)$obj] | |
134 if test "$val" = "(nil)"; then type=null_pointer; fi | |
135 fi | |
136 fi | |
137 | |
138 if test $type = $Lisp_Type_Record; then | |
139 lheader="((struct lrecord_header *) $val)" | |
140 lrecord_type=$[(enum lrecord_type) $lheader->type] | |
141 imp=$[(void*)(`alloc.c`lrecord_implementations_table[$lheader->type])] | |
142 else | |
143 lheader="((struct lrecord_header *) -1)" | |
144 lrecord_type=-1 | |
145 imp="0xdeadbeef" | |
146 fi | |
147 ## printvar obj val type imp | |
148 } | |
149 | |
150 function xint { | |
151 decode_object "$*" | |
152 print (long) ($val) | |
153 } | |
154 | |
155 document xtype << 'end' | |
156 Usage: xtype lisp_object | |
157 Print the Lisp type of a lisp object. | |
158 end | |
159 | |
160 function xtype { | |
161 decode_object "$*" | |
162 if test $type = $Lisp_Type_Int; then echo "int" | |
163 elif test $type = $Lisp_Type_Char; then echo "char" | |
164 elif test $type = null_pointer; then echo "null_pointer" | |
165 else | |
166 echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]" | |
167 fi | |
168 } | |
169 | |
170 function lisp-shadows { | |
171 run -batch -vanilla -f list-load-path-shadows | |
172 } | |
173 | |
174 function environment-to-run-temacs { | |
175 unset EMACSLOADPATH | |
176 export EMACSBOOTSTRAPLOADPATH=../lisp/:.. | |
177 export EMACSBOOTSTRAPMODULEPATH=../modules/:.. | |
178 } | |
179 | |
180 document run-temacs << 'end' | |
181 Usage: run-temacs | |
182 Run temacs interactively, like xemacs. | |
183 Use this with debugging tools (like purify) that cannot deal with dumping, | |
184 or when temacs builds successfully, but xemacs does not. | |
185 end | |
186 | |
187 function run-temacs { | |
188 environment-to-run-temacs | |
189 run -nd -batch -l ../lisp/loadup.el run-temacs -q ${1+"$@"} | |
190 } | |
191 | |
192 document check-xemacs << 'end' | |
193 Usage: check-xemacs | |
194 Run the test suite. Equivalent to 'make check'. | |
195 end | |
196 | |
197 function check-xemacs { | |
5069
14f0dd1fabdb
move test-harness to lisp/ directory so it gets byte-compiled
Ben Wing <ben@xemacs.org>
parents:
3418
diff
changeset
|
198 run -batch -l test-harness -f batch-test-emacs ../tests/automated |
3418 | 199 } |
200 | |
201 document check-temacs << 'end' | |
202 Usage: check-temacs | |
203 Run the test suite on temacs. Equivalent to 'make check-temacs'. | |
204 Use this with debugging tools (like purify) that cannot deal with dumping, | |
205 or when temacs builds successfully, but xemacs does not. | |
206 end | |
207 | |
208 function check-temacs { | |
5069
14f0dd1fabdb
move test-harness to lisp/ directory so it gets byte-compiled
Ben Wing <ben@xemacs.org>
parents:
3418
diff
changeset
|
209 run-temacs -q -batch -l test-harness -f batch-test-emacs ../tests/automated |
3418 | 210 } |
211 | |
212 document update-elc << 'end' | |
213 Usage: update-elc | |
214 Run the core lisp byte compilation part of the build procedure. | |
215 Use when debugging temacs, not xemacs! | |
216 Use this when temacs builds successfully, but xemacs does not. | |
217 end | |
218 | |
219 function update-elc { | |
220 environment-to-run-temacs | |
221 run -nd -batch -l ../lisp/update-elc.el | |
222 } | |
223 | |
224 document dmp << 'end' | |
225 Usage: dmp | |
226 Run the dumping part of the build procedure. | |
227 Use when debugging temacs, not xemacs! | |
228 Use this when temacs builds successfully, but xemacs does not. | |
229 end | |
230 | |
231 function dmp { | |
232 environment-to-run-temacs | |
233 run -nd -batch -l ../lisp/loadup.el dump | |
234 } | |
235 | |
236 function pstruct { ## pstruct foo.c struct-name | |
237 module "$1" > /dev/null | |
238 type_ptr="((struct $2 *) $val)" | |
239 print $type_ptr | |
240 print *$type_ptr | |
241 } | |
242 | |
243 document pobj << 'end' | |
244 Usage: pobj lisp_object | |
245 Print the internal C representation of a Lisp Object. | |
246 end | |
247 | |
248 function pobj { | |
249 decode_object $1 | |
250 if test $type = $Lisp_Type_Int; then | |
251 print -f"Integer: %d" $val | |
252 elif test $type = $Lisp_Type_Char; then | |
253 if test $[$val > 32 && $val < 128] = 1; then | |
254 print -f"Char: %c" $val | |
255 else | |
256 print -f"Char: %d" $val | |
257 fi | |
258 elif test $lrecord_type = lrecord_type_string; then | |
259 pstruct alloc.c Lisp_String | |
260 elif test $lrecord_type = lrecord_type_cons; then | |
261 pstruct alloc.c Lisp_Cons | |
262 elif test $lrecord_type = lrecord_type_symbol; then | |
263 pstruct symbols.c Lisp_Symbol | |
264 echo "Symbol name: $[(char *)($type_ptr->name->data)]" | |
265 elif test $lrecord_type = lrecord_type_vector; then | |
266 pstruct alloc.c Lisp_Vector | |
267 echo "Vector of length $[$type_ptr->size]" | |
268 elif test $lrecord_type = lrecord_type_bit_vector; then | |
269 pstruct fns.c Lisp_Bit_Vector | |
270 elif test $lrecord_type = lrecord_type_buffer; then | |
271 pstruct buffer.c buffer | |
272 elif test $lrecord_type = lrecord_type_char_table; then | |
273 pstruct chartab.c Lisp_Char_Table | |
274 elif test $lrecord_type = lrecord_type_char_table_entry; then | |
275 pstruct chartab.c Lisp_Char_Table_Entry | |
276 elif test $lrecord_type = lrecord_type_charset; then | |
277 pstruct mule-charset.c Lisp_Charset | |
278 elif test $lrecord_type = lrecord_type_coding_system; then | |
279 pstruct file-coding.c Lisp_Coding_System | |
280 elif test $lrecord_type = lrecord_type_color_instance; then | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
3418
diff
changeset
|
281 pstruct fontcolor.c Lisp_Color_Instance |
3418 | 282 elif test $lrecord_type = lrecord_type_command_builder; then |
283 pstruct event-stream.c command_builder | |
284 elif test $lrecord_type = lrecord_type_compiled_function; then | |
285 pstruct bytecode.c Lisp_Compiled_Function | |
286 elif test $lrecord_type = lrecord_type_console; then | |
287 pstruct console.c console | |
288 elif test $lrecord_type = lrecord_type_database; then | |
289 pstruct database.c Lisp_Database | |
290 elif test $lrecord_type = lrecord_type_device; then | |
291 pstruct device.c device | |
292 elif test $lrecord_type = lrecord_type_event; then | |
293 pstruct events.c Lisp_Event | |
294 elif test $lrecord_type = lrecord_type_extent; then | |
295 pstruct extents.c extent | |
296 elif test $lrecord_type = lrecord_type_extent_auxiliary; then | |
297 pstruct extents.c extent_auxiliary | |
298 elif test $lrecord_type = lrecord_type_extent_info; then | |
299 pstruct extents.c extent_info | |
300 elif test $lrecord_type = lrecord_type_face; then | |
301 pstruct faces.c Lisp_Face | |
302 elif test $lrecord_type = lrecord_type_float; then | |
303 pstruct floatfns.c Lisp_Float | |
304 elif test $lrecord_type = lrecord_type_font_instance; then | |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
3418
diff
changeset
|
305 pstruct fontcolor.c Lisp_Font_Instance |
3418 | 306 elif test $lrecord_type = lrecord_type_frame; then |
307 pstruct frame.c frame | |
308 elif test $lrecord_type = lrecord_type_glyph; then | |
309 pstruct glyph.c Lisp_Glyph | |
310 elif test $lrecord_type = lrecord_type_gui_item; then | |
311 pstruct gui.c Lisp_Gui_Item | |
312 elif test $lrecord_type = lrecord_type_hash_table; then | |
313 pstruct elhash.c Lisp_Hash_Table | |
314 elif test $lrecord_type = lrecord_type_image_instance; then | |
315 pstruct glyphs.c Lisp_Image_Instance | |
316 elif test $lrecord_type = lrecord_type_keymap; then | |
317 pstruct keymap.c Lisp_Keymap | |
318 elif test $lrecord_type = lrecord_type_lcrecord_list; then | |
319 pstruct alloc.c lcrecord_list | |
320 elif test $lrecord_type = lrecord_type_ldap; then | |
321 pstruct ldap.c Lisp_LDAP | |
322 elif test $lrecord_type = lrecord_type_lstream; then | |
323 pstruct lstream.c lstream | |
324 elif test $lrecord_type = lrecord_type_marker; then | |
325 pstruct marker.c Lisp_Marker | |
326 elif test $lrecord_type = lrecord_type_opaque; then | |
327 pstruct opaque.c Lisp_Opaque | |
328 elif test $lrecord_type = lrecord_type_opaque_ptr; then | |
329 pstruct opaque.c Lisp_Opaque_Ptr | |
330 elif test $lrecord_type = lrecord_type_popup_data; then | |
331 pstruct gui-x.c popup_data | |
332 elif test $lrecord_type = lrecord_type_process; then | |
333 pstruct process.c Lisp_Process | |
334 elif test $lrecord_type = lrecord_type_range_table; then | |
335 pstruct rangetab.c Lisp_Range_Table | |
336 elif test $lrecord_type = lrecord_type_specifier; then | |
337 pstruct specifier.c Lisp_Specifier | |
338 elif test $lrecord_type = lrecord_type_subr; then | |
339 pstruct eval.c Lisp_Subr | |
340 elif test $lrecord_type = lrecord_type_symbol_value_buffer_local; then | |
341 pstruct symbols.c symbol_value_buffer_local | |
342 elif test $lrecord_type = lrecord_type_symbol_value_forward; then | |
343 pstruct symbols.c symbol_value_forward | |
344 elif test $lrecord_type = lrecord_type_symbol_value_lisp_magic; then | |
345 pstruct symbols.c symbol_value_lisp_magic | |
346 elif test $lrecord_type = lrecord_type_symbol_value_varalias; then | |
347 pstruct symbols.c symbol_value_varalias | |
348 elif test $lrecord_type = lrecord_type_timeout; then | |
349 pstruct event-stream.c Lisp_Timeout | |
350 elif test $lrecord_type = lrecord_type_toolbar_button; then | |
351 pstruct toolbar.c toolbar_button | |
352 elif test $lrecord_type = lrecord_type_tooltalk_message; then | |
353 pstruct tooltalk.c Lisp_Tooltalk_Message | |
354 elif test $lrecord_type = lrecord_type_tooltalk_pattern; then | |
355 pstruct tooltalk.c Lisp_Tooltalk_Pattern | |
356 elif test $lrecord_type = lrecord_type_weak_list; then | |
357 pstruct data.c weak_list | |
358 elif test $lrecord_type = lrecord_type_window; then | |
359 pstruct window.c window | |
360 elif test $lrecord_type = lrecord_type_window_configuration; then | |
361 pstruct window.c window_config | |
362 elif test "$type" = "null_pointer"; then | |
363 echo "Lisp Object is a null pointer!!" | |
364 else | |
365 echo "Unknown Lisp Object type" | |
366 print $1 | |
367 fi | |
368 } | |
369 | |
370 dbxenv suppress_startup_message 4.0 | |
371 ## dbxenv mt_watchpoints on | |
372 | |
373 function dp_core { | |
374 print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core | |
375 } | |
376 | |
377 ## Barf! | |
378 function print_shell { | |
379 print *(`frame-x.c`TopLevelShellRec*) (((struct `frame-x.c`x_frame*) (((struct `frame-x.c`frame*) (Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget) | |
380 } | |
381 | |
382 ## ------------------------------------------------------------- | |
383 ## functions to test the debugging support itself. | |
384 ## If you change this file, make sure the following still work... | |
385 ## ------------------------------------------------------------- | |
386 function test_xtype { | |
387 function doit { echo -n "$1: "; xtype "$1"; } | |
388 test_various_objects | |
389 } | |
390 | |
391 function test_pobj { | |
392 function doit { echo '==============================='; echo -n "$1: "; pobj "$1"; } | |
393 test_various_objects | |
394 } | |
395 | |
396 function test_various_objects { | |
397 doit Vemacs_major_version | |
398 doit Vhelp_char | |
399 doit Qnil | |
400 doit Qunbound | |
401 doit Vobarray | |
402 doit Vall_weak_lists | |
403 doit Vxemacs_codename | |
404 } |