diff options
author | harti <harti@FreeBSD.org> | 2005-05-10 08:14:26 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-05-10 08:14:26 +0000 |
commit | ede5ad1020057388f7939e175e2171e1c06ecae5 (patch) | |
tree | 22b94baeee58914568b894143d8c92b1005f87a0 /usr.bin | |
parent | 35798a61f5bc26fc5367c82049406055d1e71604 (diff) | |
download | FreeBSD-src-ede5ad1020057388f7939e175e2171e1c06ecae5.zip FreeBSD-src-ede5ad1020057388f7939e175e2171e1c06ecae5.tar.gz |
Move some debugging code from targ.c to var.c where it actually belongs.
Patch: 7.192
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/targ.c | 6 | ||||
-rw-r--r-- | usr.bin/make/var.c | 16 | ||||
-rw-r--r-- | usr.bin/make/var.h | 2 |
3 files changed, 14 insertions, 10 deletions
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index bbe666f..c738d18 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -480,11 +480,7 @@ Targ_PrintGraph(int pass) printf("#\t%s [%s]\n", gn->name, gn->path ? gn->path : gn->name); } - - printf("#*** Global Variables:\n"); - Var_Dump(VAR_GLOBAL); - printf("#*** Command-line Variables:\n"); - Var_Dump(VAR_CMD); + Var_Dump(); printf("\n"); Dir_PrintDirectories(); printf("\n"); diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 1ca3e4c..9848d58 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -182,8 +182,8 @@ VarCreate(const char name[], const char value[], int flags) * Destroy a Var object. * * Params: - * v Object to destroy. - * f True if internal buffer in Buffer object is to be removed. + * v Object to destroy. + * f True if internal buffer in Buffer object is to be removed. */ static void VarDestroy(Var *v, Boolean f) @@ -2029,13 +2029,21 @@ Var_Init(char **env) *----------------------------------------------------------------------- */ void -Var_Dump(const GNode *ctxt) +Var_Dump(void) { const LstNode *ln; const Var *v; - LST_FOREACH(ln, &ctxt->context) { + printf("#*** Global Variables:\n"); + LST_FOREACH(ln, &VAR_GLOBAL->context) { + v = Lst_Datum(ln); + printf("%-16s = %s\n", v->name, Buf_Data(v->val)); + } + + printf("#*** Command-line Variables:\n"); + LST_FOREACH(ln, &VAR_CMD->context) { v = Lst_Datum(ln); printf("%-16s = %s\n", v->name, Buf_Data(v->val)); } } + diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h index dbc41db..986efe0 100644 --- a/usr.bin/make/var.h +++ b/usr.bin/make/var.h @@ -91,7 +91,7 @@ typedef Boolean VarModifyProc(const char *, Boolean, struct Buffer *, void *); void VarREError(int, regex_t *, const char *); void Var_Append(const char *, const char *, struct GNode *); void Var_Delete(const char *, struct GNode *); -void Var_Dump(const struct GNode *); +void Var_Dump(void); Boolean Var_Exists(const char *, struct GNode *); void Var_Init(char **); size_t Var_Match(const char [], struct GNode *); |