7a9dd1b270
* windows-tdep.c (windows_xfer_shared_library): * windows-nat.c (get_module_name, windows_make_so): * v850-tdep.c (v850_handle_pushm): * utils.c (null_cleanup, gdb_realpath): * ui-out.c (get_next_header): * tracepoint.c (clear_traceframe_info): * symtab.c (lookup_symtab): * serial.h (struct serial_ops): * mipsread.c (read_alphacoff_dynamic_symtab): * infcmd.c (print_return_value): * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): * f-exp.y (parse_number): * exceptions.c (catch_exceptions): * dummy-frame.c (dummy_frame_this_id): * defs.h (struct cleanup): * breakpoint.c (disable_breakpoints_in_unloaded_shlib): * arm-tdep.c (arm_push_dummy_call): * amd64-tdep.h (amd64_collect_xsave): * amd64-tdep.c (amd64_collect_xsave): * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): * README (typing): Remove duplicate words. * cli/cli-decode.c (lookup_cmd_composition): Add comma. * infrun.c (siginfo_value_read): Fix typo. * solib-frv.c (frv_fdpic_find_global_pointer): Likewise. * top.c (source_line_number): Add comma. gdb/doc * gdbint.texinfo (Register Information Functions): Remove duplicate "the". * gdb.texinfo (Emacs): Remove duplicate "to". (GDB/MI Variable Objects): Remove duplicate "the". (General Query Packets): Likewise. gdb/testsuite * gdb.mi/mi-nsmoribund.exp: * gdb.hp/gdb.objdbg/objdbg01.exp: * gdb.base/structs.exp (test_struct_returns): * gdb.base/call-sc.exp (test_scalar_returns): * gdb.base/bigcore.exp: Remove duplicate words. gdb/gdbserver * win32-low.c (handle_load_dll): Remove duplicate "the".
223 lines
8.1 KiB
Text
223 lines
8.1 KiB
Text
# Test reading debug information from in object files.
|
|
|
|
if { [skip_hp_tests] } { continue }
|
|
|
|
if { ![istarget "hppa*-*-hpux*"] } {
|
|
verbose "HPUX test ignored for non-hppa targets."
|
|
return 0
|
|
}
|
|
|
|
set testfile "test"
|
|
set srcsubdir ${srcdir}/${subdir}/objdbg01
|
|
set toolssubdir ${srcdir}/${subdir}/tools
|
|
set objdbgdir ${objdir}/${subdir}/objdbg01
|
|
set binfile ${objdbgdir}/${testfile}
|
|
set symaddrfile ${toolssubdir}/symaddr
|
|
|
|
# Create and source the file that provides information about the compiler
|
|
# used to compile the test case.
|
|
if [get_compiler_info ${binfile}] {
|
|
return -1
|
|
}
|
|
|
|
if {!$hp_aCC_compiler && !$hp_cc_compiler} {
|
|
return 0
|
|
}
|
|
|
|
if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
|
|
untested objdbg01.exp
|
|
return -1
|
|
}
|
|
|
|
if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
|
perror "Couldn't compile x1.cc"
|
|
return -1
|
|
}
|
|
|
|
if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
|
perror "Couldn't compile x2.cc"
|
|
return -1
|
|
}
|
|
|
|
if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
|
perror "Couldn't compile x3.cc"
|
|
return -1
|
|
}
|
|
|
|
if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/x2.o ${objdbgdir}/x3.o" "${binfile}0" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
|
perror "Couldn't compile ${binfile}0"
|
|
return -1
|
|
}
|
|
|
|
if {[gdb_compile "${objdbgdir}/x3.o ${objdbgdir}/x2.o ${objdbgdir}/x1.o" "${binfile}1" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
|
perror "Couldn't compile ${binfile}1"
|
|
return -1
|
|
}
|
|
|
|
# Test two executables. The first has x1.cc linked first, the second
|
|
# has x3.cc linked first. The difference is that in the first one,
|
|
# the Info<PP> instantiation from x1.cc is taken, in the second, its
|
|
# from x3.cc.
|
|
|
|
for {set filenum 0} {$filenum < 2} {incr filenum 1} {
|
|
|
|
# Lets test some commons
|
|
# Need to restart each to make sure objects are not loaded
|
|
# Also cross check the address with what is actually in the
|
|
# object file (call the executable ${symaddrfile} to retrieve the
|
|
# information).
|
|
|
|
set exec_output [lindex [remote_exec build "${symaddrfile} ${binfile}${filenum} acomm"] 1]
|
|
regsub -all "\[\r\n\]" ${exec_output} "" exec_output
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "p &acomm" "..* = \\(int \[*\]\\) 0x${exec_output}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 20."
|
|
gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:20.*20.*acomm.*=.*1.*"
|
|
gdb_test "s 1" "21.*"
|
|
gdb_test "p acomm" ".* = 1.*"
|
|
gdb_test "p &acomm" "..* = \\(int \[*\]\\) 0x${exec_output}.*"
|
|
|
|
# Step through each line.
|
|
# Do this three times.
|
|
# First round: Test that things are okay after printing commons
|
|
# above.
|
|
# Second round: Restart gdb and make sure we can walk through
|
|
# Third round: Do NOT restrart gdb to verify that the debug information
|
|
# was not messed up by loading additional object files from
|
|
# the first run through.
|
|
for {set i 0} {$i < 3} {incr i 1} {
|
|
if $i==1 then {
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
}
|
|
if $i!=2 then {
|
|
gdb_test "b main" \
|
|
"Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 20."
|
|
}
|
|
if $i!=0 then {
|
|
gdb_test "run" \
|
|
"Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:20.*"
|
|
gdb_test "s 1" "21.*"
|
|
}
|
|
gdb_test "s 1" "Info<PP>::p .*/x3.h:11.*"
|
|
gdb_test "s 1" "PP::print .*/x2.cc:8.*"
|
|
gdb_test "s 1" ".*9.*"
|
|
gdb_test "s 1" "Info<PP>::p .*/x3.h:12.*"
|
|
gdb_test "s 1" "main .*/x1.cc:22.*"
|
|
gdb_test "s 1" "foo .*/x3.cc:5.*"
|
|
gdb_test "s 1" "Info<PP>::p .*/x3.h:11.*"
|
|
gdb_test "s 1" "PP::print .*/x2.cc:8.*"
|
|
gdb_test "s 1" ".*9.*"
|
|
gdb_test "s 1" "Info<PP>::p .*/x3.h:12.*"
|
|
gdb_test "s 1" "foo .*/x3.cc:6.*"
|
|
gdb_test "s 1" "Info<QQ>::p .*/x3.h:11.*"
|
|
gdb_test "s 1" "QQ::print .*/x2.cc:13.*"
|
|
gdb_test "s 1" ".*14.*"
|
|
gdb_test "s 1" "Info<QQ>::p .*/x3.h:12.*"
|
|
gdb_test "s 1" "foo .*/x3.cc:7.*"
|
|
gdb_test "s 1" "main .*/x1.cc:24.*"
|
|
gdb_test "s 1" ".*25.*"
|
|
if [istarget "hppa64-*-*"] {
|
|
gdb_test "s 1" "0x\[0-9a-f\]+ in .*"
|
|
gdb_continue_to_end
|
|
} else {
|
|
gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
|
|
gdb_continue_to_end "" "s 1"
|
|
}
|
|
}
|
|
|
|
# Test various ptypes, and combinations of them
|
|
# Test things multiple times in each set to make sure that the debug
|
|
# information did not get messed up.
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype QQ" "type = (class |)QQ {..*void print( |)..*}.*"
|
|
gdb_test "ptype PP" "type = (class |)PP {..*void print( |)..*}.*"
|
|
gdb_test "ptype QQ" "type = (class |)QQ {..*void print( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype PP" "type = (class |)PP {..*void print( |)..*}.*"
|
|
gdb_test "ptype QQ" "type = (class |)QQ {..*void print( |)..*}.*"
|
|
gdb_test "ptype PP" "type = (class |)PP {..*void print( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype Info" "type = template <..*> (class |)Info {..*}.*"
|
|
gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
gdb_test "ptype Info" "type = template <..*> (class |)Info {..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype class QQ" "type = (class |)QQ {..*void print( |)..*}.*"
|
|
gdb_test "ptype class PP" "type = (class |)PP {..*void print( |)..*}.*"
|
|
gdb_test "ptype class QQ" "type = (class |)QQ {..*void print( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype class PP" "type = (class |)PP {..*void print( |)..*}.*"
|
|
gdb_test "ptype class QQ" "type = (class |)QQ {..*void print( |)..*}.*"
|
|
gdb_test "ptype class PP" "type = (class |)PP {..*void print( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype class Info<QQ>" \
|
|
"type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
gdb_test "ptype class Info<PP>" \
|
|
"type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
gdb_test "ptype class Info<QQ>" \
|
|
"type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
|
|
gdb_exit
|
|
gdb_start
|
|
gdb_reinitialize_dir ${srcsubdir}
|
|
gdb_load ${binfile}${filenum}
|
|
gdb_test "ptype class Info<PP>" \
|
|
"type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
gdb_test "ptype class Info<QQ>" \
|
|
"type = (class |)Info<QQ> {..*void p( |)..*}.*"
|
|
gdb_test "ptype class Info<PP>" \
|
|
"type = (class |)Info<PP> {..*void p( |)..*}.*"
|
|
}
|
|
|