This is the mail archive of the 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 4/4] Test on solib load and unload

>>>>> "Yao" == Yao Qi <> writes:

Yao> This patch is to add a test case to on the performance of GDB handling
Yao> load and unload of shared library.

A few Tcl nits on this patch...

Yao> +	    gdb_produce_source $src { "int shr$i (void) {return 0;}" }

This bit is weird.  Combined with the definition of gdb_produce_source:

Yao> +proc gdb_produce_source { name sources } {
Yao> +    set index 0
Yao> +    set f [open $name "w"]
Yao> +
Yao> +    while { ${index} < [llength ${sources}] } {
Yao> +	set line [lindex ${sources} ${index}]
Yao> +	set index [expr ${index} + 1]
Yao> +
Yao> +	set line [uplevel list $line]
Yao> +	puts $f $line
Yao> +    }
Yao> +    close $f
Yao> +}

I don't see why this "uplevel list" stuff is needed.
Just have the caller pass in the text to write to the file.
The substitutions can be done there.

There also doesn't seem to be a need for "sources" to be a list.
Just make it one big string and let the caller work it out.

Yao> +	    # Compile.
Yao> +	    if { [gdb_compile_shlib $src $exe {debug}] != "" } {
Yao> +		untested "Couldn't compile $src."
Yao> +		return -1

This returns a value but I think the caller doesn't use it.
This isn't a bug, but it does mean some head-scratching later on, and of
course this will inevitably be copied into all the other perf tests...

That said I think this probably *should* return a value and I'll comment
on the other patch.


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