From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20814 invoked by alias); 19 Apr 2002 21:07:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20775 invoked from network); 19 Apr 2002 21:07:01 -0000 Received: from unknown (HELO potter.sfbay.redhat.com) (205.180.83.107) by sources.redhat.com with SMTP; 19 Apr 2002 21:07:01 -0000 Received: from free.redhat.lsd.ic.unicamp.br (vpn3-3.sfbay.redhat.com [172.16.25.3] (may be forged)) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g3JL6Rv01892; Fri, 19 Apr 2002 14:06:30 -0700 Received: (from aoliva@localhost) by free.redhat.lsd.ic.unicamp.br (8.11.6/8.11.6) id g3JL6ZD05533; Fri, 19 Apr 2002 18:06:35 -0300 To: cgd@broadcom.com Cc: gdb-patches@sources.redhat.com, fche@redhat.com, echristo@redhat.com Subject: Re: MIPS simulator initializes LSI pmon vector table with code References: From: Alexandre Oliva Organization: GCC Team, Red Hat Date: Fri, 19 Apr 2002 14:07:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg00637.txt.bz2 On Apr 18, 2002, cgd@broadcom.com wrote: > The code at 0xbfc00200, etc., _ARE_ supposed to be code; in MIPS > they're various exception entry points. If they are data which is > invalid code, the wrong thing will almost certainly happen. Ok, so could you please explain to me how these two chunks of code can possibly be correct: if (lsipmon_monitor_base != 0) { address_word vaddr = (lsipmon_monitor_base + (loop * 4)); sim_write (sd, vaddr, (char *)&value, sizeof (value)); } (where lsipmon_monitor_base is 0xBFC00200, and loop varies from 0 to 23. I read that as writing pointers into lsipmon_monitor_base) sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt)); sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt)); sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt)); (where halt is 64-byte long chunk of code, which means that one of these halts overwrites not only its own entry in lsipmon_monitor_base, but also the following entry.) > I cannot believe that any monitor does what you describe (puts a table > of addresses here), as doing so (instead of putting vectors there) > would be fundamentally incompatible with the MIPS architecture. I stand corrected. It doesn't write pointers into chose chunks. I misremembered what I had seen. The values of `value' that are written in the first chunk of code as numbers that range from 6 to 28, except for the printf service. However, I don't see how a code sequence that halts the machine could possibly fit there as an entry in the vector table. Enlightenment would be appreciated. Thanks, -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer