proper debug func prototypes, remove DEBUGGER compile switch double negative :/

This commit is contained in:
Joseph Poirier 2015-06-07 21:12:20 -05:00
parent 1a4b9a92c4
commit a755ebfbe6
7 changed files with 21 additions and 25 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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

View file

@ -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
;

View file

@ -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);

View file

@ -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 */

View file

@ -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)