From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20438 invoked by alias); 7 Dec 2005 03:13:04 -0000 Received: (qmail 20428 invoked by uid 22791); 7 Dec 2005 03:13:03 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.196) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Dec 2005 03:13:01 +0000 Received: by zproxy.gmail.com with SMTP id x3so239988nzd for ; Tue, 06 Dec 2005 19:12:59 -0800 (PST) Received: by 10.36.141.19 with SMTP id o19mr1064841nzd; Tue, 06 Dec 2005 19:12:59 -0800 (PST) Received: by 10.37.2.6 with HTTP; Tue, 6 Dec 2005 19:12:59 -0800 (PST) Message-ID: <8f2776cb0512061912o2d37bef9y7404a51858bfd6cf@mail.gmail.com> Date: Wed, 07 Dec 2005 19:35:00 -0000 From: Jim Blandy To: Andrew STUBBS Subject: Re: [PATCH] Allow spaces in filenames to load command Cc: GDB Patches In-Reply-To: <8f2776cb0512061504la4a7a5brada0edaeb051f0e4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <43949300.1040203@st.com> <8f2776cb0512051250u2a6083dbma95e6b352410dea8@mail.gmail.com> <43956C93.5070709@st.com> <8f2776cb0512061504la4a7a5brada0edaeb051f0e4@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00130.txt.bz2 Here's what I think we should do. Folks who've worked a lot with the target vector, please review. First, I'd like to make the following change to target.h: *** target.h 15 Sep 2005 22:46:32 -0700 1.76 --- target.h 06 Dec 2005 19:03:13 -0800=09 *************** *** 679,686 **** /* Load an executable file into the target process. This is expected to not only bring new code into the target process, but also to ! update GDB's symbol tables to match. */ extern void target_load (char *arg, int from_tty); /* Look up a symbol in the target's symbol table. NAME is the symbol --- 679,692 ---- /* Load an executable file into the target process. This is expected to not only bring new code into the target process, but also to ! update GDB's symbol tables to match. + ARG contains command-line arguments, to be broken down with + buildargv (). The first non-switch argument is the filename to + load, FILE; the second is a number (as parsed by strtoul (..., ..., + 0)), which is an offset to apply to the load addresses of FILE's + sections. The target may define switches, or other non-switch + arguments, as it pleases. */ extern void target_load (char *arg, int from_tty); /* Look up a symbol in the target's symbol table. NAME is the symbol I believe generic_load (and all the targets that use it, which is most of them) already meet that description. Second, change gdbsim_load to actually call buildargv, error out if a load address is present (saying it's not implemented yet), and pass the filename to sim_load. Third, change load_command to quote the result from get_exec_file if needed. Fourth, drop the string address equality test from the patch. Fifth, error out if there are further arguments we haven't recognized. This moves towards a well-defined interface for target_load. I don't think it's fair to ask you to go in and fix freds-old-S100-bus-board-monitor.c; in the future, if people run into problems with specific targets not expecting the quotation, we can fix them, since we'll then have a person who can actually test the change.