From ffd958e4d790c7ed8da981f3a610065de342362c Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Thu, 3 May 2012 14:22:35 -0500 Subject: 2676 'mdb -f vmdump.0' ignores the -f Reviewed by: Robert Mustacchi Reviewed by: Richard Lowe Reviewed by: Gary Mills Approved by: Richard Lowe --- usr/src/cmd/mdb/common/mdb/mdb_main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/mdb/common/mdb/mdb_main.c b/usr/src/cmd/mdb/common/mdb/mdb_main.c index 8399bde41c..caccef986d 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_main.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_main.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012, Josef 'Jeff' Sipek . All rights reserved. */ #include @@ -803,6 +804,9 @@ main(int argc, char *argv[], char *envp[]) tgt_argc -= c; } + if (fflag) + goto tcreate; /* skip re-exec and just create target */ + /* * If we just have an object file name, and that file doesn't * exist, and it's a string of digits, infer it to be a @@ -866,8 +870,7 @@ main(int argc, char *argv[], char *envp[]) * it is not and the target is unknown, use the rawfile tgt. * Otherwise an ELF-based target is needed, so we must abort. */ - if (tgt_ctor != mdb_rawfile_tgt_create && - mdb_gelf_check(io, &ehdr, ET_NONE) == -1) { + if (mdb_gelf_check(io, &ehdr, ET_NONE) == -1) { if (tgt_ctor != NULL) { (void) mdb_gelf_check(io, &ehdr, ET_EXEC); mdb_io_destroy(io); @@ -878,8 +881,7 @@ main(int argc, char *argv[], char *envp[]) mdb_io_destroy(io); - if (identify_xvm_file(tgt_argv[0], &longmode) == 1 && - !fflag) { + if (identify_xvm_file(tgt_argv[0], &longmode) == 1) { #ifdef _LP64 if (!longmode) goto reexec; @@ -891,9 +893,6 @@ main(int argc, char *argv[], char *envp[]) goto tcreate; } - if (tgt_ctor == mdb_rawfile_tgt_create) - goto tcreate; /* skip re-exec and just create target */ - /* * The object file turned out to be a user core file (ET_CORE), * and no other arguments were specified, swap 0 and 1. The -- cgit v1.2.3