From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32562 invoked by alias); 8 Aug 2008 02:48:08 -0000 Received: (qmail 32553 invoked by uid 22791); 8 Aug 2008 02:48:07 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Aug 2008 02:47:13 +0000 Received: (qmail 7514 invoked from network); 8 Aug 2008 02:47:11 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Aug 2008 02:47:11 -0000 From: Pedro Alves To: Daniel Jacobowitz Subject: Re: Make remote-m32r-sdi target already register a main thread Date: Fri, 08 Aug 2008 02:48:00 -0000 User-Agent: KMail/1.9.9 Cc: gdb-patches@sourceware.org References: <200808080303.55454.pedro@codesourcery.com> <20080808021956.GA23272@caradoc.them.org> In-Reply-To: <20080808021956.GA23272@caradoc.them.org> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_YP7mIAcmylt4uX7" Message-Id: <200808080347.52275.pedro@codesourcery.com> 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: 2008-08/txt/msg00180.txt.bz2 --Boundary-00=_YP7mIAcmylt4uX7 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 561 On Friday 08 August 2008 03:19:56, Daniel Jacobowitz wrote: > On Fri, Aug 08, 2008 at 03:03:55AM +0100, Pedro Alves wrote: > > This adjust the remote-m32r-sdi target to add a thread to gdb's thread > > table. > > > > I've no means to test this, although the changes are very similar > > to what I've done to monitor.c, and remote-sim.c, the latter I > > did test at the time I changed it. > > > > OK? > > OK. Thanks! I checked it in, ..., only to realise afterwards that I missed two target methods. I've checked in the attached as obvious. -- Pedro Alves --Boundary-00=_YP7mIAcmylt4uX7 Content-Type: text/x-diff; charset="iso-8859-1"; name="remote-m32r_thread_alive.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="remote-m32r_thread_alive.diff" Content-length: 2058 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.9620 diff -u -p -r1.9620 ChangeLog --- ChangeLog 8 Aug 2008 02:34:08 -0000 1.9620 +++ ChangeLog 8 Aug 2008 02:44:33 -0000 @@ -1,5 +1,10 @@ 2008-08-08 Pedro Alves + * remote-m32r-sdi.c (m32r_thread_alive, m32r_pid_to_str): New. + (init_m32r_ops): Register m32r_thread_alive and m32r_pid_to_str. + +2008-08-08 Pedro Alves + * remote-m32r-sdi.c: Include "gdbthread.h". (remote_m32r_ptid): New. (m32r_close): Delete the main thread. Index: remote-m32r-sdi.c =================================================================== RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v retrieving revision 1.32 diff -u -p -r1.32 remote-m32r-sdi.c --- remote-m32r-sdi.c 8 Aug 2008 02:34:10 -0000 1.32 +++ remote-m32r-sdi.c 8 Aug 2008 02:44:33 -0000 @@ -1490,6 +1490,34 @@ m32r_stopped_by_watchpoint (void) return m32r_stopped_data_address (¤t_target, &addr); } +/* Check to see if a thread is still alive. */ + +static int +m32r_thread_alive (ptid_t ptid) +{ + if (ptid_equal (ptid, remote_m32r_ptid)) + /* The main task is always alive. */ + return 1; + + return 0; +} + +/* Convert a thread ID to a string. Returns the string in a static + buffer. */ + +static char * +m32r_pid_to_str (ptid_t ptid) +{ + static char buf[64]; + + if (ptid_equal (remote_m32r_ptid, ptid)) + { + xsnprintf (buf, sizeof buf, "Thread
"); + return buf; + } + + return normal_pid_to_str (ptid); +} static void sdireset_command (char *args, int from_tty) @@ -1612,6 +1640,8 @@ init_m32r_ops (void) m32r_ops.to_mourn_inferior = m32r_mourn_inferior; m32r_ops.to_stop = m32r_stop; m32r_ops.to_log_command = serial_log_command; + m32r_ops.to_thread_alive = m32r_thread_alive; + m32r_ops.to_pid_to_str = m32r_pid_to_str; m32r_ops.to_stratum = process_stratum; m32r_ops.to_has_all_memory = 1; m32r_ops.to_has_memory = 1; --Boundary-00=_YP7mIAcmylt4uX7--