Files
binutils-gdb/gdb/testsuite/gdb.base/exitsignal.exp
Tom de Vries 33b5899fc0 [gdb] Fix typos
Fix a few typos:
- implemention -> implementation
- convertion(s) -> conversion(s)
- backlashes -> backslashes
- signoring -> ignoring
- (un)ambigious -> (un)ambiguous
- occured -> occurred
- hidding -> hiding
- temporarilly -> temporarily
- immediatelly -> immediately
- sillyness -> silliness
- similiar -> similar
- porkuser -> pokeuser
- thats -> that
- alway -> always
- supercede -> supersede
- accomodate -> accommodate
- aquire -> acquire
- priveleged -> privileged
- priviliged -> privileged
- priviledges -> privileges
- privilige -> privilege
- recieve -> receive
- (p)refered -> (p)referred
- succesfully -> successfully
- successfuly -> successfully
- responsability -> responsibility
- wether -> whether
- wich -> which
- disasbleable -> disableable
- descriminant -> discriminant
- construcstor -> constructor
- underlaying -> underlying
- underyling -> underlying
- structureal -> structural
- appearences -> appearances
- terciarily -> tertiarily
- resgisters -> registers
- reacheable -> reachable
- likelyhood -> likelihood
- intepreter -> interpreter
- disassemly -> disassembly
- covnersion -> conversion
- conviently -> conveniently
- atttribute -> attribute
- struction -> struct
- resonable -> reasonable
- popupated -> populated
- namespaxe -> namespace
- intialize -> initialize
- identifer(s) -> identifier(s)
- expection -> exception
- exectuted -> executed
- dungerous -> dangerous
- dissapear -> disappear
- completly -> completely
- (inter)changable -> (inter)changeable
- beakpoint -> breakpoint
- automativ -> automatic
- alocating -> allocating
- agressive -> aggressive
- writting -> writing
- reguires -> requires
- registed -> registered
- recuding -> reducing
- opeartor -> operator
- ommitted -> omitted
- modifing -> modifying
- intances -> instances
- imbedded -> embedded
- gdbaarch -> gdbarch
- exection -> execution
- direcive -> directive
- demanged -> demangled
- decidely -> decidedly
- argments -> arguments
- agrument -> argument
- amespace -> namespace
- targtet -> target
- supress(ed) -> suppress(ed)
- startum -> stratum
- squence -> sequence
- prompty -> prompt
- overlow -> overflow
- memember -> member
- languge -> language
- geneate -> generate
- funcion -> function
- exising -> existing
- dinking -> syncing
- destroh -> destroy
- clenaed -> cleaned
- changep -> changedp (name of variable)
- arround -> around
- aproach -> approach
- whould -> would
- symobl -> symbol
- recuse -> recurse
- outter -> outer
- freeds -> frees
- contex -> context

Tested on x86_64-linux.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00

113 lines
3.8 KiB
Plaintext

# Copyright 2013-2023 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 test checks both $_exitcode and $_exitsignal variables. The
# purpose of this checking is to ensure that the variables are
# mutually exclusive, i.e., that when $_exitsignal is set, $_exitcode
# is not, and vice-versa. This mutual exclusion happens because if an
# inferior exited (either successfully or not), it certainly was not
# killed by a signal. However, if it was killed by an uncaught
# signal, then there is no way for it to have exited.
require {!target_info exists gdb,nosignals}
standard_testfile segv.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
return -1
}
# Run to main. But, before, change cwd to get the core into the
# output directory.
set_inferior_cwd_to_output_dir
if { ![runto_main] } {
return -1
}
# Get the inferior's PID for later.
set pid [get_inferior_pid]
# Print $_exitsignal. It should be void now, because nothing
# happened.
gdb_test "print \$_exitsignal" " = void" \
"\$_exitsignal is void before running"
# Just to guarantee, making sure that $_exitcode is also void.
gdb_test "print \$_exitcode" " = void" \
"\$_exitcode is void before running"
# Trigger SIGSEGV.
gdb_test "continue" "Program received signal SIGSEGV.*" "trigger SIGSEGV"
# Continue until the end.
gdb_test "continue" "Program terminated with signal SIGSEGV.*" \
"program terminated with SIGSEGV"
# We don't need the core file, remove it.
remove_core $pid
# Now, print $_exitsignal again. It should be 11 (SIGSEGV).
gdb_test "print \$_exitsignal" " = 11" \
"\$_exitsignal is 11 (SIGSEGV) after SIGSEGV."
# And $_exitcode should still be void, since the inferior died because
# of a signal, and did not return.
gdb_test "print \$_exitcode" " = void" \
"\$_exitcode is still void after SIGSEGV"
# Re-run to main, i.e., restart the executable.
rerun_to_main
# Print the $_exitsignal again. Even in this normal scenario, it
# should still contain the signal triggered in the other run.
gdb_test "print \$_exitsignal" " = 11" \
"\$_exitsignal is 11 (SIGSEGV) after restarting the inferior"
# And, again, print $_exitcode.
gdb_test "print \$_exitcode" " = void" \
"\$_exitcode is still void after restarting the inferior"
# Now we test the behaviour of $_exit{code,signal} during a normal
# inferior execution.
standard_testfile normal.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
return -1
}
# Checking $_exitsignal and $_exitcode, both should be void before the
# inferior is executed.
gdb_test "print \$_exitsignal" " = void" \
"\$_exitsignal is void before normal inferior is executed"
gdb_test "print \$_exitcode" " = void" \
"\$_exitcode is void before normal inferior is executed"
# Run the inferior until the end.
if { ![runto_main] } {
return -1
}
gdb_continue_to_end
# Checking $_exitcode. It should be 0.
gdb_test "print \$_exitcode" " = 0" \
"\$_exitcode is zero after normal inferior is executed"
# Checking $_exitsignal. It should still be void, since the inferior
# has not received any signal.
gdb_test "print \$_exitsignal" " = void" \
"\$_exitsignal is still void after normal inferior is executed"