source: git/Singular/sdb.cc @ dd9b83

spielwiese
Last change on this file since dd9b83 was dd9b83, checked in by Hans Schönemann <hannes@…>, 25 years ago
* hannes: debugger git-svn-id: file:///usr/local/Singular/svn/trunk@2984 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id: sdb.cc,v 1.1 1999-04-15 17:28:47 Singular Exp $ */
5/*
6* ABSTRACT: Singular debugger
7*/
8
9#include "mod2.h"
10#include "tok.h"
11#include "febase.h"
12#include "ipshell.h"
13#include "sdb.h"
14
15void sdb(Voice * currentVoice, char * currLine, int len)
16{
17  loop
18  {
19    char gdb[80];
20    char *p=currLine+len-1;
21    while ((*p<=' ') && (p!=currLine))
22    {
23      p--; len--;
24    }
25    if (p!=currLine)
26    {
27      fprintf(stdout,"(%s,%d) >>",currentVoice->filename,yylineno);mflush();
28      fwrite(currLine,1,len,stdout);
29      fprintf(stdout,"<< (p, f-finish,b,...)\n");mflush();
30      fgets(gdb,80,stdin);
31      p=gdb;
32      while (*p==' ') p++;
33      if (*p >' ')
34        printf("command:%c\n",*p);
35      switch(*p)
36      {
37        case 'f':
38          currentVoice->pi->trace_flag&= ~TRACE_BREAKPOINT;
39          return;
40        case 'p':
41          printf(".....\n");
42          break;
43        case 'b':
44          VoiceBackTrack();
45          break;
46        case 'q':
47          m2_end(999);
48        default:
49          return;
50      }
51    }
52  }
53}
54
Note: See TracBrowser for help on using the repository browser.