From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1931 invoked by alias); 6 May 2009 14:34:38 -0000 Received: (qmail 1914 invoked by uid 22791); 6 May 2009 14:34:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 May 2009 14:34:29 +0000 Received: (qmail 16120 invoked from network); 6 May 2009 14:34:25 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 May 2009 14:34:25 -0000 From: Pedro Alves To: danny.backx@scarlet.be Subject: Re: Post mortem debugging for Windows CE Date: Wed, 06 May 2009 14:34:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org References: <1240929901.29047.110.camel@dannypc> <200905051753.45227.pedro@codesourcery.com> <1241619130.4083.137.camel@dannypc> In-Reply-To: <1241619130.4083.137.camel@dannypc> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905061535.07698.pedro@codesourcery.com> 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: 2009-05/txt/msg00115.txt.bz2 On Wednesday 06 May 2009 15:12:10, Danny Backx wrote: > After a good deal of actually using gdb to debug itself (as I did a lot > in these days), Welcome to the club. :-) > here is where I am at : > > dannypc: {1013} gdb/gdb examples/callstack.exe examples/Ce042809-01.kdmp > GNU gdb 6.8 ^^^ you'll need to move to CVS gdb at some point. GDB's been changing a lot since 6.8, but, I don't think you'll be much affected. > coredll.dll.0409.mui: No such file or directory. > Error while mapping shared library sections: > coredll.dll: No such file or directory. > Symbol file not found for coredll.dll.0409.mui > Symbol file not found for coredll.dll > Core was generated by `callstack'. > Program terminated with signal 11, Segmentation fault. > [New process 594225230] > #0 0x00011178 in fibo (n=2) at callstack.c:11 > 11 return *i; > (gdb) info sharedlibrary > >From To Syms Read Shared Object Library > No coredll.dll.0409.mui > No coredll.dll > (gdb) > > It doesn't print from- and to-addresses in this example. I believe that > this is because solib_map_sections can't read the DLL files (they're > target DLLs from Windows CE, I don't have them on my host). So it fails > in : > scratch_chan = solib_open (filename, &scratch_pathname); > > if (scratch_chan < 0) > { > perror_with_name (filename); > } > > Am I right in concluding that this is the way it should work ? Looking very good. I had a vague memory that WinCE gdbserver reports absolute dlls paths when doing live debugging. Does it not? What does "info sharedlibrary" say when doing live debugging? When paths are reported as relative (coredll.dll vs /Windows/coredll.dll), then pointing gdb at a local host copy of dlls with the 'set sysroot' command doesn't help. You'll need 'set solib-search-path'. (gdb) help set sysroot Set an alternate system root. The system root is used to load absolute shared library symbol files. For other (relative) files, you can add directories using `set solib-search-path'. (gdb) help set solib-search-path Set the search path for loading non-absolute shared library symbol files. This takes precedence over the environment variables PATH and LD_LIBRARY_PATH. [ coredll.dll can't be (easilly) extracted from ROM, but, you're not expected to debug coredll.dll anyway. ] > Does anyone have tricks to produce some fake DLL file for this type of > scenario ? Completely untested, but something as simple as this? bad.c: int crashme (int *foofoo) { return *foofoo; } arm-mingw32ce-gcc bad.c -o bad.dll -O0 -g3 -shared main.c: int main() { crashme (NULL); } arm-mingw32ce-gcc main.c -o main.exe -O0 -g3 -L. -lbad ? BTW, does "info threads" show the correct list of threads? -- Pedro Alves