📄 usrthfork.exp
字号:
# user_th_basic.exp -- Expect script to test gdb with user threads# Copyright (C) 1992 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 2 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, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */# Please email any bugs, comments, and/or additions to this file to:# bug-gdb@prep.ai.mit.eduif $tracelevel { strace $tracelevel}if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa2.0w-*-*"] } { verbose "HPUX thread test ignored for non-hppa or PA64 targets." return 0}set testfile usrthforkset srcfile ${srcdir}/${subdir}/${testfile}.cset binfile ${srcdir}/${subdir}/${testfile}# To build the executable we need to link against the thread library.## /opt/ansic/bin/cc -Ae -g -o usrthfork -lcma usrthfork.c### we have trouble building it on 11.0, so we use the prebuilt## executable instead.####if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."##}#=========================## Test looking at threads.#gdb_exitgdb_startgdb_reinitialize_dir $srcdir/$subdirgdb_load ${binfile}gdb_test "set follow-fork-mode parent" ".*" "set follow-fork-mode parent"gdb_test "b main" "Breakpoint 1.*" "b main"gdb_test "run" "Breakpoint 1, main.*:8.*" "run to main"##gdb_test "next" \## ".*New process.*Detaching after fork from process.*13.*parent.*" \## "next on CMA fork"send_gdb "next\n"gdb_expect { -re ".*Detaching after fork from.*$gdb_prompt $" { pass "next on CMA fork" } -re ".*$gdb_prompt $" { fail "next on CMA fork" } timeout { fail "(timeout) next on CMA fork" }}exec sleep 1gdb_exitreturn 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -