diff options
| author | Kim F. Storm | 2006-05-05 23:56:35 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-05-05 23:56:35 +0000 |
| commit | 28c1e1cac4e08aa5dc31ff628e67fe1f90bec3a0 (patch) | |
| tree | a64a5e5851c2688aba3b0e3c3ee11654c43db06f | |
| parent | a1dfdf246e28e99d056b4cbf2322742e1e201a5e (diff) | |
| download | emacs-28c1e1cac4e08aa5dc31ff628e67fe1f90bec3a0.tar.gz emacs-28c1e1cac4e08aa5dc31ff628e67fe1f90bec3a0.zip | |
(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.
| -rw-r--r-- | src/.gdbinit | 155 |
1 files changed, 154 insertions, 1 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 5b2b358a22f..04581efcbb1 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -211,6 +211,7 @@ define pitx | |||
| 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" |
| @@ -544,6 +545,10 @@ end | |||
| 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. |
| @@ -676,6 +681,31 @@ 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 |
| @@ -694,6 +724,108 @@ document xscrollbar | |||
| 694 | Print $ as a scrollbar pointer. | 724 | Print $ as a scrollbar pointer. |
| 695 | end | 725 | end |
| 696 | 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. | ||
| 827 | end | ||
| 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) |
| @@ -716,7 +848,7 @@ define xbacktrace | |||
| 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 |
| @@ -737,6 +869,27 @@ document xbacktrace | |||
| 737 | an error was signaled. | 869 | an error was signaled. |
| 738 | end | 870 | end |
| 739 | 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. | ||
| 891 | end | ||
| 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 |