This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4] Perf test framework
- From: Tom Tromey <tromey at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 01 Nov 2013 14:46:08 -0600
- Subject: Re: [PATCH 2/4] Perf test framework
- Authentication-results: sourceware.org; auth=none
- References: <1383291300-13917-1-git-send-email-yao at codesourcery dot com> <1383291300-13917-3-git-send-email-yao at codesourcery dot com>
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> + # Compile source files of test case. BODY is the tcl code to do
Yao> + # actual compilation and it should invoke 'PerfTest::compiled' if
Yao> + # compilation is successful.
Why not just have the body return success or failure and avoid having to
call another method?
Yao> + # The top-level interface to PerfTest.
Yao> + # COMPILE is the tcl code to generate and compile source files.
Yao> + # STARTUP is the tcl code to start up GDB.
Yao> + # RUN is the tcl code to drive GDB to do some operations.
Yao> + proc assemble {compile startup run} {
This approach ends up using a lot of indentation, it seems to me.
Slimmer approaches seem possible without losing anything.
E.g., in patch #4 I see:
+PerfTest::assemble {
+ compile {
+ for {set i 0} {$i < $SOLIB_COUNT} {incr i} {
+
But it seems to me that the "compile" part there is strictly redundant.
We already know that this is the "compile" branch, so why not have
"assemble" supply that?
Then the above would read:
PerfTest::assemble {
for {set i 0} {$i < $SOLIB_COUNT} {incr i} {
...
Tom