From patchwork Mon Sep 30 11:53:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 34725 Received: (qmail 91151 invoked by alias); 30 Sep 2019 11:53:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 91143 invoked by uid 89); 30 Sep 2019 11:53:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=Gabriel, gabriel, 3027, H*Ad:D*se X-HELO: mx1.redhat.com Message-ID: Subject: Re: [PATCH v4] Add helper script for glibc debugging From: Arjun Shankar To: "Gabriel F. T. Gomes" , libc-alpha@sourceware.org Cc: arjun.is@lostca.se Date: Mon, 30 Sep 2019 13:53:25 +0200 In-Reply-To: <20190927221737.547-1-gabriel@inconstante.net.br> References: <20190927221737.547-1-gabriel@inconstante.net.br> User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Hi Gabriel, Thanks for writing this. The patch looks good to me. I have one small suggestion. What do you think about this?: The idea being that this will allow invoking (non-testcase) programs with arguments, like: ./debugglibc.sh -i iconv/iconv_prog -f ASCII -t UTF-8 ascii.txt I don't necessarily want this patch to go through more versions. It already adds value and I think it's ready to go in today. Just wanted to enable another usecase. Perhaps we can discuss it once the current version is in. Cheers, Arjun diff --git a/Makefile b/Makefile index a50fb64dc2..e832034ceb 100644 --- a/Makefile +++ b/Makefile @@ -255,8 +255,16 @@ do -s|--no-symbols-file) SYMBOLSFILE=false ;; + --) + shift + TESTCASE=$$1 + COMMANDLINE="$$@" + break + ;; *) TESTCASE=$$1 + COMMANDLINE="$$@" + break ;; esac shift @@ -302,7 +310,7 @@ __ENVVARS__ __SYMBOLSFILE__ break _dl_start_user run --library-path $(rpath-link):$${BUILD_DIR}/nptl_db \ -__TESTCASE__ __DIRECT__ +__COMMANDLINE__ __DIRECT__ __BREAKPOINTS__ EOF } @@ -311,7 +319,7 @@ EOF template | sed \ -e "s|__ENVVARS__|$$ENVVARSCMD|" \ -e "s|__SYMBOLSFILE__|$$SYMBOLSFILE|" \ - -e "s|__TESTCASE__|$$TESTCASE|" \ + -e "s|__COMMANDLINE__|$$COMMANDLINE|" \ -e "s|__DIRECT__|$$DIRECT|" \ -e "s|__BREAKPOINTS__|$$BREAKPOINTS|" \ > $$CMD_FILE