summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2020-09-02 20:29:02 -0700
committerRobert Mustacchi <rm@fingolfin.org>2020-09-03 15:08:35 -0700
commitfbfe962ed9b45c98bebaea25573c8b8f1630d482 (patch)
tree2978446c4190bb7f3d99045b0ebe4369e698a567
parent4132743a134e253014b777399c8f8275cf71636c (diff)
downloadillumos-joyent-fbfe962ed9b45c98bebaea25573c8b8f1630d482.tar.gz
13101 pargs dumps core when it can't read argv
13102 ptools could be built with ctf Reviewed by: C Fraire <cfraire@me.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/ptools/Makefile.bld5
-rw-r--r--usr/src/cmd/ptools/pargs/pargs.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/usr/src/cmd/ptools/Makefile.bld b/usr/src/cmd/ptools/Makefile.bld
index ea46be9296..8db9c449fe 100644
--- a/usr/src/cmd/ptools/Makefile.bld
+++ b/usr/src/cmd/ptools/Makefile.bld
@@ -27,6 +27,8 @@
PROG:sh = basename `cd ..; pwd`
+include ../../../Makefile.ctf
+
OBJS = $(PROG).o
SRCS = ../$(PROG).c
@@ -112,12 +114,15 @@ INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
elfcap.o: $(ELFCAP)/elfcap.c
$(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
+ $(POST_PROCESS_O)
pmap_common.o: $(PMAP)/pmap_common.c
$(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
+ $(POST_PROCESS_O)
%.o: ../%.c
$(COMPILE.c) $<
+ $(POST_PROCESS_O)
all: $(PROG) $(LN_$(PROG))
diff --git a/usr/src/cmd/ptools/pargs/pargs.c b/usr/src/cmd/ptools/pargs/pargs.c
index 1f21d92bfa..55876dea65 100644
--- a/usr/src/cmd/ptools/pargs/pargs.c
+++ b/usr/src/cmd/ptools/pargs/pargs.c
@@ -623,6 +623,7 @@ get_args(pargs_data_t *datap)
if (read_ptr_array(datap, argvoff, datap->pd_argv, argc) <= 0) {
free(datap->pd_argv);
datap->pd_argv = NULL;
+ datap->pd_argc = 0;
return;
}