From 53ea2ba4e5497bc18bcf66beb8b0c12fa93fcf99 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 15 Jun 2016 00:49:57 +0100 Subject: [PATCH] fcc: add support for --valgrind While I'm debugging sdcc 3.6.0 crashes --- Library/tools/fcc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Library/tools/fcc.c b/Library/tools/fcc.c index fa8b5a96..bf5bdbfb 100644 --- a/Library/tools/fcc.c +++ b/Library/tools/fcc.c @@ -19,6 +19,7 @@ static int mode = MODE_LINK; static char *workdir; /* Working directory */ static int verbose = 0; +static int valgrind = 0; static unsigned int progbase = 0x0100; /* Program base */ @@ -354,7 +355,12 @@ static void build_command(void) { char buf[128]; + if (valgrind == 1) + add_argument("valgrind"); + add_argument("sdcc"); + if (verbose == 1) + add_argument("-V"); /* Set up the basic parameters we will inflict on the user */ add_argument("--std-c99"); add_option("-m", cpu?cpu:"z80"); @@ -534,6 +540,8 @@ int main(int argc, const char *argv[]) { pedantic = 1; else if (strcmp(p, "--nostdio") == 0) nostdio = 1; + else if (strcmp(p, "--valgrind") == 0) + valgrind = 1; else { fprintf(stderr, "fcc: Unknown option '%s'.\n", p); exit(1); -- 2.34.1