From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4011 invoked by alias); 25 Feb 2007 16:50:25 -0000 Received: (qmail 3997 invoked by uid 22791); 25 Feb 2007 16:50:23 -0000 X-Spam-Check-By: sourceware.org Received: from elrond.portugalmail.pt (HELO elrond.portugalmail.pt) (195.245.179.181) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 25 Feb 2007 16:50:18 +0000 Received: from localhost (localhost [127.0.0.1]) by elrond.portugalmail.pt (Postfix) with ESMTP id DB11C38587 for ; Sun, 25 Feb 2007 16:50:10 +0000 (WET) Received: from elrond.portugalmail.pt ([127.0.0.1]) by localhost (elrond.portugalmail.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ihRr2scAykf7 for ; Sun, 25 Feb 2007 16:50:09 +0000 (WET) Received: from [127.0.0.1] (88.210.65.246.rev.optimus.pt [88.210.65.246]) (Authenticated sender: pedro_alves@portugalmail.pt) by elrond.portugalmail.pt (Postfix) with ESMTP id ABF7338205 for ; Sun, 25 Feb 2007 16:49:58 +0000 (WET) Message-ID: <45E1BE25.4040407@portugalmail.pt> Date: Sun, 25 Feb 2007 16:50:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [gdbserver] target doesn't support xml features -> crash. Content-Type: multipart/mixed; boundary="------------090502040700080002000206" X-Antivirus: avast! (VPS 000716-3, 23-02-2007), Outbound message X-Antivirus-Status: Clean 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: 2007-02/txt/msg00311.txt.bz2 This is a multi-part message in MIME format. --------------090502040700080002000206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 446 Daniel, The new xml features support introduced a gdbserver crash when the target doesn't implement the target_ops->arch_string method. win32-i386-low is one example. This patch gets me going. Ok? Cheers, Pedro Alves --- gdb/gdbserver/ChangeLog: * server.c (get_features_xml): Check if target implemented arch_string. * win32-i386-low.c (win32_arch_string): New. (win32_target_ops): Add win32_arch_string as arch_string member. --------------090502040700080002000206 Content-Type: text/plain; name="arch_string.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arch_string.diff" Content-length: 1337 Index: src/gdb/gdbserver/server.c =================================================================== --- src.orig/gdb/gdbserver/server.c 2007-02-25 12:46:40.000000000 +0000 +++ src/gdb/gdbserver/server.c 2007-02-25 12:55:10.000000000 +0000 @@ -216,7 +216,9 @@ if (features_supported == -1) { - const char *arch = (*the_target->arch_string) (); + const char *arch = NULL; + if (the_target->arch_string != NULL) + arch = (*the_target->arch_string) (); if (arch == NULL) features_supported = 0; Index: src/gdb/gdbserver/win32-i386-low.c =================================================================== --- src.orig/gdb/gdbserver/win32-i386-low.c 2007-02-25 12:46:42.000000000 +0000 +++ src/gdb/gdbserver/win32-i386-low.c 2007-02-25 13:06:28.000000000 +0000 @@ -1054,6 +1054,12 @@ return child_xfer_memory (memaddr, (char *) myaddr, len, 1, 0) != len; } +static const char * +win32_arch_string (void) +{ + return "i386"; +} + static struct target_ops win32_target_ops = { win32_create_inferior, win32_attach, @@ -1066,8 +1072,16 @@ win32_store_inferior_registers, win32_read_inferior_memory, win32_write_inferior_memory, - 0, - 0 + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + win32_arch_string }; /* Initialize the Win32 backend. */ --------------090502040700080002000206--