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.threads/] [thread_check.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 (C) 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 was written by Manoj Iyer. (manjo@austin.ibm.com)
17
# Test break points and single step on thread functions.
18
#
19
# Test Purpose:
20
# - Test that breakpoints, continue in a threaded  application works.
21
#   On powerpc64-unknown-linux-gnu system, running kernel version
22
#   2.6.5-7.71-pseries64 this test is known to fail due to kernel bug
23
#   in ptrace system call.
24
#
25
# Test Strategy:
26
# - thread_check.c creates 2 threads
27
# - start gdb
28
# - create 2 breakpoints #1 main() #2 tf() (the thread function)
29
# - run gdb till #1 main() breakpoint is reached
30
# - continue to breakpoint #2 tf()
31
# - delete all breakpoints
32
# - exit gdb.
33
 
34
if $tracelevel then {
35
        strace $tracelevel
36
}
37
 
38
 
39
set testfile "thread_check"
40
set srcfile ${testfile}.c
41
set binfile ${objdir}/${subdir}/${testfile}
42
 
43
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
44
    return -1
45
}
46
 
47
 
48
gdb_start
49
gdb_reinitialize_dir $srcdir/$subdir
50
gdb_load ${binfile}
51
 
52
if ![runto_main] then {
53
   fail "Can't run to main"
54
      return 1;
55
}
56
 
57
 
58
#
59
# set breakpoint at thread fucntion tf
60
#
61
gdb_test "break tf" \
62
    "Breakpoint.*at.* file .*$srcfile, line.*" \
63
    "breakpoint at tf"
64
 
65
 
66
#
67
#
68
# continue to tf() breakpoint #2
69
#
70
gdb_test "continue" \
71
     ".*Breakpoint 2,.*tf.*at.*$srcfile:.*" \
72
     "continue to tf"
73
 
74
#
75
# backtrace from thread function.
76
#
77
gdb_test "backtrace" \
78
    "#0 .*tf .*at .*$srcfile:.*" \
79
    "backtrace from thread function"
80
 
81
 
82
#
83
# delete all breakpoints
84
#
85
delete_breakpoints
86
 
87
#
88
# exit gdb
89
#
90
gdb_exit

powered by: WebSVN 2.1.0

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