comparison src/.gdbinit @ 90261:7beb78bc1f8e

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 616-696) - Add lisp/mh-e/.arch-inventory - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. - lisp/gnus/ChangeLog: Remove duplicate entry * gnus--rel--5.10 (patch 147-181) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: lisp/mml.el (mml-preview): Doc fix. - Update from CVS: texi/message.texi: Fix default values. - Update from CVS: texi/gnus.texi (RSS): Addition.
author Miles Bader <miles@gnu.org>
date Mon, 16 Jan 2006 08:37:27 +0000
parents 187d6a1f84f7 0034c3d92000
children 5b7d410e31f9
comparison
equal deleted inserted replaced
90260:0ca0d9181b5e 90261:7beb78bc1f8e
1 # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 2000, 01, 2004 1 # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 2000, 01, 2004, 2005, 2006
2 # Free Software Foundation, Inc. 2 # Free Software Foundation, Inc.
3 # 3 #
4 # This file is part of GNU Emacs. 4 # This file is part of GNU Emacs.
5 # 5 #
6 # GNU Emacs is free software; you can redistribute it and/or modify 6 # GNU Emacs is free software; you can redistribute it and/or modify
29 # This has one unfortunate effect: you can't type C-c 29 # This has one unfortunate effect: you can't type C-c
30 # at the GDB to stop Emacs, when using X. 30 # at the GDB to stop Emacs, when using X.
31 # However, C-z works just as well in that case. 31 # However, C-z works just as well in that case.
32 handle 2 noprint pass 32 handle 2 noprint pass
33 33
34 # Make it work like SIGINT normally does.
35 handle SIGTSTP nopass
36
34 # Don't pass SIGALRM to Emacs. This makes problems when 37 # Don't pass SIGALRM to Emacs. This makes problems when
35 # debugging. 38 # debugging.
36 handle SIGALRM ignore 39 handle SIGALRM ignore
37 40
38 # $valmask and $tagmask are mask values set up by the xreload macro below. 41 # $valmask and $tagmask are mask values set up by the xreload macro below.
64 end 67 end
65 68
66 # Print out s-expressions 69 # Print out s-expressions
67 define pp 70 define pp
68 set $tmp = $arg0 71 set $tmp = $arg0
69 set debug_print ($tmp) 72 set safe_debug_print ($tmp)
70 end 73 end
71 document pp 74 document pp
72 Print the argument as an emacs s-expression 75 Print the argument as an emacs s-expression
73 Works only when an inferior emacs is executing. 76 Works only when an inferior emacs is executing.
77 end
78
79 # Print out s-expressions from tool bar
80 define pp1
81 set $tmp = $arg0
82 echo $arg0
83 printf " = "
84 set safe_debug_print ($tmp)
85 end
86 document pp1
87 Print the argument as an emacs s-expression
88 Works only when an inferior emacs is executing.
89 For use on tool bar when debugging in Emacs
90 where the variable name would not otherwise
91 be recorded in the GUD buffer.
92 end
93
94 # Print value of lisp variable
95 define pv
96 set $tmp = "$arg0"
97 set safe_debug_print ( find_symbol_value (intern ($tmp)))
98 end
99 document pv
100 Print the value of the lisp variable given as argument.
101 Works only when an inferior emacs is executing.
102 end
103
104 # Print value of lisp variable
105 define pv1
106 set $tmp = "$arg0"
107 echo $arg0
108 printf " = "
109 set safe_debug_print (find_symbol_value (intern ($tmp)))
110 end
111 document pv1
112 Print the value of the lisp variable given as argument.
113 Works only when an inferior emacs is executing.
114 For use on tool bar when debugging in Emacs
115 where the variable name would not otherwise
116 be recorded in the GUD buffer.
74 end 117 end
75 118
76 # Print out current buffer point and boundaries 119 # Print out current buffer point and boundaries
77 define ppt 120 define ppt
78 set $b = current_buffer 121 set $b = current_buffer
120 end 163 end
121 if ($it->header_line_p) 164 if ($it->header_line_p)
122 printf " HL" 165 printf " HL"
123 end 166 end
124 if ($it->n_overlay_strings > 0) 167 if ($it->n_overlay_strings > 0)
125 printf " nov=%d" 168 printf " nov=%d", $it->n_overlay_strings
126 end 169 end
127 if ($it->sp != 0) 170 if ($it->sp != 0)
128 printf " sp=%d", $it->sp 171 printf " sp=%d", $it->sp
129 end 172 end
130 if ($it->what == IT_CHARACTER) 173 if ($it->what == IT_CHARACTER)
583 document xcons 626 document xcons
584 Print the contents of $, assuming it is an Emacs Lisp cons. 627 Print the contents of $, assuming it is an Emacs Lisp cons.
585 end 628 end
586 629
587 define nextcons 630 define nextcons
588 p $.cdr 631 p $.u.cdr
589 xcons 632 xcons
590 end 633 end
591 document nextcons 634 document nextcons
592 Print the contents of the next cell in a list. 635 Print the contents of the next cell in a list.
593 This assumes that the last thing you printed was a cons cell contents 636 This assumes that the last thing you printed was a cons cell contents
603 end 646 end
604 647
605 define xcdr 648 define xcdr
606 xgetptr $ 649 xgetptr $
607 xgettype $ 650 xgettype $
608 print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->cdr : 0) 651 print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0)
609 end 652 end
610 document xcdr 653 document xcdr
611 Print the cdr of $, assuming it is an Emacs Lisp pair. 654 Print the cdr of $, assuming it is an Emacs Lisp pair.
612 end 655 end
613 656
614 define xfloat 657 define xfloat
615 xgetptr $ 658 xgetptr $
616 print ((struct Lisp_Float *) $ptr)->data 659 print ((struct Lisp_Float *) $ptr)->u.data
617 end 660 end
618 document xfloat 661 document xfloat
619 Print $ assuming it is a lisp floating-point number. 662 Print $ assuming it is a lisp floating-point number.
620 end 663 end
621 664
693 Print a backtrace of Lisp function calls from backtrace_list. 736 Print a backtrace of Lisp function calls from backtrace_list.
694 Set a breakpoint at Fsignal and call this to see from where 737 Set a breakpoint at Fsignal and call this to see from where
695 an error was signaled. 738 an error was signaled.
696 end 739 end
697 740
741 # Show Lisp backtrace after normal backtrace.
742 define hookpost-backtrace
743 set $bt = backtrace_list
744 if $bt
745 echo \n
746 echo Lisp Backtrace:\n
747 xbacktrace
748 end
749 end
750
698 define xreload 751 define xreload
699 set $tagmask = (((long)1 << gdb_gctypebits) - 1) 752 set $tagmask = (((long)1 << gdb_gctypebits) - 1)
700 set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1 753 set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
701 end 754 end
702 document xreload 755 document xreload
732 785
733 show environment DISPLAY 786 show environment DISPLAY
734 show environment TERM 787 show environment TERM
735 set args -geometry 80x40+0+0 788 set args -geometry 80x40+0+0
736 789
737 # Don't let abort actually run, as it will make 790 # People get bothered when they see messages about non-existent functions...
738 # stdio stop working and therefore the `pr' command above as well. 791 xgetptr Vsystem_type
739 break abort 792 set $tem = (struct Lisp_Symbol *) $ptr
740 793 xgetptr $tem->xname
741 # If we are running in synchronous mode, we want a chance to look around 794 set $tem = (struct Lisp_String *) $ptr
742 # before Emacs exits. Perhaps we should put the break somewhere else 795 set $tem = (char *) $tem->data
743 # instead... 796
744 break x_error_quitter 797 # Don't let abort actually run, as it will make stdio stop working and
745 798 # therefore the `pr' command above as well.
799 if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd'
800 # The windows-nt build replaces abort with its own function.
801 break w32_abort
802 else
803 break abort
804 end
805
806 # x_error_quitter is defined only on X. But window-system is set up
807 # only at run time, during Emacs startup, so we need to defer setting
808 # the breakpoint. init_sys_modes is the first function called on
809 # every platform after init_display, where window-system is set.
810 tbreak init_sys_modes
811 commands
812 silent
813 xgetptr Vwindow_system
814 set $tem = (struct Lisp_Symbol *) $ptr
815 xgetptr $tem->xname
816 set $tem = (struct Lisp_String *) $ptr
817 set $tem = (char *) $tem->data
818 # If we are running in synchronous mode, we want a chance to look
819 # around before Emacs exits. Perhaps we should put the break
820 # somewhere else instead...
821 if $tem[0] == 'x' && $tem[1] == '\0'
822 break x_error_quitter
823 end
824 continue
825 end
746 # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe 826 # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe