From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32345 invoked by alias); 25 Feb 2003 05:16:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32133 invoked from network); 25 Feb 2003 05:16:14 -0000 Received: from unknown (HELO sohm.kpit.com) (203.129.230.82) by 172.16.49.205 with SMTP; 25 Feb 2003 05:16:14 -0000 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C2DC8D.2EBE0620" Subject: [RFA/PATCH]: H8/300 - Update the generated debug information X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Tue, 25 Feb 2003 05:16:00 -0000 Message-ID: <69595093233BB547BB70CF5E492B63F2DA6751@sohm.kpit.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: From: "Shrinivas Atre" To: , X-SW-Source: 2003-02/txt/msg00631.txt.bz2 This is a multi-part message in MIME format. ------_=_NextPart_001_01C2DC8D.2EBE0620 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 3658 Hi, The GDB for Hitachi H8 target does not show values of integers when compile= d=20 with -mint32 option. e.g. If you use something like "int i=3D30000;"=20 and compile program with -mint32 option, GDB shows value of "i" as zero. This is because, for H8 targets, GDB always treats integers as 16 bits. There is one more reason for this, which needs one change in GCC.=20 While generating COFF debug information for "int" type, the compiler=20 simply inserts type "T_INT" for this. This doesn't say if the "int" is 32 bit or 16 bit. Attached GCC patch , depending upon size of data will export=20 "int" as "short int" if the size of integer is 16 bit and as "int" if the size of integers is 32 bits. And to decode this on GDB, a patch is attached. This patch will make all integers as 32 bits for h8 targets.=20 Assuming that the compiler have taken care of 16 bit integers as short=20 integers. Regards, Shrinivas =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D GCC Changelog -=20 gcc/ChangeLog=20 2003-02-24 Shrinivas Atre =20 * gcc/sdbout.c (plain_type_1): Update COFF debug output information. Output "short int" if integer size is 16 bit. GCC Patch - --- gcc/sdbout.c.orig Wed Feb 5 10:43:48 2003 +++ gcc/sdbout.c Wed Feb 5 10:49:26 2003 @@ -529,9 +529,19 @@ plain_type_1 (type, level) if (!strcmp (name, "signed char")) return T_CHAR; if (!strcmp (name, "int")) - return T_INT; + { + if (size =3D=3D SHORT_TYPE_SIZE) + return T_SHORT; + else + return T_INT; + } if (!strcmp (name, "unsigned int")) - return T_UINT; + { + if (size =3D=3D SHORT_TYPE_SIZE) + return T_USHORT; + else + return T_UINT; + } if (!strcmp (name, "short int")) return T_SHORT; if (!strcmp (name, "short unsigned int")) =09=09=09=09=20=20=20=20=20=20=20 ---------------------------------------------------------------------------= --- GDB Changelog -=20 gdb/ChangeLog=20 2003-02-24 Shrinivas Atre =20 * gdb/h8300-tdep.c (h8300_gdbarch_init): Make default integer size as 32 b= its. =09=09=09=09=20=20=20=20=20=20=20=09=20=20=20=09 GDB Patch - --- gdb/h8300-tdep.orig.c Mon Feb 24 16:47:05 2003 +++ gdb/h8300-tdep.c Mon Feb 24 16:47:45 2003 @@ -1170,7 +1170,7 @@ h8300_gdbarch_init (struct gdbarch_info=20 set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc); =20 - set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT); + set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_ptr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT); set_gdbarch_addr_bit (gdbarch, BINWORD * TARGET_CHAR_BIT); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D ---------------------------------------------------------------------------= -- Free download of GNUSH and GNUH8 tool chains for Hitachi's SH and H8 Series. The following site also offers free support to European customers. Read more at http://www.gnush.com and http://www.gnuh8.com Latest versions of GNUSH and GNUH8 are released on January 31, 2003. ---------------------------------------------------------------------------= --=20 ------_=_NextPart_001_01C2DC8D.2EBE0620 Content-Type: application/octet-stream; name="gdb.changelog" Content-Transfer-Encoding: base64 Content-Description: gdb.changelog Content-Disposition: attachment; filename="gdb.changelog" Content-length: 228 Z2RiL0NoYW5nZUxvZyANCjIwMDMtMDItMjQgU2hyaW5pdmFzIEF0cmUgPHNo cmluaXZhc2FAa3BpdC5jb20+IA0KDQoJKiBnZGIvaDgzMDAtdGRlcC5jICho ODMwMF9nZGJhcmNoX2luaXQpOiBNYWtlIGRlZmF1bHQgaW50ZWdlciBzaXpl IGFzIDMyIGJpdHMuDQoJCQkJICAgICAgIAkgICAJDQo= ------_=_NextPart_001_01C2DC8D.2EBE0620 Content-Type: application/octet-stream; name="gcc.changelog" Content-Transfer-Encoding: base64 Content-Description: gcc.changelog Content-Disposition: attachment; filename="gcc.changelog" Content-length: 269 Z2NjL0NoYW5nZUxvZyANCjIwMDMtMDItMjQgU2hyaW5pdmFzIEF0cmUgPHNo cmluaXZhc2FAa3BpdC5jb20+IA0KDQoJKiBnY2Mvc2Rib3V0LmMgKHBsYWlu X3R5cGVfMSk6IFVwZGF0ZSBDT0ZGIGRlYnVnIG91dHB1dCBpbmZvcm1hdGlv bi4NCgkJCQkgICAgICAgT3V0cHV0ICJzaG9ydCBpbnQiIGlmIGludGVnZXIg c2l6ZSBpcyAxNiBiaXQuDQo= ------_=_NextPart_001_01C2DC8D.2EBE0620 Content-Type: application/octet-stream; name="h8300-tdep.diff" Content-Transfer-Encoding: base64 Content-Description: h8300-tdep.diff Content-Disposition: attachment; filename="h8300-tdep.diff" Content-length: 798 LS0tIGdkYi9oODMwMC10ZGVwLm9yaWcuYwlNb24gRmViIDI0IDE2OjQ3OjA1 IDIwMDMKKysrIGdkYi9oODMwMC10ZGVwLmMJTW9uIEZlYiAyNCAxNjo0Nzo0 NSAyMDAzCkBAIC0xMTcwLDcgKzExNzAsNyBAQCBoODMwMF9nZGJhcmNoX2lu aXQgKHN0cnVjdCBnZGJhcmNoX2luZm8gCiAgIHNldF9nZGJhcmNoX2ZpeF9j YWxsX2R1bW15IChnZGJhcmNoLCBnZW5lcmljX2ZpeF9jYWxsX2R1bW15KTsK ICAgc2V0X2dkYmFyY2hfYnJlYWtwb2ludF9mcm9tX3BjIChnZGJhcmNoLCBo ODMwMF9icmVha3BvaW50X2Zyb21fcGMpOwogCi0gIHNldF9nZGJhcmNoX2lu dF9iaXQgKGdkYmFyY2gsIDIgKiBUQVJHRVRfQ0hBUl9CSVQpOworICBzZXRf Z2RiYXJjaF9pbnRfYml0IChnZGJhcmNoLCA0ICogVEFSR0VUX0NIQVJfQklU KTsKICAgc2V0X2dkYmFyY2hfbG9uZ19iaXQgKGdkYmFyY2gsIDQgKiBUQVJH RVRfQ0hBUl9CSVQpOwogICBzZXRfZ2RiYXJjaF9wdHJfYml0IChnZGJhcmNo LCBCSU5XT1JEICogVEFSR0VUX0NIQVJfQklUKTsKICAgc2V0X2dkYmFyY2hf YWRkcl9iaXQgKGdkYmFyY2gsIEJJTldPUkQgKiBUQVJHRVRfQ0hBUl9CSVQp Owo= ------_=_NextPart_001_01C2DC8D.2EBE0620 Content-Type: application/octet-stream; name="sdbout.diff" Content-Transfer-Encoding: base64 Content-Description: sdbout.diff Content-Disposition: attachment; filename="sdbout.diff" Content-length: 911 LS0tIGdjYy9zZGJvdXQuYy5vcmlnCVdlZCBGZWIgIDUgMTA6NDM6NDggMjAw Mw0KKysrIGdjYy9zZGJvdXQuYwlXZWQgRmViICA1IDEwOjQ5OjI2IDIwMDMN CkBAIC01MjksOSArNTI5LDE5IEBAIHBsYWluX3R5cGVfMSAodHlwZSwgbGV2 ZWwpDQogCSAgICBpZiAoIXN0cmNtcCAobmFtZSwgInNpZ25lZCBjaGFyIikp DQogCSAgICAgIHJldHVybiBUX0NIQVI7DQogCSAgICBpZiAoIXN0cmNtcCAo bmFtZSwgImludCIpKQ0KLQkgICAgICByZXR1cm4gVF9JTlQ7DQorCSAgICAg IHsNCisJCWlmIChzaXplID09IFNIT1JUX1RZUEVfU0laRSkNCisJCSAgcmV0 dXJuIFRfU0hPUlQ7DQorCQllbHNlDQorCSAgICAgIAkgIHJldHVybiBUX0lO VDsNCisJICAgICAgfQ0KIAkgICAgaWYgKCFzdHJjbXAgKG5hbWUsICJ1bnNp Z25lZCBpbnQiKSkNCi0JICAgICAgcmV0dXJuIFRfVUlOVDsNCisJICAgICAg ew0KKwkJaWYgKHNpemUgPT0gU0hPUlRfVFlQRV9TSVpFKQ0KKwkJICByZXR1 cm4gVF9VU0hPUlQ7DQorCQllbHNlDQorCSAgICAgIAkgIHJldHVybiBUX1VJ TlQ7DQorCSAgICAgIH0NCiAJICAgIGlmICghc3RyY21wIChuYW1lLCAic2hv cnQgaW50IikpDQogCSAgICAgIHJldHVybiBUX1NIT1JUOw0KIAkgICAgaWYg KCFzdHJjbXAgKG5hbWUsICJzaG9ydCB1bnNpZ25lZCBpbnQiKSkNCg== ------_=_NextPart_001_01C2DC8D.2EBE0620--