This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 05/17] fix up gdb.xml
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 25 Oct 2013 17:21:32 +0100
- Subject: Re: [PATCH v2 05/17] fix up gdb.xml
- Authentication-results: sourceware.org; auth=none
- References: <1382129374-18344-1-git-send-email-tromey at redhat dot com> <1382129374-18344-6-git-send-email-tromey at redhat dot com>
On 10/18/2013 09:49 PM, Tom Tromey wrote:
> -# Similarly, we need to copy files under test into the objdir.
> -proc load_description { file errmsg } {
> +# Similarly, we need to copy files under test into the objdir. If
> +# SHOULD_CD is set, it causes the gdb under test to "cd" to the
> +# directory holding the XML code. This should only be set once; so
> +# the first call should use it and subsequent calls should not.
> +proc load_description { file errmsg {should_cd 1} } {
> global srcdir
> global subdir
> global gdb_prompt
> global core-regs
> global architecture
> + global remote_filename
>
> - file delete "$subdir/regs.xml"
> + set regs_file [standard_output_file regs.xml]
Sorry, I guess I'm a little dense, as this CD stuff still confused
me. IIUC, we only CD once, because subsequent calls to load_description
will use the cwd set from the first call. Is that right?
(I can't tell whether the path passed to "cd" is relative -- if so,
if we don't cd back to the previous dir, then that'd be clearly
a problem).
So that I understand, given we only CD if !remote-host, cd'ing
before calling load_description in the first place work be the
same then, right? Like:
set regs_file [standard_output_file regs.xml]
if {![is_remote host]} {
gdb_test "cd [file dirname $regs_file]" "Working directory .*" \
"cd to directory holding xml"
}
load_description "extra-regs.xml" ""
...
load_description "core-only.xml" ""
Thanks,
--
Pedro Alves