From 4dede7c6aea049e2799dd58cac312385f2e5bf20 Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Thu, 15 Aug 2013 15:00:54 -0400 Subject: [PATCH] Allow gvpr to report on path and filename resolution --- lib/gvpr/gvpr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/gvpr/gvpr.c b/lib/gvpr/gvpr.c index 031c759cf..f003b032c 100644 --- a/lib/gvpr/gvpr.c +++ b/lib/gvpr/gvpr.c @@ -30,6 +30,7 @@ #include "builddate.h" #include "gprstate.h" #include "cgraph.h" +#include "globals.h" #include "ingraphs.h" #include "compile.h" #include "queue.h" @@ -211,7 +212,7 @@ concat (char* pfx, char* sfx, char** sp) * * FIX - use pathinclude/pathfind */ -static char *resolve(char *arg) +static char *resolve(char *arg, int Verbose) { char *path; char *s; @@ -242,7 +243,8 @@ static char *resolve(char *arg) } else path = DFLT_GVPRPATH; - + if (Verbose) + fprintf (stderr, "PATH: %s\n", path); if (!(fp = sfstropen())) { error(ERROR_ERROR, "Could not open buffer"); return 0; @@ -277,6 +279,8 @@ static char *resolve(char *arg) sfclose(fp); if (pathp) sfclose(pathp); + if (Verbose) + fprintf (stderr, "file %s resolved to %s\n", arg, fname); return fname; } @@ -326,7 +330,7 @@ doFlags(char* arg, int argi, int argc, char** argv, options* opts) opts->compflags |= (SRCOUT|CLONE); break; case 'f': - if ((optarg = getOptarg(c, &arg, &argi, argc, argv)) && (opts->program = resolve(optarg))) { + if ((optarg = getOptarg(c, &arg, &argi, argc, argv)) && (opts->program = resolve(optarg, opts->verbose))) { opts->useFile = 1; } else return -1; -- 2.40.0