From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7270 invoked by alias); 7 Mar 2013 14:12:00 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 7230 invoked by uid 9364); 7 Mar 2013 14:11:59 -0000 Date: Thu, 07 Mar 2013 14:12:00 -0000 Message-ID: <20130307141159.7214.qmail@sourceware.org> From: gary@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] gbenson/rtld-probes: Start working on solist_update_incremental X-Git-Refname: refs/heads/gbenson/rtld-probes X-Git-Reftype: branch X-Git-Oldrev: b88fe6f212c035a1088e802d6740ae53dee578d7 X-Git-Newrev: 642aef84879efa927f7b94b72b30e15b8686b3da X-SW-Source: 2013-q1/txt/msg00241.txt.bz2 List-Id: The branch, gbenson/rtld-probes has been updated via 642aef84879efa927f7b94b72b30e15b8686b3da (commit) via 3d4c222d0804871168d16e1466f1a4e8722c2c88 (commit) via 2e90669c786ad4c7b415f63ddd9b4e77f599026a (commit) from b88fe6f212c035a1088e802d6740ae53dee578d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 642aef84879efa927f7b94b72b30e15b8686b3da Author: Gary Benson Date: Thu Mar 7 12:32:00 2013 +0000 Start working on solist_update_incremental commit 3d4c222d0804871168d16e1466f1a4e8722c2c88 Author: Gary Benson Date: Thu Mar 7 12:12:58 2013 +0000 Add "annex" argument to svr4_current_sos_via_xfer_libraries commit 2e90669c786ad4c7b415f63ddd9b4e77f599026a Author: Gary Benson Date: Thu Mar 7 12:04:59 2013 +0000 Finally figured out how to thread incremental updates through here? ----------------------------------------------------------------------- Summary of changes: gdb/solib-svr4.c | 55 +++++++++++++++++++++++++++++++++++++++++++---------- gdb/target.c | 2 +- 2 files changed, 45 insertions(+), 12 deletions(-) First 500 lines of diff: diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index ae9761d..356035a 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -366,6 +366,10 @@ struct svr4_info CORE_ADDR interp_plt_sect_low; CORE_ADDR interp_plt_sect_high; + /* Nonzero if the list of objects was last obtained from the target + via qXfer:libraries-svr4:read. */ + int using_xfer; + /* Table mapping breakpoint addresses to probes and actions, used by the probes-based interface. */ htab_t probes_table; @@ -1214,14 +1218,19 @@ svr4_parse_libraries (const char *document, struct svr4_library_list *list) return 0; } -/* Attempt to get so_list from target via qXfer:libraries:read packet. +/* Attempt to get so_list from target via qXfer:libraries-svr4:read packet. Return 0 if packet not supported, *SO_LIST_RETURN is not modified in such case. Return 1 if *SO_LIST_RETURN contains the library list, it may be - empty, caller is responsible for freeing all its entries. */ + empty, caller is responsible for freeing all its entries. + + Note that ANNEX must be NULL if the remote does not explicitly allow + qXfer:libraries-svr4:read packets with non-empty annexes. Support for + this can be checked using target_augmented_libraries_svr4_read (). */ static int -svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list) +svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list, + const char *annex) { char *svr4_library_document; int result; @@ -1230,7 +1239,7 @@ svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list) /* Fetch the list of shared libraries. */ svr4_library_document = target_read_stralloc (¤t_target, TARGET_OBJECT_LIBRARIES_SVR4, - NULL); + annex); if (svr4_library_document == NULL) return 0; @@ -1244,7 +1253,8 @@ svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list) #else static int -svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list) +svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list, + const char *annex) { return 0; } @@ -1385,7 +1395,9 @@ svr4_current_sos_1 (struct svr4_info *info) /* XXX need a better name! */ Unfortunately statically linked inferiors will also fall back through this suboptimal code path. */ - if (svr4_current_sos_via_xfer_libraries (&library_list)) + info->using_xfer = svr4_current_sos_via_xfer_libraries (&library_list, + NULL); + if (info->using_xfer) { if (library_list.main_lm) info->main_lm_addr = library_list.main_lm; @@ -1664,17 +1676,41 @@ static int solist_update_incremental (struct svr4_info *info, CORE_ADDR lm) { struct so_list *tail, **link; + CORE_ADDR prev_lm; + /* Fall back to a full update if we haven't read anything yet. */ if (info->solib_list == NULL) return 0; + /* Fall back to a full update if we are using a remote target + that does not support incremental transfers. */ + if (info->using_xfer && !target_augmented_libraries_svr4_read()) + return 0; + /* Walk to the end of the list. */ for (tail = info->solib_list; tail->next; tail = tail->next); link = &tail->next; + prev_lm = tail->lm_info->lm_addr; /* Read the new objects. */ - if (!svr4_read_so_list (lm, tail->lm_info->lm_addr, &link, 0)) - return 0; + if (info->using_xfer) + { + struct svr4_library_list library_list; + char annex[64]; + + xsnprintf (annex, sizeof (annex), "start=%lx;prev=%lx", lm, prev_lm); + if (!svr4_current_sos_via_xfer_libraries (&library_list, annex)) + return 0; + + // XXX + printf_unfiltered ("got incremental transfer, now what?\n"); + return 0; + } + else + { + if (!svr4_read_so_list (lm, prev_lm, &link, 0)) + return 0; + } return 1; } @@ -1714,9 +1750,6 @@ svr4_handle_solib_event (void) if (info->probes_table == NULL) return; - /* Do nothing if (XXX target) doesn't support incremental. */ - //XXX - /* If anything goes wrong we revert to the original linker interface. */ old_chain = make_cleanup (disable_probes_interface_cleanup, NULL); diff --git a/gdb/target.c b/gdb/target.c index 5ce25eb..9d56793 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -945,7 +945,7 @@ update_current_target (void) return_zero); de_fault (to_augmented_libraries_svr4_read, (int (*) (void)) - return_one); + return_zero); de_fault (to_execution_direction, default_execution_direction); #undef de_fault hooks/post-receive -- Repository for Project Archer.