From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19217 invoked by alias); 21 Oct 2013 10:30:17 -0000 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 Received: (qmail 19186 invoked by uid 89); 21 Oct 2013 10:30:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2013 10:30:15 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VYCkV-00015Z-Nu from Hui_Zhu@mentor.com for gdb-patches@sourceware.org; Mon, 21 Oct 2013 03:30:11 -0700 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, 21 Oct 2013 03:30:12 -0700 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.2.247.3; Mon, 21 Oct 2013 03:30:10 -0700 Message-ID: <5265022F.8060203@mentor.com> Date: Mon, 21 Oct 2013 10:30:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: gdb-patches ml Subject: [PATCH] Let gdbserver doesn't tell GDB it support target-side breakpoint conditions and commands if it doesn't support 'Z' packet Content-Type: multipart/mixed; boundary="------------080700070206080401030301" X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00615.txt.bz2 --------------080700070206080401030301 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1334 We found that in powerpc arch board, it cannot pass some dprintf test: FAIL: gdb.base/dprintf.exp: dprintf info 2 (pattern 6) FAIL: gdb.mi/mi-dprintf.exp: mi expect stop (unknown output after running) FAIL: gdb.mi/mi-dprintf.exp: mi 1st dprintf, agent (unknown output after running) This because the gdbserver will always tell GDB that it support target-side breakpoint conditions and commands. So "set dprintf-style agent" will always got success. But target-side breakpoint conditions and commands are depend on 'Z' packet because GDB just can post target-side breakpoint conditions and commands with 'Z' packet. The test will check if "set dprintf-style agent" success or not. Because it will always succes. So GDB change the commands to agent-printf that will make test get fail. So I make a patch to check if the low-target support insert_point before return support target-side breakpoint conditions and commands. Tested in powerpc-linux target. 2013-10-21 Hui Zhu * linux-low.c (linux_supports_insert_point): New. (linux_target_op): Add linux_supports_insert_point. * server.c (handle_query): Check target_supports_insert_point before return support target-side breakpoint conditions and commands. * target.h (target_ops): Add supports_insert_point. (target_supports_insert_point): New. --------------080700070206080401030301 Content-Type: text/plain; charset="us-ascii"; name="fix-dprintf.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-dprintf.txt" Content-length: 2222 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4929,6 +4929,15 @@ linux_supports_range_stepping (void) return (*the_low_target.supports_range_stepping) (); } +static int +linux_supports_insert_point (void) +{ + if (the_low_target.insert_point != NULL) + return 1; + + return 0; +} + /* Enumerate spufs IDs for process PID. */ static int spu_enumerate_spu_ids (long pid, unsigned char *buf, CORE_ADDR offset, int len) @@ -5825,6 +5834,7 @@ static struct target_ops linux_target_op NULL, #endif linux_supports_range_stepping, + linux_supports_insert_point, }; static void --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -1806,9 +1806,16 @@ handle_query (char *own_buf, int packet_ strcat (own_buf, ";tracenz+"); } - /* Support target-side breakpoint conditions and commands. */ - strcat (own_buf, ";ConditionalBreakpoints+"); - strcat (own_buf, ";BreakpointCommands+"); + /* GDB will send target-side breakpoint conditions and commands packets + with insert point packets. So if target doesn't support insert + point, it should not support target-side breakpoint conditions + and commands packets. */ + if (target_supports_insert_point ()) + { + /* Support target-side breakpoint conditions and commands. */ + strcat (own_buf, ";ConditionalBreakpoints+"); + strcat (own_buf, ";BreakpointCommands+"); + } if (target_supports_agent ()) strcat (own_buf, ";QAgent+"); --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -365,6 +365,9 @@ struct target_ops /* Return true if target supports range stepping. */ int (*supports_range_stepping) (void); + + /* Return true if target supports insert_point. */ + int (*supports_insert_point) (void); }; extern struct target_ops *the_target; @@ -504,6 +507,10 @@ int kill_inferior (int); (the_target->supports_range_stepping ? \ (*the_target->supports_range_stepping) () : 0) +#define target_supports_insert_point() \ + (the_target->supports_insert_point ? \ + (*the_target->supports_insert_point) () : 0) + /* Start non-stop mode, returns 0 on success, -1 on failure. */ int start_non_stop (int nonstop); --------------080700070206080401030301--