41 lines
931 B
C
41 lines
931 B
C
#ifndef DEBUGMENU
|
|
#define DEBUGMENU
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "stack.c"
|
|
#include "stack.c"
|
|
|
|
void inspect(struct stack s, int fp){
|
|
char input[20];
|
|
printf("DEBUG [inspect]: stack, datam object?");
|
|
fgets(input,20,stdin);
|
|
if (input[0] == 's') printStack(s, fp);
|
|
if (input[0] == 'd'){/* todo */ }
|
|
if (input[0] == 'o'){/* todo */}
|
|
}
|
|
void list(){
|
|
//todo
|
|
}
|
|
void breakpoint(){
|
|
//todo
|
|
}
|
|
|
|
void debugMenu(int fp, struct stack stack, int* debug){
|
|
char input[20];
|
|
while (true) {
|
|
printf("DEBUG: inspect, list, breakpoint, run, step, quit?");
|
|
fgets(input, 20, stdin);
|
|
printf("%s",input);
|
|
if(input[0] == 'i') {inspect(stack,fp);}
|
|
if(input[0] == 'l') list();
|
|
if(input[0] == 'b') breakpoint();
|
|
if(input[0] == 's') break;
|
|
if(input[0] == 'r') {*debug = 0; break;};
|
|
if(input[0] == 'q') exit(0);
|
|
strcpy(input, "");
|
|
}
|
|
}
|
|
|
|
#endif /* ifndef DEBUGMENU */
|