summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2010-10-12 19:24:41 +0000
committerobrien <obrien@FreeBSD.org>2010-10-12 19:24:41 +0000
commit93c40b656a3514a4a5fb40da5e5aad34a069af86 (patch)
treec279b9c140b12d7654250d454ae7950512f2401d /bin
parent59b6a24cb2f202f04630ba35fff442809d23952f (diff)
downloadFreeBSD-src-93c40b656a3514a4a5fb40da5e5aad34a069af86.zip
FreeBSD-src-93c40b656a3514a4a5fb40da5e5aad34a069af86.tar.gz
If DEBUG is 3 or greater, disable STATICization of functions.
Also correct the documented location of the trace file.
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/Makefile2
-rw-r--r--bin/sh/shell.h7
-rw-r--r--bin/sh/show.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/bin/sh/Makefile b/bin/sh/Makefile
index e3c25e1..ee732f9 100644
--- a/bin/sh/Makefile
+++ b/bin/sh/Makefile
@@ -21,7 +21,7 @@ LDADD= -ll -ledit -ltermcap
LFLAGS= -8 # 8-bit lex scanner for arithmetic
CFLAGS+=-DSHELL -I. -I${.CURDIR}
# for debug:
-# CFLAGS+= -g -DDEBUG=2
+# CFLAGS+= -g -DDEBUG=3
WARNS?= 2
WFORMAT=0
diff --git a/bin/sh/shell.h b/bin/sh/shell.h
index 81ad424..cb1be84 100644
--- a/bin/sh/shell.h
+++ b/bin/sh/shell.h
@@ -43,8 +43,9 @@
* JOBS -> 1 if you have Berkeley job control, 0 otherwise.
* define DEBUG=1 to compile in debugging (set global "debug" to turn on)
* define DEBUG=2 to compile in and turn on debugging.
+ * define DEBUG=3 to also build all functions as public
*
- * When debugging is on, debugging info will be written to $HOME/trace and
+ * When debugging is on, debugging info will be written to ./trace and
* a quit signal will generate a core dump.
*/
@@ -61,7 +62,11 @@ typedef intmax_t arith_t;
#define strtoarith_t(nptr, endptr, base) strtoimax(nptr, endptr, base)
typedef void *pointer;
+#if DEBUG >= 3
+#define STATIC
+#else
#define STATIC static
+#endif
#define MKINIT /* empty */
#include <sys/cdefs.h>
diff --git a/bin/sh/show.c b/bin/sh/show.c
index f11cfce..7cb3547 100644
--- a/bin/sh/show.c
+++ b/bin/sh/show.c
@@ -274,7 +274,7 @@ indent(int amount, char *pfx, FILE *fp)
FILE *tracefile;
-#if DEBUG == 2
+#if DEBUG >= 2
int debug = 1;
#else
int debug = 0;
OpenPOWER on IntegriCloud