From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11042 invoked by alias); 3 Dec 2003 18:28:47 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 11035 invoked from network); 3 Dec 2003 18:28:46 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 3 Dec 2003 18:28:46 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1D8322B8F; Wed, 3 Dec 2003 13:28:41 -0500 (EST) Message-ID: <3FCE2B59.50603@gnu.org> Date: Wed, 03 Dec 2003 18:28:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nitin Gupta Cc: Daniel Jacobowitz , Ian Lance Taylor , gdb@sources.redhat.com Subject: Re: GDB for Multiprocessor Architecture References: <36993D449C7FA647BF43568E0793AB3E32A59B@nevis_pune_xchg.pune.nevisnetworks.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-12/txt/msg00051.txt.bz2 > Hi, > How can GDB be used to debug an application running on a chip that has n > number of similar CPUs. These CPUs share memories and run different code > images. > I plan to do a debugging session using the hardware probe and the GDB > remote protocol. My target does not have any OS support as Linux or > RTEMS but the host is a Linux box. > My question is how can I get to know that currently GDB is talking to > which CPU? Is it possible for me to do something like > gdb> load image1.o > gdb> CPU=1 > gdb> |get register contents| > gdb> load image2.o > gdb> CPU=3 > gdb> |get register contents| > > and such similar stuff. > > One way of implementing this is using the thread model but then each CPU > has altogether different code image to execute. Shall I have multiple > sessions of GDB, one per CPU? But again if a debug exception is raised > say a breakpoint is hit, how will I know on the host side which CPU has > hit the breakpoint. > > Has anybody done a similar task on any other target? Any help on this > fron shall be grateful. CPU's can be modeled using GDB's thread framework. However, at present the model doesn't extend as far as modeling separate memory regions for each CPU (something that needs to be fixed). Andrew