diff options
Diffstat (limited to 'etc/DEBUG')
| -rw-r--r-- | etc/DEBUG | 24 |
1 files changed, 10 insertions, 14 deletions
| @@ -107,36 +107,32 @@ objects which you can examine in turn with the x... commands. | |||
| 107 | Even with a live process, these x... commands are useful for | 107 | Even with a live process, these x... commands are useful for |
| 108 | examining the fields in a buffer, window, process, frame or marker. | 108 | examining the fields in a buffer, window, process, frame or marker. |
| 109 | Here's an example using concepts explained in the node "Value History" | 109 | Here's an example using concepts explained in the node "Value History" |
| 110 | of the GDB manual to print the variable frame from this line in | 110 | of the GDB manual to print values associated with the variable |
| 111 | xmenu.c: | 111 | called frame. First, use these commands: |
| 112 | |||
| 113 | buf.frame_or_window = frame; | ||
| 114 | |||
| 115 | First, use these commands: | ||
| 116 | 112 | ||
| 117 | cd src | 113 | cd src |
| 118 | gdb emacs | 114 | gdb emacs |
| 119 | b xmenu.c:1296 | 115 | b set_frame_buffer_list |
| 120 | r -q | 116 | r -q |
| 121 | 117 | ||
| 122 | Then type C-x 5 2 to create a new frame, and it hits the breakpoint: | 118 | Then when Emacs it hits the breakpoint: |
| 123 | 119 | ||
| 124 | (gdb) p frame | 120 | (gdb) p frame |
| 125 | $1 = 1077872640 | 121 | $1 = 139854428 |
| 126 | (gdb) xtype | 122 | (gdb) xtype |
| 127 | Lisp_Vectorlike | 123 | Lisp_Vectorlike |
| 128 | PVEC_FRAME | 124 | PVEC_FRAME |
| 129 | (gdb) xframe | 125 | (gdb) xframe |
| 130 | $2 = (struct frame *) 0x3f0800 | 126 | $2 = (struct frame *) 0x8560258 |
| 131 | (gdb) p *$ | 127 | (gdb) p *$ |
| 132 | $3 = { | 128 | $3 = { |
| 133 | size = 536871989, | 129 | size = 1073742931, |
| 134 | next = 0x366240, | 130 | next = 0x85dfe58, |
| 135 | name = 809661752, | 131 | name = 140615219, |
| 136 | [...] | 132 | [...] |
| 137 | } | 133 | } |
| 138 | (gdb) p $3->name | 134 | (gdb) p $3->name |
| 139 | $4 = 809661752 | 135 | $4 = 140615219 |
| 140 | 136 | ||
| 141 | Now we can use `pr' to print the name of the frame: | 137 | Now we can use `pr' to print the name of the frame: |
| 142 | 138 | ||