199{
200 int bp=0;
201 if ((len>1)
204 )
205 {
207 {
208 char gdb[80];
209 char *
p=(
char *)currLine+len-1;
210 while ((*
p<=
' ') && (
p!=currLine))
211 {
213 }
214 if (
p==currLine)
return;
215
218 fwrite(currLine,1,len,stdout);
219 Print(
"<<\nbreakpoint %d (press ? for list of commands)\n",bp);
223 {
225 }
228 {
229 case '?':
230 case 'h':
231 {
233 "b - print backtrace of calling stack\n"
234 "B <proc> [<line>] - define breakpoint\n"
235 "c - continue\n"
236 "d - delete current breakpoint\n"
237 "D - show all breakpoints\n"
238 "e - edit the current procedure (current call will be aborted)\n"
239 "h,? - display this help screen\n"
240 "n - execute current line, break at next line\n"
241 "p <var> - display type and value of the variable <var>\n"
242 "q <flags> - quit debugger, set debugger flags(0,1,2)\n"
243 " 0: stop debug, 1:continue, 2: throw an error, return to toplevel\n"
244 "Q - quit Singular\n");
247 {
249 Print(
"breakpoint %d at line %d in %s\n",
251 }
252 break;
253 }
254 case 'd':
255 {
256 Print(
"delete break point %d\n",bp);
258 if (bp!=0)
259 {
261 }
262 break;
263 }
264 case 'D':
266 break;
267 #if 0
268 case 'l':
269 {
270 extern void listall(int showproc);
272 break;
273 }
274 #endif
275 case 'n':
277 return;
278 case 'e':
279 {
282 return;
283 }
284 case 'p':
285 {
292 else
293 {
295 memset(&tmp,0,sizeof(tmp));
300 }
301 break;
302 }
303 case 'b':
305 break;
306 case 'B':
307 {
309 Print(
"procedure `%s` ",
p);
311 break;
312 }
313 case 'q':
314 {
317 {
320 }
321 return;
322 }
323 case 'Q':
325 case 'c':
326 default:
327 return;
328 }
329 }
330 }
331}
Class used for (list of) interpreter objects.
void Print(leftv store=NULL, int spaces=0)
Called by type_cmd (e.g. "r;") or as default in jPRINT.
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
const char * Tok2Cmdname(int tok)
idhdl ggetid(const char *n)
void PrintS(const char *s)
BOOLEAN sdb_set_breakpoint(const char *pp, int given_lineno)
void sdb_edit(procinfo *pi)
static char * sdb_find_arg(char *p)
int sdb_checkline(char f)
STATIC_VAR char sdb_lastcmd