From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26637 invoked by alias); 17 Sep 2003 13:59:30 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 26623 invoked from network); 17 Sep 2003 13:59:28 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 17 Sep 2003 13:59:28 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h8HDxR415882 for ; Wed, 17 Sep 2003 09:59:27 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h8HDxQe05197; Wed, 17 Sep 2003 09:59:26 -0400 Received: from [150.1.200.14] (vpn50-56.rdu.redhat.com [172.16.50.56]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h8HDxOxI006600; Wed, 17 Sep 2003 09:59:25 -0400 Subject: Re: Problems using Insight/GDB for Coldfire From: Keith Seitz To: =?ISO-8859-1?Q?=22D=F6rr=2C?= "Dirk\"" Cc: "insight@sources.redhat.com" In-Reply-To: <50C52FFF0D55E540AD943758F4208370011A294D@corvus.de.3soft> References: <50C52FFF0D55E540AD943758F4208370011A294D@corvus.de.3soft> Content-Type: text/plain; charset=UTF-8 Organization: Message-Id: <1063807316.1597.18.camel@lindt.uglyboxes.com> Mime-Version: 1.0 Date: Wed, 17 Sep 2003 13:59:00 -0000 Content-Transfer-Encoding: 8bit X-SW-Source: 2003-q3/txt/msg00170.txt.bz2 On Wed, 2003-09-17 at 01:22, "Dörr, Dirk" wrote: > I am using the binary version from sourceforge.net. Can you give me a URI? > Debugging with gdb works fine: > > > m68k-bdm-elf-gdb tstart.elf > (gdb) load > (gdb) set $pc=0x20000 > (gdb) > list > (gdb) list > 1 int _main() > 2 { > 3 int i; > 4 int a=1; > 5 for (i=0;i<10;i++) > 6 { > 7 a*=(i+1); > 8 } > 9 for(;;); return 0; > 10 } > (gdb) break 5 > (gdb) c > Continuing. > > Breakpoint 1, _main () at main.c:5 > 5 for (i=0;i<10;i++) > 1: x/i $pc 0x20042 <_main+10>: clrl %fp@(-4) > > In the working directory is a .gdbinit file that configures the sdram controller and sets the target to /dev/bdmcf0 . In the example, I don't see a target command. Please either send (to the list) the .gdbinit you are using OR run a gdb session IN LINE (i.e,. "file foo.elf", "target BLAH", "load", "break bar", "continue", ...). > But with Insight I have the folling problem: > > I start with > > m68k-bdm-elf-insight > > I can see memory and change it. I can see registers but can't change them. Probably a bug -- you haven't specified a target yet... You shouldn't be able to change memory or registers. > Then I choose Run->Download > > The download dialog shows: 134 bytes (118 .text and 16 .data). Well, it seems that you have attached to a target (probably in .gdbinit). I'm pretty sure this will confuse Insight enormously, especially if the target code was written by anyone with no Insight experience. This issue has come up countless times before. > But now at 0x20000 there is : > > 0xcebc0000 0xffff2f07 0x48780010 0x61002226 > > instead of > > 0x4e7146fc 0x27002e7c 0x00000000 0x4e7bf801 > > and I can't change the memory. Well, Insight is just a UI (and a ton of glue code between the command-line gdb and the Tcl interpreter that runs the UI). The actual loading is handled by gdb. In fact, with only a few minor differences, selecting "Run->Download" is EXACTLY the same as typing "load" at the console. > What am I doing wrong? Again, if I were you, I would NOT put anything in the .gdbinit file which would alter target state (i.e., no "target" command, no register setting, no memory altering, etc.). Insight can still read gdb script files (File->Source...), so if you wanted to do stuff after attaching to the target, then I would put those things into a script file and source it in manually. The problem is that gdb controls when the .gdbinit is read -- it may be read by gdb before Insight is even initialized. Thus, Insight gets no notification that anything has happened. Try running insight WITHOUT the .gdbinit file in place (just rename it temporarily). Use the following commands to "run" your exe: File->Open, set a break, click "Run" button (a target selection dialog should show, allowing you to configure the target). You should not need to anything more (well, most of the time, at least). > BTW: The buttons for step, next ... are greyed out. This is an indication that Insight doesn't know that you've attached to a target. This could be indicative of a bug in the target code, too, but we'll diagnose that later. First things first: I need to know a lot more about your target. Keith