OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.arch/] [powerpc-aix-prologue.exp] - Blame information for rev 394

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
# Copyright 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 3 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program.  If not, see .
15
#
16
# This file is part of the gdb testsuite.
17
 
18
if $tracelevel {
19
    strace $tracelevel
20
}
21
 
22
# Test rs6000 prologue analyzer.
23
 
24
 
25
if ![istarget "powerpc-*-aix*"] then {
26
    verbose "Skipping powerpc-aix prologue tests."
27
    return
28
}
29
 
30
set testfile "powerpc-aix-prologue"
31
set srcfile ${testfile}.c
32
set binfile ${objdir}/${subdir}/${testfile}
33
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
34
    unsupported "Testcase compile failed."
35
    return -1
36
}
37
 
38
gdb_exit
39
gdb_start
40
gdb_reinitialize_dir $srcdir/$subdir
41
gdb_load ${binfile}
42
 
43
# Insert a breakpoint in FUNCTION and verifies that the breakpoint was
44
# inserted at the expected location.  EXPECTED_LOCATION should be an
45
# offset relative to the function start address.
46
proc insert_breakpoint {function expected_location} {
47
    global gdb_prompt
48
    global expect_out
49
    global hex
50
 
51
    set address ""
52
 
53
    # Insert a breakpoint using the given function name, and extract
54
    # the breakpoint address for the output.
55
    gdb_test_multiple "break $function" "set breakpoint in $function" {
56
        -re "Breakpoint .* at ($hex).*$gdb_prompt $" {
57
            set address $expect_out(1,string)
58
        }
59
        default {
60
            fail "set breakpoint in $function"
61
        }
62
    }
63
 
64
    # If we managed to get the breakpoing address, then check that
65
    # we inserted it at the expected location by examining the
66
    # instruction at that address (we're not interested in the insn
67
    # itself, but rather at the address printed at the begining of
68
    # the instruction).
69
    if { $address != "" } then {
70
       gdb_test "x /i $address" \
71
                ".*<$function\\+$expected_location>.*" \
72
                "check $function breakpoint address"
73
    } else {
74
       fail "unable to compute breakpoint address"
75
    }
76
 
77
}
78
 
79
insert_breakpoint "li_stw" 12
80
insert_breakpoint "stack_check_probe_1" 16
81
insert_breakpoint "stack_check_probe_2" 40
82
insert_breakpoint "stack_check_probe_loop_1" 68
83
insert_breakpoint "stack_check_probe_loop_2" 60
84
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.