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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gdb-7.2/] [gdb-7.2-or32-1.0rc1/] [gdb/] [testsuite/] [gdb.arch/] [i386-gnu-cfi.exp] - Blame information for rev 341

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
# Copyright 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
# Please email any bugs, comments, and/or additions to this file to:
17
# bug-gdb@gnu.org
18
 
19
# This file is part of the gdb testsuite.
20
 
21
# Unwinding of DW_CFA_GNU_negative_offset_extended test program.
22
 
23
if $tracelevel {
24
    strace $tracelevel
25
}
26
 
27
# Test i386 unwinder.
28
 
29
 
30
if ![istarget "i?86-*-*"] then {
31
    verbose "Skipping i386 unwinder tests."
32
    return
33
}
34
 
35
set testfile "i386-gnu-cfi"
36
set srcfilec ${testfile}.c
37
set srcfileasm ${testfile}-asm.S
38
set binfile ${objdir}/${subdir}/${testfile}
39
 
40
# some targets have leading underscores on assembly symbols.
41
# TODO: detect this automatically
42
set additional_flags ""
43
if { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } then {
44
  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
45
}
46
 
47
if { [gdb_compile "${srcdir}/${subdir}/${srcfilec} ${srcdir}/${subdir}/${srcfileasm}" "${binfile}" executable [list debug $additional_flags]] != "" } {
48
    untested i386-gnu-cfi.exp
49
    return -1
50
}
51
 
52
# Get things started.
53
 
54
gdb_exit
55
gdb_start
56
gdb_reinitialize_dir $srcdir/$subdir
57
gdb_load ${binfile}
58
 
59
# We should stop in abort(3).
60
 
61
gdb_run_cmd
62
 
63
gdb_test_multiple {} "continue to abort()" {
64
    -re ".*Program received signal SIGABRT,.*$gdb_prompt $" {
65
        pass "continue to abort()"
66
    }
67
}
68
 
69
# Backtrace would crash before.
70
 
71
gdb_test "bt" \
72
         "main \\(\\) at .*${testfile}.c.*" \
73
         "backtrace"
74
 
75
# Check we see the inserted `DW_CFA_GNU_negative_offset_extended' CFI.
76
# We see there the original CFI-stored filename `gate.c'.
77
 
78
gdb_test "up 3" \
79
         "gate \\(\[^()\]*\\) at .*gate.c.*" \
80
         "shift up to the modified frame"
81
 
82
gdb_test_multiple "info frame" "Existence of the CFI inserted register" {
83
    -re "Stack level 3, frame at (0x\[0-9a-f\]+):.*Saved registers:.* ecx at (0x\[0-9a-f\]+),.*" {
84
        pass "Existence of the CFI inserted register"
85
        if { [string compare $expect_out(1,string) $expect_out(2,string)] } then {
86
            fail "Value of the CFI inserted register"
87
        } else {
88
            pass "Value of the CFI inserted register"
89
        }
90
    }
91
}

powered by: WebSVN 2.1.0

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