proper debug func prototypes, remove DEBUGGER compile switch double negative :/
This commit is contained in:
parent
1a4b9a92c4
commit
a755ebfbe6
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
CC=gcc
|
||||
CFLAGS=-Wall -pedantic -g -DNO_DEBUGGER -DUNIX_HOST -DVER=\"`git show-ref --abbrev=8 --head --hash head`\" -DTAG=\"`git describe --abbrev=0 --tags`\"
|
||||
CFLAGS=-Wall -pedantic -g -DDEBUGGER -DUNIX_HOST -DVER=\"`git show-ref --abbrev=8 --head --hash head`\" -DTAG=\"`git describe --abbrev=0 --tags`\"
|
||||
LIBS=-lm -lreadline
|
||||
|
||||
TARGET = picoc
|
||||
|
|
4
debug.c
4
debug.c
|
@ -1,6 +1,6 @@
|
|||
/* picoc interactive debugger */
|
||||
|
||||
#ifndef NO_DEBUGGER
|
||||
#ifdef DEBUGGER
|
||||
|
||||
#include "interpreter.h"
|
||||
|
||||
|
@ -115,4 +115,4 @@ void DebugCheckStatement(struct ParseState *Parser)
|
|||
void DebugStep()
|
||||
{
|
||||
}
|
||||
#endif /* !NO_DEBUGGER */
|
||||
#endif /* DEBUGGER */
|
||||
|
|
|
@ -586,10 +586,10 @@ extern void IncludeFile(Picoc *pc, char *Filename);
|
|||
/* the following is defined in picoc.h:
|
||||
* void PicocIncludeAllSystemHeaders(); */
|
||||
|
||||
#ifndef NO_DEBUGGER
|
||||
#ifdef DEBUGGER
|
||||
/* debug.c */
|
||||
extern void DebugInit();
|
||||
extern void DebugCleanup();
|
||||
extern void DebugInit(Picoc *pc);
|
||||
extern void DebugCleanup(Picoc *pc);
|
||||
extern void DebugCheckStatement(struct ParseState *Parser);
|
||||
#endif
|
||||
|
||||
|
|
2
parse.c
2
parse.c
|
@ -528,7 +528,7 @@ enum ParseResult ParseStatement(struct ParseState *Parser, int CheckTrailingSemi
|
|||
|
||||
/* if we're debugging, check for a breakpoint */
|
||||
if (Parser->DebugMode && Parser->Mode == RunModeRun)
|
||||
#ifndef NO_DEBUGGER
|
||||
#ifdef DEBUGGER
|
||||
DebugCheckStatement(Parser)
|
||||
#endif
|
||||
;
|
||||
|
|
10
platform.c
10
platform.c
|
@ -4,10 +4,10 @@
|
|||
#include "picoc.h"
|
||||
#include "interpreter.h"
|
||||
|
||||
#ifdef NO_DEBUGGER
|
||||
static int gEnableDebugger = FALSE;
|
||||
#else
|
||||
#ifdef DEBUGGER
|
||||
static int gEnableDebugger = TRUE;
|
||||
#else
|
||||
static int gEnableDebugger = FALSE;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@ void PicocInitialise(Picoc *pc, int StackSize)
|
|||
IncludeInit(pc);
|
||||
LibraryInit(pc);
|
||||
PlatformLibraryInit(pc);
|
||||
#ifndef NO_DEBUGGER
|
||||
#ifdef DEBUGGER
|
||||
DebugInit(pc);
|
||||
#endif
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ void PicocInitialise(Picoc *pc, int StackSize)
|
|||
/* free memory */
|
||||
void PicocCleanup(Picoc *pc)
|
||||
{
|
||||
#ifndef NO_DEBUGGER
|
||||
#ifdef DEBUGGER
|
||||
DebugCleanup(pc);
|
||||
#endif
|
||||
IncludeCleanup(pc);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "../picoc.h"
|
||||
#include "../interpreter.h"
|
||||
|
||||
#ifdef NO_DEBUGGER
|
||||
static int gEnableDebugger = FALSE;
|
||||
#else
|
||||
#ifdef DEBUGGER
|
||||
static int gEnableDebugger = TRUE;
|
||||
#else
|
||||
static int gEnableDebugger = FALSE;
|
||||
#endif
|
||||
|
||||
/* mark where to end the program for platforms which require this */
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
#include <readline/history.h>
|
||||
#endif
|
||||
|
||||
#ifdef NO_DEBUGGER
|
||||
static int gEnableDebugger = FALSE;
|
||||
#else
|
||||
#ifdef DEBUGGER
|
||||
static int gEnableDebugger = TRUE;
|
||||
#else
|
||||
static int gEnableDebugger = FALSE;
|
||||
#endif
|
||||
|
||||
/* mark where to end the program for platforms which require this */
|
||||
jmp_buf PicocExitBuf;
|
||||
|
||||
#ifndef NO_DEBUGGER
|
||||
#ifdef DEBUGGER
|
||||
#include <signal.h>
|
||||
|
||||
Picoc *break_pc = NULL;
|
||||
|
@ -32,14 +32,10 @@ void PlatformInit(Picoc *pc)
|
|||
signal(SIGINT, BreakHandler);
|
||||
}
|
||||
#else
|
||||
void PlatformInit(Picoc *pc)
|
||||
{
|
||||
}
|
||||
void PlatformInit(Picoc *pc) { }
|
||||
#endif
|
||||
|
||||
void PlatformCleanup(Picoc *pc)
|
||||
{
|
||||
}
|
||||
void PlatformCleanup(Picoc *pc) { }
|
||||
|
||||
/* get a line of interactive input */
|
||||
char *PlatformGetLine(char *Buf, int MaxLen, const char *Prompt)
|
||||
|
|
Loading…
Reference in a new issue