From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22145 invoked by alias); 23 Jan 2012 13:48:05 -0000 Received: (qmail 22123 invoked by uid 22791); 23 Jan 2012 13:48:03 -0000 X-SWARE-Spam-Status: No, hits=-0.6 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; Mon, 23 Jan 2012 13:47:48 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1RpKFP-0005Vd-9c from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 23 Jan 2012 05:47:47 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 23 Jan 2012 05:47:06 -0800 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Mon, 23 Jan 2012 05:47:45 -0800 Message-ID: <4F1D64FE.9080707@codesourcery.com> Date: Mon, 23 Jan 2012 13:50:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Subject: [patch 2/8] Add to_use_agent in target_ops References: <4F1D55D7.7030506@codesourcery.com> In-Reply-To: <4F1D55D7.7030506@codesourcery.com> Content-Type: multipart/mixed; boundary="------------090509060103080803000703" 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-01/txt/msg00766.txt.bz2 --------------090509060103080803000703 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Content-length: 231 As agent goes in, we need to control the agent to perform debugging operations. This new field in target_ops is used to control this, so that we can implement different for remote debugging and native debugging. -- Yao (齐尧) --------------090509060103080803000703 Content-Type: text/x-patch; name="0002-Add-to_use_agent-in-target.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Add-to_use_agent-in-target.patch" Content-length: 1887 2012-01-13 Yao Qi * target.h (struct target_ops): New field `to_use_agent'. (target_use_agent): New macro. * target.c (update_current_target): Update. --- gdb/target.c | 4 ++++ gdb/target.h | 7 +++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/gdb/target.c b/gdb/target.c index 9aaa0ea..e1955fa 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -697,6 +697,7 @@ update_current_target (void) INHERIT (to_static_tracepoint_marker_at, t); INHERIT (to_static_tracepoint_markers_by_strid, t); INHERIT (to_traceframe_info, t); + INHERIT (to_use_agent, t); INHERIT (to_magic, t); /* Do not inherit to_memory_map. */ /* Do not inherit to_flash_erase. */ @@ -924,6 +925,9 @@ update_current_target (void) de_fault (to_traceframe_info, (struct traceframe_info * (*) (void)) tcomplain); + de_fault (to_use_agent, + (int (*) (int)) + tcomplain); de_fault (to_execution_direction, default_execution_direction); #undef de_fault diff --git a/gdb/target.h b/gdb/target.h index 7d0bed1..cd3f3d4 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -795,6 +795,10 @@ struct target_ops re-fetching when necessary. */ struct traceframe_info *(*to_traceframe_info) (void); + /* Ask the target to use or not to use agent according to USE. Return the + actual value of updated flag. */ + int (*to_use_agent) (int use); + int to_magic; /* Need sub-structure for target machine related rather than comm related? */ @@ -1569,6 +1573,9 @@ extern int target_search_memory (CORE_ADDR start_addr, #define target_traceframe_info() \ (*current_target.to_traceframe_info) () +#define target_use_agent(use) \ + (*current_target.to_use_agent) (use) + /* Command logging facility. */ #define target_log_command(p) \ -- 1.7.0.4 --------------090509060103080803000703--