From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22620 invoked by alias); 21 Jan 2006 22:24:26 -0000 Received: (qmail 22612 invoked by uid 22791); 21 Jan 2006 22:24:25 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 21 Jan 2006 22:24:25 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F0R9i-0002Dv-P9; Sat, 21 Jan 2006 17:24:22 -0500 Date: Sat, 21 Jan 2006 22:24:00 -0000 From: Daniel Jacobowitz To: Benjamin Benz Cc: gdb-patches@sources.redhat.com Subject: Re: Bugfix for AVR-GDB when using Eclipse/CDT Message-ID: <20060121222422.GA8088@nevyn.them.org> Mail-Followup-To: Benjamin Benz , gdb-patches@sources.redhat.com References: <200601211922.26384.bbe@heise.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200601211922.26384.bbe@heise.de> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00283.txt.bz2 On Sat, Jan 21, 2006 at 07:22:26PM +0100, Benjamin Benz wrote: > Hi, > > when using the gdb-port for AVR-MCUs (avr-gdb) together with eclipse (CDT) the > following happens: > > An "info shared library" command is issued. In solib.c this leads to an > error-msg because the TARGET_PTR_BIT has the value 16, which is not handled. > > To produce the Error without eclipse just do the following: > > Start an simulavr-session with: > simulavr -g -p 1212 -d atmega16 > then open an avr-gdb and tell it: > target remote localhost:1212 > info sharedlibrary > this should kill the avr-gdb. > > Here is a small 3 line Patch, which solves this problem. The patch makes it > possible to use avr-gdb together with eclipse. I've checked in an alternate fix, see below. It works for my tests on both avr and x86_64-pc-linux-gnu. Please let me know if you have any trouble with it. -- Daniel Jacobowitz CodeSourcery 2006-01-21 Daniel Jacobowitz * solib.c (info_sharedlibrary_command): Avoid internal_error. Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.82 diff -u -p -r1.82 solib.c --- solib.c 17 Dec 2005 22:34:02 -0000 1.82 +++ solib.c 21 Jan 2006 22:11:16 -0000 @@ -698,16 +698,8 @@ info_sharedlibrary_command (char *ignore int header_done = 0; int addr_width; - if (TARGET_PTR_BIT == 32) - addr_width = 8 + 4; - else if (TARGET_PTR_BIT == 64) - addr_width = 16 + 4; - else - { - internal_error (__FILE__, __LINE__, - _("TARGET_PTR_BIT returned unknown size %d"), - TARGET_PTR_BIT); - } + /* "0x", a little whitespace, and two hex digits per byte of pointers. */ + addr_width = 4 + (TARGET_PTR_BIT / 4); update_solib_list (from_tty, 0);