This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 05/17] fix up gdb.xml


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]