This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
[ECOS] Alert: SPARClite gdb bux (and fix)
- To: "eCos Mailing List" <ecos-discuss@sourceware.cygnus.com>
- Subject: [ECOS] Alert: SPARClite gdb bux (and fix)
- From: "Gene Kozin" <gkozin@c-cube.com>
- Date: Thu, 8 Jul 1999 11:29:51 -0700
- Organization: C-Cube Microsystems
The following bug has been found in SPARClite gdb from the
99-03-19 release of eCos tools (ecosSWtools-990319):
Description:
-----------
When connecting to Fujitsu SPARClite evaluation board, gdb
aborts with the following error message: "Magic number of
sparclite target struct wrong".
The said error message is emitted by the function
push_target() (target.c, line 523) if verification of the
target_ops structure fails. The failure occurs when
function sparclite_open() calls push_target() with
&sparclite_ops as an argument (see sparcl-tdep.c, line 508).
This happens because initialization of the sparclite_ops
structure (see sparcl-tdep.c, line 836) is incorrect.
Particularly, initialization of the to_has_thread_control
field (see target.h, line 318) is missing. As a result,
OPS_MAGIC (3840) ends up in the wrong field
(to_sections_end instead of to_magic), causing push_target()
to fail.
How to repeat:
--------------
1. Run sparclite-elf-gdb
2. Connect to the Fujitsu evaluation board:
(gdb) target sparclite com2
3. gdb aborts with to following message:
[SPARClite appears to be alive]
Magic number of sparclite target struct wrong
How to fix:
-----------
To fix the problem, apply the following patch to
.../src/gdb/sparcl-tdep.c file:
-----< patch-start >----------------------
876d875
< 0, /* to_has_thread_control */
-----< patch-end >------------------------