From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11995 invoked by alias); 17 Feb 2012 02:57:04 -0000 Received: (qmail 11928 invoked by uid 22791); 17 Feb 2012 02:57:02 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Feb 2012 02:56:48 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1RyE02-0004Px-AB from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 16 Feb 2012 18:56:42 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 16 Feb 2012 18:55:57 -0800 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Thu, 16 Feb 2012 18:56:41 -0800 From: Yao Qi To: Subject: [PATCH 8/9] impl of use_agent and can_use_agent in linux-nat. Date: Fri, 17 Feb 2012 02:57:00 -0000 Message-ID: <1329447300-18841-9-git-send-email-yao@codesourcery.com> In-Reply-To: <1329447300-18841-1-git-send-email-yao@codesourcery.com> References: <1329447300-18841-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00351.txt.bz2 This patch is to implement two target_ops hooks on linux-nat, and look up symbols when a solib is added. 2012-01-13 Yao Qi * linux-nat.c (linux_child_use_agent): New. (linux_child_can_use_agent): New. (linux_target_install_ops): Initialize fields `to_use_agent' and `to_can_use_agent'. * solib.c (solib_add): Call agent_look_up_symbol. --- gdb/linux-nat.c | 22 ++++++++++++++++++++++ gdb/solib.c | 6 +++++- 2 files changed, 27 insertions(+), 1 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 6aab087..3e81fd0 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -59,6 +59,7 @@ #include "solib.h" #include "linux-osdata.h" #include "linux-tdep.h" +#include "agent.h" #ifndef SPUFS_MAGIC #define SPUFS_MAGIC 0x23c9b64e @@ -4800,6 +4801,24 @@ linux_xfer_partial (struct target_ops *ops, enum target_object object, offset, len); } +static int +linux_child_use_agent (int use) +{ + if (agent_loaded_p ()) + { + use_agent = use; + return 1; + } + else + return 0; +} + +static int +linux_child_can_use_agent (void) +{ + return agent_loaded_p (); +} + /* Create a prototype generic GNU/Linux target. The client can override it with local methods. */ @@ -4821,6 +4840,9 @@ linux_target_install_ops (struct target_ops *t) super_xfer_partial = t->to_xfer_partial; t->to_xfer_partial = linux_xfer_partial; + + t->to_use_agent = linux_child_use_agent; + t->to_can_use_agent = linux_child_can_use_agent; } struct target_ops * diff --git a/gdb/solib.c b/gdb/solib.c index 84b9019..4f04f39 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -46,6 +46,7 @@ #include "solib.h" #include "interps.h" #include "filesystem.h" +#include "agent.h" /* Architecture-specific operations. */ @@ -925,7 +926,10 @@ solib_add (char *pattern, int from_tty, } if (loaded_any_symbols) - breakpoint_re_set (); + { + breakpoint_re_set (); + agent_look_up_symbols (); + } if (from_tty && pattern && ! any_matches) printf_unfiltered -- 1.7.0.4