#   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008
#   Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# This file was written by Elena Zannoni (ezannoni@cygnus.com)

if $tracelevel then {
    strace $tracelevel
}


#
# test running programs
#
set prms_id 0
set bug_id 0

if { [skip_cplus_tests] } { continue }

set testfile "annota2"
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}

if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ nowarnings}] != "" } {
    untested annota2.exp
    return -1
}

# are we on a target board? If so, don't run these tests.
# note: this is necessary because we cannot use runto_main (which would
# work for remote targets too) because of the different prompt we get
# when using annotation level 2.
#
if [is_remote target] then {
    return 0
}


gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}

if [target_info exists gdb_stub] {
    gdb_step_for_stub;
}

#
# line number where we need to stop in main
#
set main_line 25

# The commands we test here produce many lines of output; disable "press 
# <return> to continue" prompts.
send_gdb "set height 0\n"
gdb_expect -re "$gdb_prompt $"

#
# break at main
#
gdb_test "break 25" \
    "Breakpoint.*at.* file .*$srcfile, line.*" \
    "breakpoint main"


#
# NOTE: this prompt is OK only when the annotation level is > 1
# NOTE: When this prompt is in use the gdb_test procedure cannot be used because
# it assumes that the last char of the gdb_prompt is a white space. This is not
# true with this annotated prompt. So we must use send_gdb and gdb_expect.
#

set old_gdb_prompt $gdb_prompt
set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"

send_gdb "set annotate 2\n" 
gdb_expect {
    -re "set annotate 2\r\n$gdb_prompt$" { pass "annotation set at level 2" }
    -re ".*$gdb_prompt$"       { fail "annotation set at level 2" }
    timeout	            { fail "annotation set at level 2 (timeout)" }
  }

send_gdb "run\n"
  gdb_expect {
    -re "$main_line.*$gdb_prompt$" { pass "run until main breakpoint" }
    -re ".*$gdb_prompt$"       { fail "run until main breakpoint" }
    timeout	            { fail "run until main breakpoint (timeout)" }
  }

#
# print class 'a' with public fields.
# this will test:
# annotate-field-begin
# annotate-field-name-end
# annotate-field-value
# annotate-field-end
#
send_gdb "print a\n"
gdb_expect {
  -re "\r\n\032\032post-prompt\r\n\r\n\032\032value-history-begin 1 -\r\n.*= \r\n\032\032value-history-value\r\n\\{\r\n\032\032field-begin -\r\nx\r\n\032\032field-name-end\r\n = \r\n\032\032field-value\r\n1\r\n\032\032field-end\r\n, \r\n\032\032field-begin -\r\ny\r\n\032\032field-name-end\r\n = \r\n\032\032field-value\r\n2\r\n\032\032field-end\r\n\\}\r\n\r\n\032\032value-history-end\r\n$gdb_prompt$" \
	{ pass "print class" }
  -re ".*$gdb_prompt$"     { fail "print class" }
  timeout	            { fail "print class (timeout)" }
}

#
# continue until exit
# this will test:
# annotate-exited
#
send_gdb "continue\n"
gdb_expect {
  -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\na.x is 1\r\n\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
	  { pass "continue until exit" }
  -re ".*$gdb_prompt$"     { fail "continue to exit" }
  timeout	            { fail "continue to exit (timeout)" }
}

#
# delete all breakpoints
#
send_gdb "delete\n"
gdb_expect {
  -re ".*Delete all breakpoints. \\(y or n\\) \r\n\032\032query.*$" {
           send_gdb "y\n"
           gdb_expect {
	     -re "\r\n\032\032post-query\r\n$gdb_prompt$" { pass "delete bps" }
	     -re ".*$gdb_prompt$" { fail "delete bps" }
	     timeout  { fail "delete bps (timeout)" }
	 }
     }
  -re ".*$gdb_prompt$" { fail "delete bps" }
  timeout  { fail "delete bps (timeout)" }
}

#
# break at first line of main. 
#
send_gdb "break 22\n"
gdb_expect {
  -re  "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n$gdb_prompt$" \
	    { pass "breakpoint at main" }
  -re ".*$gdb_prompt$"     { fail "break at main" }
  timeout	            { fail "break at main (timeout)" }
}

#
# change value of main_line
#
set main_line 22

#
# run program up to breakpoint.
#


send_gdb "run\n"
  gdb_expect {
    -re "$main_line.*$gdb_prompt$"    { pass "run until main breakpoint" }
    -re ".*$gdb_prompt$"       { fail "run until main breakpoint" }
    timeout	            { fail "run until main breakpoint (timeout)" }
  }

#
# set up a watch point on a.x 
#
send_gdb "watch a.x\n"
gdb_expect {
   -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\n.*atchpoint 3: a.x\r\n$gdb_prompt$" \
	   { pass "set watch on a.x" }
   -re ".*$gdb_prompt$"  { fail "set watch on a.x" }
   timeout    { fail "set watch on a.x (timeout)" }
}

#
# do a next, so that the watchpoint triggers. This will test:
# annotate-watchpoint
#
send_gdb "next\n"
gdb_expect {
   -re "\r\n\032\032post-prompt\r\n\r\n(\032\032breakpoints-invalid\r\n\r\n)*\032\032starting\r\n\r\n(\032\032frames-invalid\r\n\r\n)*\032\032watchpoint 3\r\n.*atchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$decimal\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" \
	   { pass "watch triggered on a.x" }
   -re "\r\n\032\032post-prompt\r\n\r\n(\032\032breakpoints-invalid\r\n\r\n)*\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
	   { kfail "gdb/38" "watch triggered on a.x" }
   -re ".*$gdb_prompt$"  { fail "watch triggered on a.x" }
   timeout    { fail "watch triggered on a.x (timeout)" }
}


#
# send ^C to gdb, so that the quit() function gets called 
# and annotate-quit is tested
# test:
# annotate-quit
#
send_gdb "\003"
gdb_expect {
    -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \
	    { pass "annotate-quit" }
    -re ".*$gdb_prompt$" { fail "annotate-quit" }
    timeout { fail "annotate-quit (timeout)" }
}

#
# FIXME: the testsuite does not currently have tests for 
#        annotate_catchpoints and annotate_function_call
#        and a few variants of the annotations that are 
#        tested (marked by FIXME on the annot?.exp files)
#

# reinstall the old prompt for the rest of the testsuite.

set gdb_prompt $old_gdb_prompt

