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]

[RFC] move strace call to gdb_init? (away from testcase)


Hello,

One of the things I constantly notice everytime I start writing
a new testcase is that we always start it exactly the same way:

    if $tracelevel then {
        strace $tracelevel
    }

I tried to research a bit how this works. As far as I can tell,
the "tracelevel" variable is controlled via runtest's --strace
command-line switch.

Runtest already does the call to strace:

        "--str*" {                      # (--strace) expect trace level
            set tracelevel $optarg
            strace $tracelevel

So, I don't think that setting it ourselves is going to be doing
anything. As a test, I tried with various levels of strace-ing,
and nothing seemed to change. In particular, the output in gdb.log
remained the same with or without.

(it might have done something if each testcase script was executed
as it own expect process, but in fact, there is only one expect
process, and testcases are just "source"-ed)

So, I think we could just nuke the thing. Alternatively, we could
be a little extra conservative, and reset it systematically at
the start of every testcase, JIC a testcase changes the strace
level. The best place to do that is in proc gdb_init (lib/gdb.exp).

WDYT?

-- 
Joel


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