From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14910 invoked by alias); 23 Jun 2011 15:09:57 -0000 Received: (qmail 14896 invoked by uid 22791); 23 Jun 2011 15:09:56 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 15:09:42 +0000 Received: (qmail 26128 invoked from network); 23 Jun 2011 15:09:41 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Jun 2011 15:09:41 -0000 Message-ID: <4E035732.4060704@codesourcery.com> Date: Thu, 23 Jun 2011 15:09:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org, Tom Tromey Subject: [committed] [rfc] Call init_wait_for_inferior before get_offsets References: <4DFED6B3.2050700@codesourcery.com> <201106231138.50006.pedro@codesourcery.com> <4E033D7F.6090000@codesourcery.com> <201106231446.20827.pedro@codesourcery.com> In-Reply-To: <201106231446.20827.pedro@codesourcery.com> Content-Type: multipart/mixed; boundary="------------070605000803040601050204" 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: 2011-06/txt/msg00357.txt.bz2 This is a multi-part message in MIME format. --------------070605000803040601050204 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 455 On 06/23/2011 09:46 PM, Pedro Alves wrote: > Your patch is okay ... > >> > + init_wait_for_inferior (); >> > + >> > get_offsets (); /* Get text, data & bss offsets. */ > ... with a small comment above the init_wait_for_inferior call > mentioning the reason it is called before get_offsets. > Thanks for the review. Comment is added new patch. Committed. http://sourceware.org/ml/gdb-cvs/2011-06/msg00140.html -- Yao (齐尧) --------------070605000803040601050204 Content-Type: text/x-patch; name="0003-move-init_wait_for_inferior-forward.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0003-move-init_wait_for_inferior-forward.patch" Content-length: 1954 gdb/ * infrun.c (start_remote): Move call init_wait_for_inferior to ... * remote.c (remote_start_remote): ... here. * monitor.c (monitor_open): ... here. --- gdb/infrun.c | 1 - gdb/monitor.c | 2 ++ gdb/remote.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 67a74cc..3d39080 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2128,7 +2128,6 @@ start_remote (int from_tty) { struct inferior *inferior; - init_wait_for_inferior (); inferior = current_inferior (); inferior->stop_soon = STOP_QUIETLY_REMOTE; diff --git a/gdb/monitor.c b/gdb/monitor.c index 95e6a63..4775011 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -838,6 +838,8 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) monitor_printf (current_monitor->line_term); + init_wait_for_inferior (); + start_remote (from_tty); } diff --git a/gdb/remote.c b/gdb/remote.c index 50e671d..f329f20 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3422,6 +3422,17 @@ remote_start_remote (struct ui_out *uiout, void *opaque) /* Always add the main thread. */ add_thread_silent (inferior_ptid); + /* init_wait_for_inferior should be called before get_offsets in order + to manage `inserted' flag in bp loc in a correct state. + breakpoint_init_inferior, called from init_wait_for_inferior, set + `inserted' flag to 0, while before breakpoint_re_set, called from + start_remote, set `inserted' flag to 1. In the initialization of + inferior, breakpoint_init_inferior should be called first, and then + breakpoint_re_set can be called. If this order is broken, state of + `inserted' flag is wrong, and cause some problems on breakpoint + manipulation. */ + init_wait_for_inferior (); + get_offsets (); /* Get text, data & bss offsets. */ /* If we could not find a description using qXfer, and we know -- 1.7.0.4 --------------070605000803040601050204--