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: [RFC] GDB testsuite patch. (revised version)


Manoj Iyer <manjo@austin.ibm.com> wrote:
> The problem is that there are other tests that run just fine even if no
> debugging symbols are found. This means if you change gdb_load to check if
> no debugging symbols are found and return a -ive value this might harm the
> other testcase.

Right.  You tried that, and Daniel pointed out that it was wrong,
and I agreed.

> I will be happy to submit that patch, and see if you like my idea.

It's such a good idea, I already started implementing something
like that.

Here is the new header for gdb_file_cmd:

  # Load a file into the debugger.
  # The return value is a list with the following information:
  #
  #  { message word ... }
  #
  # MESSAGE has the following values:
  #
  #   ""     file was loaded successfully
  #   "..."  file was not loaded successfully.
  #          An error or perror has been generated with MESSAGE.
  #
  # If the MESSAGE is "", then there is an optional set of words.
  # The words may be:
  #
  #  nodebug  this file does not contain debug information
  #
  # TODO: gdb.base/sepdebug.exp and gdb.stabs/weird.exp might
  # be able to use this if they can get more information
  # in the return value.

TCL is all about lists and strings, and it makes life a lot
easier to return a nice list of strings.

If this still looks like a good idea in a few hours, and I commit it,
then you can write gdb.gdb/*.exp like this:

  set oldtimeout $timeout
  set timeout 600
  verbose "Timeout is now $timeout seconds" 2

  set status [gdb_load $executable]

  set timeout $oldtimeout
  verbose "Timeout is now $timeout seconds" 2

  if { [lindex $status 0] != "" } then {
    # Error has already been printed.
    return -1
  }

  if { [lsearch -exact [lreplace $status 0 0] "nodebug"] } then {
    untested "no debugging information for $executable"
    return -1
  }

Or something like that.

How does that look?


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