diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-12-02 22:26:54 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-12-02 22:26:54 +0000 |
commit | 2268b414f486239cbcc0f756f157c3e03599efac (patch) | |
tree | b5837ff00eaa715115c6ab6d7425c274183c2c1e /gdb/doc | |
parent | 1b31d05e6b9e7ee812949dc8c488f1f662ae6add (diff) | |
download | gdb-2268b414f486239cbcc0f756f157c3e03599efac.zip gdb-2268b414f486239cbcc0f756f157c3e03599efac.tar.gz gdb-2268b414f486239cbcc0f756f157c3e03599efac.tar.bz2 |
gdb/
* 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.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 82 |
2 files changed, 88 insertions, 1 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index e6cd76a..10581bd 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,10 @@ +2011-12-02 Jan Kratochvil <jan.kratochvil@redhat.com> + + * 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. + 2011-12-01 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Writing a Pretty-Printer): Use append method, not diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 86333ee..c6d58fb 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -32448,7 +32448,8 @@ Remote protocol memory maps (@pxref{Memory Map Format}) @item Target descriptions (@pxref{Target Descriptions}) @item -Remote shared library lists (@pxref{Library List Format}) +Remote shared library lists (@xref{Library List Format}, +or alternatively @pxref{Library List Format for SVR4 Targets}) @item MS-Windows shared libraries (@pxref{Shared Libraries}) @item @@ -33285,6 +33286,7 @@ Show the current setting of the target wait timeout. * Examples:: * File-I/O Remote Protocol Extension:: * Library List Format:: +* Library List Format for SVR4 Targets:: * Memory Map Format:: * Thread List Format:: * Traceframe Info Format:: @@ -34986,6 +34988,10 @@ The remote stub understands the @samp{qXfer:features:read} packet The remote stub understands the @samp{qXfer:libraries:read} packet (@pxref{qXfer library list read}). +@item qXfer:libraries-svr4:read +The remote stub understands the @samp{qXfer:libraries-svr4:read} packet +(@pxref{qXfer svr4 library list read}). + @item qXfer:memory-map:read The remote stub understands the @samp{qXfer:memory-map:read} packet (@pxref{qXfer memory map read}). @@ -35231,6 +35237,18 @@ the operating system manages the list of loaded libraries. This packet is not probed by default; the remote stub must request it, by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}). +@item qXfer:libraries-svr4:read:@var{annex}:@var{offset},@var{length} +@anchor{qXfer svr4 library list read} +Access the target's list of loaded libraries when the target is an SVR4 +platform. @xref{Library List Format for SVR4 Targets}. The annex part +of the generic @samp{qXfer} packet must be empty (@pxref{qXfer read}). + +This packet is optional for better performance on SVR4 targets. +@value{GDBN} uses memory read packets to read the SVR4 library list otherwise. + +This packet is not probed by default; the remote stub must request it, +by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}). + @item qXfer:memory-map:read::@var{offset},@var{length} @anchor{qXfer memory map read} Access the target's @dfn{memory-map}. @xref{Memory Map Format}. The @@ -37542,6 +37560,68 @@ In addition, segments and section descriptors cannot be mixed within a single library element, and you must supply at least one segment or section for each library. +@node Library List Format for SVR4 Targets +@section Library List Format for SVR4 Targets +@cindex library list format, remote protocol + +On SVR4 platforms @value{GDBN} can use the symbol table of a dynamic loader +(e.g.@: @file{ld.so}) and normal memory operations to maintain a list of +shared libraries. Still a special library list provided by this packet is +more efficient for the @value{GDBN} remote protocol. + +The @samp{qXfer:libraries-svr4:read} packet returns an XML document which lists +loaded libraries and their SVR4 linker parameters. For each library on SVR4 +target, the following parameters are reported: + +@itemize @minus +@item +@code{name}, the absolute file name from the @code{l_name} field of +@code{struct link_map}. +@item +@code{lm} with address of @code{struct link_map} used for TLS +(Thread Local Storage) access. +@item +@code{l_addr}, the displacement as read from the field @code{l_addr} of +@code{struct link_map}. For prelinked libraries this is not an absolute +memory address. It is a displacement of absolute memory address against +address the file was prelinked to during the library load. +@item +@code{l_ld}, which is memory address of the @code{PT_DYNAMIC} segment +@end itemize + +Additionally the single @code{main-lm} attribute specifies address of +@code{struct link_map} used for the main executable. This parameter is used +for TLS access and its presence is optional. + +@value{GDBN} must be linked with the Expat library to support XML +SVR4 library lists. @xref{Expat}. + +A simple memory map, with two loaded libraries (which do not use prelink), +looks like this: + +@smallexample +<library-list-svr4 version="1.0" main-lm="0xe4f8f8"> + <library name="/lib/ld-linux.so.2" lm="0xe4f51c" l_addr="0xe2d000" + l_ld="0xe4eefc"/> + <library name="/lib/libc.so.6" lm="0xe4fbe8" l_addr="0x154000" + l_ld="0x152350"/> +</library-list-svr> +@end smallexample + +The format of an SVR4 library list is described by this DTD: + +@smallexample +<!-- library-list-svr4: Root element with versioning --> +<!ELEMENT library-list-svr4 (library)*> +<!ATTLIST library-list-svr4 version CDATA #FIXED "1.0"> +<!ATTLIST library-list-svr4 main-lm CDATA #IMPLIED> +<!ELEMENT library EMPTY> +<!ATTLIST library name CDATA #REQUIRED> +<!ATTLIST library lm CDATA #REQUIRED> +<!ATTLIST library l_addr CDATA #REQUIRED> +<!ATTLIST library l_ld CDATA #REQUIRED> +@end smallexample + @node Memory Map Format @section Memory Map Format @cindex memory map format |