From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30925 invoked by alias); 6 May 2011 02:24:23 -0000 Received: (qmail 30913 invoked by uid 22791); 6 May 2011 02:24:23 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 May 2011 02:24:09 +0000 Received: by vxk20 with SMTP id 20so3886243vxk.0 for ; Thu, 05 May 2011 19:24:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.72.103 with SMTP id c7mr774445vdv.89.1304648648475; Thu, 05 May 2011 19:24:08 -0700 (PDT) Received: by 10.52.164.101 with HTTP; Thu, 5 May 2011 19:24:08 -0700 (PDT) In-Reply-To: References: Date: Fri, 06 May 2011 02:24:00 -0000 Message-ID: Subject: Re: [testsuite] setting sysroot for target-board From: Wei-cheng Wang To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 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-05/txt/msg00172.txt.bz2 Here is the update :-) 2011-05-06 Wei-cheng Wang * lib/gdbserver-support.exp: Add support for setting sysroot for target system. --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -36,6 +36,10 @@ # Port id to use for socket connection. If not set explicitly, # it will start at "2345" and increment for each use. # +# set_board_info gdb,sysroot +# System root for the target to find shared libraries. +# If target and host are different, this should be properly set. +# # # gdb_target_cmd @@ -44,6 +48,11 @@ proc gdb_target_cmd { targetname serialport } { global gdb_prompt + if [target_info exists gdb,sysroot] { + set gdb_sysroot [target_info gdb,sysroot] + send_gdb "set sysroot $gdb_sysroot\n" + } + set serialport_re [string_to_regexp $serialport] for {set i 1} {$i <= 3} {incr i} { send_gdb "target $targetname $serialport\n" Wei-cheng On Fri, May 6, 2011 at 1:36 AM, Tom Tromey wrote: >>>>>> ">" == Wei-cheng Wang writes: > >>> When testing remote cross-target, libc and other shared libraries >>> will not be compatible with the one on host. > >>> This patch adds support for setting sysroot in target-board files, e.g., >>> set_board_info gdb,sysroot "/path/to/target/libc", >>> so that testsuite can be used for remote cross-target. > > I think this looks reasonable. > > There is a comment just above the definition of gdb_target_cmd that > needs an update for this new parameter. > > This patch also needs a ChangeLog entry. > > Tom >