2268b414f4
* Makefile.in (XMLFILES): Add library-list-svr4.dtd. * features/library-list-svr4.dtd: New file. * remote.c (PACKET_qXfer_libraries_svr4): New. (remote_protocol_features): new entry for PACKET_qXfer_libraries_svr4. (remote_xfer_partial): Handle TARGET_OBJECT_LIBRARIES_SVR4. * solib-svr4.c (struct svr4_library_list): New. [HAVE_LIBEXPAT]: Include xml-support.h. [HAVE_LIBEXPAT] (svr4_library_list_start_library) [HAVE_LIBEXPAT] (svr4_library_list_start_list, svr4_library_attributes) [HAVE_LIBEXPAT] (svr4_library_list_children) [HAVE_LIBEXPAT] (svr4_library_list_attributes) [HAVE_LIBEXPAT] (svr4_library_list_elements, svr4_parse_libraries) [HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries) [!HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries): New. (svr4_read_so_list): Extend the corruption message by addresses. (svr4_current_sos): New variable library_list, call svr4_current_sos_via_xfer_libraries. * target.h (enum target_object): New TARGET_OBJECT_LIBRARIES_SVR4. gdb/gdbserver/ * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug) (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4): New. (struct linux_target_ops): Install linux_qxfer_libraries_svr4. * linux-low.h (struct process_info_private): New member r_debug. * server.c (handle_qxfer_libraries): Call the_target->qxfer_libraries_svr4. (handle_qxfer_libraries_svr4): New function. (qxfer_packets): New entry "libraries-svr4". (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4. * target.h (struct target_ops): New member qxfer_libraries_svr4. * remote.c (remote_xfer_partial): Call add_packet_config_cmd for PACKET_qXfer_libraries_svr4. gdb/doc/ * gdb.texinfo (Requirements, Remote Protocol): Reference also `Library List Format for SVR4 Targets'. (General Query Packets): New item qXfer:libraries-svr4:read. (Library List Format for SVR4 Targets): New node. gdb/testsuite/ * gdb.base/solib-corrupted.exp: Suppress test on is_remote target. (corrupted list): Adjust the expectation.
56 lines
1.8 KiB
Text
56 lines
1.8 KiB
Text
# Copyright 2010, 2011 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/>.
|
|
|
|
if {[skip_shlib_tests]} {
|
|
return 0
|
|
}
|
|
|
|
if {[is_remote target]} {
|
|
# gdbserver prints the warning message but expect is parsing only the GDB
|
|
# output, not the gdbserver output.
|
|
return 0
|
|
}
|
|
|
|
set testfile "solib-corrupted"
|
|
set srcfile start.c
|
|
|
|
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
|
|
untested ${testfile}.exp
|
|
return -1
|
|
}
|
|
|
|
if ![runto_main] {
|
|
fail "Can't run to main"
|
|
return
|
|
}
|
|
|
|
gdb_test "info sharedlibrary" "From * To .*" "normal list"
|
|
|
|
# GDB checks there for matching L_PREV.
|
|
set test "make solibs looping"
|
|
gdb_test_multiple "p/x _r_debug->r_map->l_next = _r_debug->r_map" $test {
|
|
-re "(No symbol \"_r_debug\" in current context\\.|Attempt to extract a component of a value that is not a structure pointer\\.)\r\n$gdb_prompt $" {
|
|
# glibc debug info is not available and it is too difficult to find and
|
|
# parse it from this testcase without the gdb supporting functions.
|
|
verbose -log "no _r_debug symbol has been found"
|
|
xfail $test
|
|
untested ${testfile}.exp
|
|
return
|
|
}
|
|
-re " = 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
|
|
pass $test
|
|
}
|
|
}
|
|
gdb_test "info sharedlibrary" "warning: Corrupted shared library list: .*" "corrupted list"
|