]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.117
- initial import
[packages/vim.git] / 6.2.117
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.117
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 6.2.117
11 Problem:    Breakpoints in loops of sourced files and functions are not
12             detected. (Hari Krishna Dara)
13 Solution:   Check for breakpoints when using lines that were previously read.
14             (Servatius Brandt)
15 Files:      src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/proto/eval.pro,
16             src/proto/ex_cmds2.pro
17
18
19 *** ../vim-6.2.116/src/eval.c   Sun Oct 12 16:56:43 2003
20 --- src/eval.c  Sun Oct 12 20:04:45 2003
21 ***************
22 *** 126,131 ****
23 --- 126,161 ----
24   };
25   
26   /*
27 +  * Return the name of the executed function.
28 +  */
29 +     char_u *
30 + func_name(cookie)
31 +     void *cookie;
32 + {
33 +     return ((struct funccall *)cookie)->func->name;
34 + }
35
36 + /*
37 +  * Return the address holding the next breakpoint line for a funccall cookie.
38 +  */
39 +     linenr_T *
40 + func_breakpoint(cookie)
41 +     void *cookie;
42 + {
43 +     return &((struct funccall *)cookie)->breakpoint;
44 + }
45
46 + /*
47 +  * Return the address holding the debug tick for a funccall cookie.
48 +  */
49 +     int *
50 + func_dbg_tick(cookie)
51 +     void *cookie;
52 + {
53 +     return &((struct funccall *)cookie)->dbg_tick;
54 + }
55
56 + /*
57    * Return the nesting level for a funccall cookie.
58    */
59       int
60 *** ../vim-6.2.116/src/ex_cmds2.c       Sat Sep 27 19:36:46 2003
61 --- src/ex_cmds2.c      Sun Oct 12 20:04:45 2003
62 ***************
63 *** 1995,2000 ****
64 --- 1995,2020 ----
65   };
66   
67   #ifdef FEAT_EVAL
68 + /*
69 +  * Return the address holding the next breakpoint line for a source cookie.
70 +  */
71 +     linenr_T *
72 + source_breakpoint(cookie)
73 +     void *cookie;
74 + {
75 +     return &((struct source_cookie *)cookie)->breakpoint;
76 + }
77
78 + /*
79 +  * Return the address holding the debug tick for a source cookie.
80 +  */
81 +     int *
82 + source_dbg_tick(cookie)
83 +     void *cookie;
84 + {
85 +     return &((struct source_cookie *)cookie)->dbg_tick;
86 + }
87
88   /*
89    * Return the nesting level for a source cookie.
90    */
91 *** ../vim-6.2.116/src/ex_docmd.c       Sun Oct 12 17:10:47 2003
92 --- src/ex_docmd.c      Sun Oct 12 20:14:08 2003
93 ***************
94 *** 591,596 ****
95 --- 591,599 ----
96       struct condstack cstack;          /* conditional stack */
97       garray_T  lines_ga;               /* keep lines for ":while" */
98       int               current_line = 0;       /* active line in lines_ga */
99 +     char_u    *fname = NULL;          /* function or script name */
100 +     linenr_T  *breakpoint = NULL;     /* ptr to breakpoint field in cookie */
101 +     int               *dbg_tick = NULL;       /* ptr to dbg_tick field in cookie */
102       int               saved_trylevel = 0;
103       int               saved_force_abort = 0;
104       except_T  *saved_caught_stack = NULL;
105 ***************
106 *** 649,654 ****
107 --- 652,672 ----
108       if (getline == get_func_line && ex_nesting_level == func_level(cookie))
109         ++ex_nesting_level;
110   
111 +     /* Get the function or script name and the address where the next breakpoint
112 +      * line and the debug tick for a function or script are stored. */
113 +     if (getline == get_func_line)
114 +     {
115 +       fname = func_name(cookie);
116 +       breakpoint = func_breakpoint(cookie);
117 +       dbg_tick = func_dbg_tick(cookie);
118 +     }
119 +     else if (getline == getsourceline)
120 +     {
121 +       fname = sourcing_name;
122 +       breakpoint = source_breakpoint(cookie);
123 +       dbg_tick = source_dbg_tick(cookie);
124 +     }
125
126       /*
127        * Initialize "force_abort"  and "suppress_errthrow" at the top level.
128        */
129 ***************
130 *** 749,756 ****
131 --- 767,794 ----
132                 break;
133             }
134   
135 +           /* If breakpoints have been added/deleted need to check for it. */
136 +           if (breakpoint != NULL && dbg_tick != NULL
137 +                                                  && *dbg_tick != debug_tick)
138 +           {
139 +               *breakpoint = dbg_find_breakpoint((getline == getsourceline),
140 +                                                       fname, sourcing_lnum);
141 +               *dbg_tick = debug_tick;
142 +           }
143
144             next_cmdline = ((wcmd_T *)(lines_ga.ga_data))[current_line].line;
145             sourcing_lnum = ((wcmd_T *)(lines_ga.ga_data))[current_line].lnum;
146
147 +           /* Did we encounter a breakpoint? */
148 +           if (breakpoint != NULL && *breakpoint != 0
149 +                                             && *breakpoint <= sourcing_lnum)
150 +           {
151 +               dbg_breakpoint(fname, sourcing_lnum);
152 +               /* Find next breakpoint. */
153 +               *breakpoint = dbg_find_breakpoint((getline == getsourceline),
154 +                                                       fname, sourcing_lnum);
155 +               *dbg_tick = debug_tick;
156 +           }
157         }
158   #endif
159   
160 ***************
161 *** 932,937 ****
162 --- 970,984 ----
163                     current_line = cstack.cs_line[cstack.cs_idx];
164                     cstack.cs_had_while = TRUE; /* note we jumped there */
165                     line_breakcheck();          /* check if CTRL-C typed */
166
167 +                   /* Check for the next breakpoint at or after the ":while".*/
168 +                   if (breakpoint != NULL)
169 +                   {
170 +                       *breakpoint = dbg_find_breakpoint(
171 +                                           (getline == getsourceline), fname,
172 +                          ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1);
173 +                       *dbg_tick = debug_tick;
174 +                   }
175                 }
176                 else /* can only get here with ":endwhile" */
177                 {
178 *** ../vim-6.2.116/src/proto/eval.pro   Sun Jun  1 12:26:07 2003
179 --- src/proto/eval.pro  Sun Oct 12 20:04:45 2003
180 ***************
181 *** 1,4 ****
182 --- 1,7 ----
183   /* eval.c */
184 + char_u *func_name __ARGS((void *cookie));
185 + linenr_T *func_breakpoint __ARGS((void *cookie));
186 + int *func_dbg_tick __ARGS((void *cookie));
187   int func_level __ARGS((void *cookie));
188   int current_func_returned __ARGS((void));
189   void set_internal_string_var __ARGS((char_u *name, char_u *value));
190 *** ../vim-6.2.116/src/proto/ex_cmds2.pro       Sun Jun  1 12:26:08 2003
191 --- src/proto/ex_cmds2.pro      Sun Oct 12 20:04:45 2003
192 ***************
193 *** 37,42 ****
194 --- 37,44 ----
195   int do_in_runtimepath __ARGS((char_u *name, int all, void (*callback)(char_u *fname)));
196   void ex_options __ARGS((exarg_T *eap));
197   void ex_source __ARGS((exarg_T *eap));
198 + linenr_T *source_breakpoint __ARGS((void *cookie));
199 + int *source_dbg_tick __ARGS((void *cookie));
200   int source_level __ARGS((void *cookie));
201   int do_source __ARGS((char_u *fname, int check_other, int is_vimrc));
202   void ex_scriptnames __ARGS((exarg_T *eap));
203 *** ../vim-6.2.116/src/version.c        Sun Oct 12 17:28:22 2003
204 --- src/version.c       Sun Oct 12 20:19:24 2003
205 ***************
206 *** 639,640 ****
207 --- 639,642 ----
208   {   /* Add new patch number below this line */
209 + /**/
210 +     117,
211   /**/
212
213 -- 
214 Wizards had always known that the act of observation changed the thing that
215 was observed, and sometimes forgot that it also changed the observer too.
216                         Terry Pratchett  -  Interesting times
217
218  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
219 ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
220 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
221  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
This page took 0.081997 seconds and 3 git commands to generate.