This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bugfix for AVR-GDB when using Eclipse/CDT


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  <dan@codesourcery.com>

	* 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);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]