This is the mail archive of the gdb-patches@sources.redhat.com 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] New test for set backtrace related functionality


The design is good, but there are simple implementation nits,
and one implementation problem that I haven't got to the bottom
of yet.

In setbacktrace.c, add a line "#include <stdlib.h>" to get the
declaration of atoi.  gcc HEAD does not warn about it today
but it might eventually.  :-/

When you name the tests, don't use "(...)" as part of the test name:

  set test "set backtrace"
  set test "full backtrace"
  set test "full backtrace (exact)"
  set test "partial backtrace"
  set test "partial backtrace (using limit)"

Test names that differ only in that way are hard to talk about.
Similarly, it's bad when one name is a prefix of another name.

How about:

  set test "set backtrace"
  set test "full backtrace, ignore extra"
  set test "full backtrace, exact"
  set test "partial backtrace, with argument"
  set test "partial backtrace, with limit"

There's a problem with the "partial backtrace (using limit)" test:

  set extra_frames [lrange $expected_frames 0 [expr $subr_depth + 2]]

$expected_frames has 22 elements in it, and this call to lrange
asks for elements 0 to 22, which is 23 elements.

Here's the tough problem.  I'm getting a weird random timeout on the
"partial backtrace (using limit)" test.  In a group of 12
configurations, I saw 2 PASS and 12 FAIL/timeout.  I suspect some ".*"
or "[^foo]*" that is too greedy and eating more than it should, leaving
the later bits of the expect_list out to dry.  gdb_expect_list is
matching them one at a time so there is no backtracking if an early r.e.
mistakenly eats too much.  Specifically, it might be a problem with the
definition of $leadin.

Michael

===

2004-10-14  Paul Gilliam  <pgilliam@us.ibm.com>

	* gdb.base/setbacktrace.c gdb.base/setbacktrace.exp: New files.


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