From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 131014 invoked by alias); 21 Jan 2019 15:49:12 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 126091 invoked by uid 89); 21 Jan 2019 15:48:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:gdbsou, U*gdb, gdb@sourceware.org, gdbsourcewareorg X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Jan 2019 15:48:37 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glboR-0007tD-OM; Mon, 21 Jan 2019 10:48:35 -0500 Received: from [176.228.60.248] (port=3355 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1glboR-0005VH-CD; Mon, 21 Jan 2019 10:48:35 -0500 Date: Mon, 21 Jan 2019 15:49:00 -0000 Message-Id: <83sgxm9fll.fsf@gnu.org> From: Eli Zaretskii To: Peng Yu CC: gdb@sourceware.org In-reply-to: (message from Peng Yu on Mon, 21 Jan 2019 07:16:41 -0600) Subject: Re: can't handle command-line argument containing whitespace References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00018.txt.bz2 > From: Peng Yu > Date: Mon, 21 Jan 2019 07:16:41 -0600 > Cc: "gdb@sourceware.org" > > > Try this GDB command: > > > > (gdb) set startup-with-shell on > > But it doesn't work with the -batch option. It hangs there forever. > How to fix it? Thanks. Don't run your program from the command line, run it from a script file that you load via the -x command-line switch. In that script, put the "set startup-with-shell on" command first, then your "run" command with the arguments for the program you want to debug. (Why do you run GDB with -batch, btw? GDB is an interactive debugger, so you should have a way of interacting with it.)