* Bugfix for AVR-GDB when using Eclipse/CDT
@ 2006-01-21 18:21 Benjamin Benz
2006-01-21 22:24 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Benz @ 2006-01-21 18:21 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 713 bytes --]
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.
Best regards
Benjamin Benz
Heise Zeitschriften Velag
Redaktion c't
http://www.heise.de/ct
[-- Attachment #2: Changelog --]
[-- Type: text/plain, Size: 162 bytes --]
2006-01-21 Benjamin Benz <bbe@heise.de>
* solib.c: info_sharedlibrary_command fixed for AVR-Targets
* version.in: Set version to 6.4 for the releases
[-- Attachment #3: patch.txt --]
[-- Type: text/plain, Size: 605 bytes --]
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.82
diff -u -r1.82 solib.c
--- solib.c 17 Dec 2005 22:34:02 -0000 1.82
+++ solib.c 21 Jan 2006 18:01:34 -0000
@@ -702,7 +702,10 @@
addr_width = 8 + 4;
else if (TARGET_PTR_BIT == 64)
addr_width = 16 + 4;
- else
+ else if (TARGET_PTR_BIT == 16) {
+ printf_unfiltered (_("No shared libraries on 8-Bit-Platforms.\n"));
+ return;
+ }else
{
internal_error (__FILE__, __LINE__,
_("TARGET_PTR_BIT returned unknown size %d"),
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Bugfix for AVR-GDB when using Eclipse/CDT
2006-01-21 18:21 Bugfix for AVR-GDB when using Eclipse/CDT Benjamin Benz
@ 2006-01-21 22:24 ` Daniel Jacobowitz
2006-01-22 11:14 ` Benjamin Benz
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2006-01-21 22:24 UTC (permalink / raw)
To: Benjamin Benz; +Cc: gdb-patches
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);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Bugfix for AVR-GDB when using Eclipse/CDT
2006-01-21 22:24 ` Daniel Jacobowitz
@ 2006-01-22 11:14 ` Benjamin Benz
2006-01-22 15:50 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Benz @ 2006-01-22 11:14 UTC (permalink / raw)
To: gdb-patches
Hi,
> 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.
No trouble at all, Your patch works fine for me. Thanks for the fast answer.
When will Your patch be into the official code tree and when in a relase
version?
Thanks in advance
Benjamin Benz
Redaktion c't
Heise Zeitschriften Verlag
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bugfix for AVR-GDB when using Eclipse/CDT
2006-01-22 11:14 ` Benjamin Benz
@ 2006-01-22 15:50 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2006-01-22 15:50 UTC (permalink / raw)
To: Benjamin Benz; +Cc: gdb-patches
On Sun, Jan 22, 2006 at 12:15:48PM +0100, Benjamin Benz wrote:
> Hi,
>
> > 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.
>
> No trouble at all, Your patch works fine for me. Thanks for the fast answer.
> When will Your patch be into the official code tree and when in a relase
> version?
It's already in CVS. It will be in the next release, whenever that is.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-01-22 15:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-21 18:21 Bugfix for AVR-GDB when using Eclipse/CDT Benjamin Benz
2006-01-21 22:24 ` Daniel Jacobowitz
2006-01-22 11:14 ` Benjamin Benz
2006-01-22 15:50 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox