Differences between revisions 5 and 6
Revision 5 as of 2009-03-05 04:49:39
Size: 462
Editor: c952d3a0
Comment: use camelcase name, which is more natural for a wiki
Revision 6 as of 2009-07-20 00:36:08
Size: 2459
Editor: bd042e10
Comment: Overhaul.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Testing_GDB
Line 4: Line 3:
 * [[Native_gdbserver_testing]] <<TableOfContents>>
Line 6: Line 5:
'''Note''': One unfortunate characteristic of the GDB test suite is that, even if GDB is horribly broken, many tests will still pass. You can't have much confidence that things are basically working with 356 failures. You should look through gdb.log and work through a bunch of them to get a feel for the state of things. == Caveat emptor ==

Jim Blandy had the following insight at the {{{gdb-patches@}}} mailing list about analyzing testsuite results:

  One unfortunate characteristic of the GDB testsuite is that, even if GDB is horribly broken, many tests will still pass. You can't have much confidence that things are basically working with 356 failures. You should look through gdb.log and work through a bunch of them to get a feel for the state of things.

== Testing gdbserver in a native configuration ==

To run gdbserver on your local machine:

  1. Create an empty file named site.exp.
  1. Create a directory named boards in the same location as site.exp.
  1. Create a file named native-gdbserver.exp in the boards directory (see below).
  1. Set the DEJAGNU environment variable to point to the empty site.exp.
  1. Run the testsuite with make check-gdb RUNTESTFLAGS="--target_board native-gdbserver".

=== Native Board File ===

{{{
# gdbserver running native.

load_generic_config "gdbserver"
process_multilib_options ""

# The default compiler for this target.
set_board_info compiler "[find_gcc]"

# This gdbserver can only run a process once per session.
set_board_info gdb,do_reload_on_run 1

# There's no support for argument-passing (yet).
set_board_info noargs 1

# Can't do input (or output) in the current gdbserver.
set_board_info gdb,noinferiorio 1

# gdbserver does not intercept target file operations and perform them
# on the host.
set_board_info gdb,nofileio 1

# Can't do hardware watchpoints, in general.
set_board_info gdb,no_hardware_watchpoints 1

set_board_info sockethost "localhost:"
set_board_info use_gdb_stub 1

# We will be using the standard GDB remote protocol.
set_board_info gdb_protocol "remote"
# Test the copy of gdbserver in the build directory.
set_board_info gdb_server_prog "../gdbserver/gdbserver"

proc ${board}_spawn { board cmd } {
  global board_info

  set baseboard [lindex [split $board "/"] 0]

  set board_info($baseboard,isremote) 0
  set result [remote_spawn $board $cmd]
  set board_info($baseboard,isremote) 1

  return $result
}

proc ${board}_download { board host dest } {
  return $host
}

proc ${board}_file { dest op args } {
    if { $op == "delete" } {
        return 0
    }
    return [eval [list standard_file $dest $op] $args]
}
}}}

This page collects useful notes on running the GDB testsuite.

Caveat emptor

Jim Blandy had the following insight at the gdb-patches@ mailing list about analyzing testsuite results:

  • One unfortunate characteristic of the GDB testsuite is that, even if GDB is horribly broken, many tests will still pass. You can't have much confidence that things are basically working with 356 failures. You should look through gdb.log and work through a bunch of them to get a feel for the state of things.

Testing gdbserver in a native configuration

To run gdbserver on your local machine:

  1. Create an empty file named site.exp.
  2. Create a directory named boards in the same location as site.exp.
  3. Create a file named native-gdbserver.exp in the boards directory (see below).
  4. Set the DEJAGNU environment variable to point to the empty site.exp.
  5. Run the testsuite with make check-gdb RUNTESTFLAGS="--target_board native-gdbserver".

Native Board File

# gdbserver running native.

load_generic_config "gdbserver"
process_multilib_options ""

# The default compiler for this target.
set_board_info compiler "[find_gcc]"

# This gdbserver can only run a process once per session.
set_board_info gdb,do_reload_on_run 1

# There's no support for argument-passing (yet).
set_board_info noargs 1

# Can't do input (or output) in the current gdbserver.
set_board_info gdb,noinferiorio 1

# gdbserver does not intercept target file operations and perform them
# on the host.
set_board_info gdb,nofileio 1

# Can't do hardware watchpoints, in general.
set_board_info gdb,no_hardware_watchpoints 1

set_board_info sockethost "localhost:"
set_board_info use_gdb_stub 1

# We will be using the standard GDB remote protocol.
set_board_info gdb_protocol "remote"
# Test the copy of gdbserver in the build directory.
set_board_info gdb_server_prog "../gdbserver/gdbserver"

proc ${board}_spawn { board cmd } {
  global board_info

  set baseboard [lindex [split $board "/"] 0]

  set board_info($baseboard,isremote) 0
  set result [remote_spawn $board $cmd]
  set board_info($baseboard,isremote) 1

  return $result
}

proc ${board}_download { board host dest } {
  return $host
}

proc ${board}_file { dest op args } {
    if { $op == "delete" } {
        return 0
    }
    return [eval [list standard_file $dest $op] $args]
}

None: TestingGDB (last edited 2021-10-28 18:15:41 by RogerioAlves)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.