comparison etc/gdbinit.in @ 4654:cdc51540fed7

Automated merge with ssh://aidan-guest@hg.debian.org//hg/xemacs/xemacs
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 15 Jul 2009 00:21:01 +0100
parents e9ccbc62f7e7
children 7ef913bf3c9a
comparison
equal deleted inserted replaced
4652:f3dddd098242 4654:cdc51540fed7
69 #ifdef VDB_POSIX 69 #ifdef VDB_POSIX
70 handle SIGSEGV SIGBUS nostop noprint 70 handle SIGSEGV SIGBUS nostop noprint
71 #endif 71 #endif
72 72
73 set $Lisp_Type_Int = -2 73 set $Lisp_Type_Int = -2
74 set $Lisp_Type_Record = 0
75 set $Lisp_Type_Char = 2
74 76
75 define decode_object 77 define decode_object
76 set $obj = (unsigned long) $arg0 78 set $obj = (unsigned long) $arg0
77 if $obj & 1 79 if $obj & 1
78 ## It's an int 80 ## It's an int
79 set $val = $obj >> 1 81 set $val = $obj >> 1
80 set $type = $Lisp_Type_Int 82 set $type = $Lisp_Type_Int
81 else 83 else
82 set $type = $obj & dbg_typemask 84 set $type = $obj & dbg_typemask
83 if $type == Lisp_Type_Char 85 if $type == $Lisp_Type_Char
84 set $val = ($obj & dbg_valmask) >> dbg_gctypebits 86 set $val = ($obj & dbg_valmask) >> dbg_gctypebits
85 else 87 else
86 ## It's a record pointer 88 ## It's a record pointer
87 set $val = $obj 89 set $val = $obj
88 end 90 end
89 end 91 end
90 92
91 if $type == Lisp_Type_Record 93 if $type == $Lisp_Type_Record
92 set $lheader = ((struct lrecord_header *) $val) 94 set $lheader = ((struct lrecord_header *) $val)
93 set $lrecord_type = ($lheader->type) 95 set $lrecord_type = ($lheader->type)
94 set $imp = ((struct lrecord_implementation *) lrecord_implementations_table[(int) $lrecord_type]) 96 set $imp = ((struct lrecord_implementation *) lrecord_implementations_table[(int) $lrecord_type])
95 else 97 else
96 set $lrecord_type = -1 98 set $lrecord_type = -1
113 define xtype 115 define xtype
114 decode_object $arg0 116 decode_object $arg0
115 if $type == $Lisp_Type_Int 117 if $type == $Lisp_Type_Int
116 echo int\n 118 echo int\n
117 else 119 else
118 if $type == Lisp_Type_Char 120 if $type == $Lisp_Type_Char
119 echo char\n 121 echo char\n
120 else 122 else
121 printf "record type: %s\n", $imp->name 123 printf "record type: %s\n", $imp->name
122 end 124 end
123 end 125 end
262 define pobj 264 define pobj
263 decode_object $arg0 265 decode_object $arg0
264 if $type == $Lisp_Type_Int 266 if $type == $Lisp_Type_Int
265 printf "Integer: %d\n", $val 267 printf "Integer: %d\n", $val
266 else 268 else
267 if $type == Lisp_Type_Char 269 if $type == $Lisp_Type_Char
268 if $val > 32 && $val < 128 270 if $val > 32 && $val < 128
269 printf "Char: %c\n", $val 271 printf "Char: %c\n", $val
270 else 272 else
271 printf "Char: %d\n", $val 273 printf "Char: %d\n", $val
272 end 274 end