#   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010
#   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
#

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.
gdb_test_no_output "set height 0"

#
# 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)" }
  }

gdb_test_multiple "run" "run until main breakpoint" {
    -re "$main_line.*$gdb_prompt$" {
	pass "run until main breakpoint"
    }
}

#
# print class 'a' with public fields.
# this will test:
# annotate-field-begin
# annotate-field-name-end
# annotate-field-value
# annotate-field-end
#
gdb_test_multiple "print a" "print class" {
    -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"
    }
}

#
# continue until exit
# this will test:
# annotate-exited
# `a.x is 1' is asynchronous regarding to `frames-invalid'.
#
gdb_test_multiple "continue" "continue until exit" {
    -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\032frames-invalid\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"
    }
}

#
# 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. 
#
gdb_test_multiple "break 22" "break at main" {
    -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"
    }
}

#
# change value of main_line
#
set main_line 22

#
# run program up to breakpoint.
#

gdb_test_multiple "run" "run until main breakpoint" {
    -re "$main_line.*$gdb_prompt$"    {
	pass "run until main breakpoint"
    }
}

#
# set up a watch point on a.x 
#
gdb_test_multiple "watch a.x" "set watch on a.x" {
    -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"
    }
}

#
# do a next, so that the watchpoint triggers. This will test:
# annotate-watchpoint
#
gdb_test_multiple "next" "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\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"
    }
}


#
# 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

