Mercurial > emacs
comparison src/.gdbinit @ 70425:d481556dd1b5
(xframe): Print frame name.
(xlist): New command to print a list (max 10 elements).
(xpr): Print lisp object of any type.
(pitx): Print it->pixel_width.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Fri, 05 May 2006 23:56:35 +0000 |
parents | 039ae41bde1a |
children | 9f75a05018ea 1321f6cfb389 146cd8369025 |
comparison
equal
deleted
inserted
replaced
70424:bb09ca6ec650 | 70425:d481556dd1b5 |
---|---|
209 printf "reg=%d-%d ", $it->region_beg_charpos, $it->region_end_charpos | 209 printf "reg=%d-%d ", $it->region_beg_charpos, $it->region_end_charpos |
210 end | 210 end |
211 printf "vpos=%d hpos=%d", $it->vpos, $it->hpos, | 211 printf "vpos=%d hpos=%d", $it->vpos, $it->hpos, |
212 printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y | 212 printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y |
213 printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x | 213 printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x |
214 printf " w=%d", $it->pixel_width | |
214 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent | 215 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent |
215 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent | 216 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent |
216 printf "\n" | 217 printf "\n" |
217 end | 218 end |
218 document pitx | 219 document pitx |
542 end | 543 end |
543 | 544 |
544 define xframe | 545 define xframe |
545 xgetptr $ | 546 xgetptr $ |
546 print (struct frame *) $ptr | 547 print (struct frame *) $ptr |
548 xgetptr $->name | |
549 set $ptr = (struct Lisp_String *) $ptr | |
550 xprintstr $ptr | |
551 echo \n | |
547 end | 552 end |
548 document xframe | 553 document xframe |
549 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. | 554 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. |
550 end | 555 end |
551 | 556 |
674 end | 679 end |
675 document xcdr | 680 document xcdr |
676 Print the cdr of $, assuming it is an Emacs Lisp pair. | 681 Print the cdr of $, assuming it is an Emacs Lisp pair. |
677 end | 682 end |
678 | 683 |
684 define xlist | |
685 xgetptr $ | |
686 set $cons = (struct Lisp_Cons *) $ptr | |
687 xgetptr Qnil | |
688 set $nil = $ptr | |
689 set $i = 0 | |
690 while $cons != $nil && $i < 10 | |
691 p/x $cons->car | |
692 xpr | |
693 xgetptr $cons->u.cdr | |
694 set $cons = (struct Lisp_Cons *) $ptr | |
695 set $i = $i + 1 | |
696 printf "---\n" | |
697 end | |
698 if $cons == $nil | |
699 printf "nil\n" | |
700 else | |
701 printf "...\n" | |
702 p $ptr | |
703 end | |
704 end | |
705 document xlist | |
706 Print $ assuming it is a list. | |
707 end | |
708 | |
679 define xfloat | 709 define xfloat |
680 xgetptr $ | 710 xgetptr $ |
681 print ((struct Lisp_Float *) $ptr)->u.data | 711 print ((struct Lisp_Float *) $ptr)->u.data |
682 end | 712 end |
683 document xfloat | 713 document xfloat |
690 output *$ | 720 output *$ |
691 echo \n | 721 echo \n |
692 end | 722 end |
693 document xscrollbar | 723 document xscrollbar |
694 Print $ as a scrollbar pointer. | 724 Print $ as a scrollbar pointer. |
725 end | |
726 | |
727 define xpr | |
728 xtype | |
729 if $type == Lisp_Int | |
730 xint | |
731 end | |
732 if $type == Lisp_Symbol | |
733 xsymbol | |
734 end | |
735 if $type == Lisp_String | |
736 xstring | |
737 end | |
738 if $type == Lisp_Cons | |
739 xcons | |
740 end | |
741 if $type == Lisp_Float | |
742 xfloat | |
743 end | |
744 if $type == Lisp_Misc | |
745 set $misc = (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type) | |
746 if $misc == Lisp_Misc_Free | |
747 xmiscfree | |
748 end | |
749 if $misc == Lisp_Misc_Boolfwd | |
750 xboolfwd | |
751 end | |
752 if $misc == Lisp_Misc_Marker | |
753 xmarker | |
754 end | |
755 if $misc == Lisp_Misc_Intfwd | |
756 xintfwd | |
757 end | |
758 if $misc == Lisp_Misc_Boolfwd | |
759 xboolfwd | |
760 end | |
761 if $misc == Lisp_Misc_Objfwd | |
762 xobjfwd | |
763 end | |
764 if $misc == Lisp_Misc_Buffer_Objfwd | |
765 xbufobjfwd | |
766 end | |
767 if $misc == Lisp_Misc_Buffer_Local_Value | |
768 xbuflocal | |
769 end | |
770 # if $misc == Lisp_Misc_Some_Buffer_Local_Value | |
771 # xvalue | |
772 # end | |
773 if $misc == Lisp_Misc_Overlay | |
774 xoverlay | |
775 end | |
776 if $misc == Lisp_Misc_Kboard_Objfwd | |
777 xkbobjfwd | |
778 end | |
779 # if $misc == Lisp_Misc_Save_Value | |
780 # xsavevalue | |
781 # end | |
782 end | |
783 if $type == Lisp_Vectorlike | |
784 set $size = ((struct Lisp_Vector *) $ptr)->size | |
785 if ($size & PVEC_FLAG) | |
786 set $vec = (enum pvec_type) ($size & PVEC_TYPE_MASK) | |
787 if $vec == PVEC_NORMAL_VECTOR | |
788 xvector | |
789 end | |
790 if $vec == PVEC_PROCESS | |
791 xprocess | |
792 end | |
793 if $vec == PVEC_FRAME | |
794 xframe | |
795 end | |
796 if $vec == PVEC_COMPILED | |
797 xcompiled | |
798 end | |
799 if $vec == PVEC_WINDOW | |
800 xwindow | |
801 end | |
802 if $vec == PVEC_WINDOW_CONFIGURATION | |
803 xwinconfig | |
804 end | |
805 if $vec == PVEC_SUBR | |
806 xsubr | |
807 end | |
808 if $vec == PVEC_CHAR_TABLE | |
809 xchartable | |
810 end | |
811 if $vec == PVEC_BOOL_VECTOR | |
812 xboolvector | |
813 end | |
814 if $vec == PVEC_BUFFER | |
815 xbuffer | |
816 end | |
817 if $vec == PVEC_HASH_TABLE | |
818 xhashtable | |
819 end | |
820 else | |
821 xvector | |
822 end | |
823 end | |
824 end | |
825 document xpr | |
826 Print $ as a lisp object of any type. | |
695 end | 827 end |
696 | 828 |
697 define xprintstr | 829 define xprintstr |
698 set $data = $arg0->data | 830 set $data = $arg0->data |
699 output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) | 831 output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) |
714 set $bt = backtrace_list | 846 set $bt = backtrace_list |
715 while $bt | 847 while $bt |
716 xgettype (*$bt->function) | 848 xgettype (*$bt->function) |
717 if $type == Lisp_Symbol | 849 if $type == Lisp_Symbol |
718 xprintsym (*$bt->function) | 850 xprintsym (*$bt->function) |
719 echo \n | 851 printf " (0x%x)\n", *$bt->args |
720 else | 852 else |
721 printf "0x%x ", *$bt->function | 853 printf "0x%x ", *$bt->function |
722 if $type == Lisp_Vectorlike | 854 if $type == Lisp_Vectorlike |
723 xgetptr (*$bt->function) | 855 xgetptr (*$bt->function) |
724 set $size = ((struct Lisp_Vector *) $ptr)->size | 856 set $size = ((struct Lisp_Vector *) $ptr)->size |
733 end | 865 end |
734 document xbacktrace | 866 document xbacktrace |
735 Print a backtrace of Lisp function calls from backtrace_list. | 867 Print a backtrace of Lisp function calls from backtrace_list. |
736 Set a breakpoint at Fsignal and call this to see from where | 868 Set a breakpoint at Fsignal and call this to see from where |
737 an error was signaled. | 869 an error was signaled. |
870 end | |
871 | |
872 define which | |
873 set debug_print (which_symbols ($arg0)) | |
874 end | |
875 document which | |
876 Print symbols which references a given lisp object, | |
877 either as its symbol value or symbol function. | |
878 end | |
879 | |
880 define xbytecode | |
881 set $bt = byte_stack_list | |
882 while $bt | |
883 xgettype ($bt->byte_string) | |
884 printf "0x%x => ", $bt->byte_string | |
885 which $bt->byte_string | |
886 set $bt = $bt->next | |
887 end | |
888 end | |
889 document xbytecode | |
890 Print a backtrace of the byte code stack. | |
738 end | 891 end |
739 | 892 |
740 # Show Lisp backtrace after normal backtrace. | 893 # Show Lisp backtrace after normal backtrace. |
741 define hookpost-backtrace | 894 define hookpost-backtrace |
742 set $bt = backtrace_list | 895 set $bt = backtrace_list |