From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18452 invoked by alias); 22 Jul 2003 05:00:50 -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 18445 invoked from network); 22 Jul 2003 05:00:48 -0000 Received: from unknown (HELO mail04.idc.renesas.com) (202.234.163.13) by sources.redhat.com with SMTP; 22 Jul 2003 05:00:48 -0000 Received: from mail04.idc.renesas.com (localhost [127.0.0.1]) by mail04.idc.renesas.com with ESMTP id h6M50iEn023690 for ; Tue, 22 Jul 2003 14:00:45 +0900 (JST) Received: from guardian03.idc.renesas.com ([172.20.8.134]) by mail04.idc.renesas.com with ESMTP id h6M50hYB023684; Tue, 22 Jul 2003 14:00:43 +0900 (JST) Received: (from root@localhost) by guardian03.idc.renesas.com with id h6M50f3f003340; Tue, 22 Jul 2003 14:00:41 +0900 (JST) Received: from unknown [172.20.8.69] by guardian03.idc.renesas.com with SMTP id QAA03339 ; Tue, 22 Jul 2003 14:00:41 +0900 Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id h6M50bW8028375; Tue, 22 Jul 2003 14:00:37 +0900 (JST) Received: from rnsmtp01.hoku_r.renesas.com ([10.145.246.51]) by mta02.idc.renesas.com with ESMTP id h6M50aCp028370; Tue, 22 Jul 2003 14:00:36 +0900 (JST) Received: from mrkaisv.hoku.renesas.com ([10.145.105.245]) by rnsmtp01.hoku_r.renesas.com (8.9.3/3.7W) with ESMTP id OAA20339; Tue, 22 Jul 2003 14:00:36 +0900 (JST) Received: from KEI (unknown [10.145.105.81]) by mrkaisv.hoku.renesas.com (Postfix) with SMTP id 2A517798A72; Tue, 22 Jul 2003 14:00:36 +0900 (JST) Message-ID: <01fc01c3500e$7800d2f0$5169910a@KEI> From: "Kei Sakamoto" To: "Andrew Cagney" Cc: References: <007701c341d0$5d44aa50$5169910a@KEI> <02ec01c3477c$8ddf3c00$5169910a@KEI> <3F1C35C6.4010603@redhat.com> Subject: Re: [PATCH] revised m32r target Date: Tue, 22 Jul 2003 05:00:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_01F9_01C35059.E7ACD180" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-SW-Source: 2003-07/txt/msg00386.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_01F9_01C35059.E7ACD180 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Content-length: 608 > Kei, > > I've checked in the .c files, as posted. Not bad, not bad at all. > Can you just see how many of the attached can also be fixed? I'll then > look at enabling it and pulling it into the 6 branch. > > Andrew Thank you for checking in. I revised m32r-tdep.c and m32r-rom.c. I think all warnings in your e-mail are fixed now. I attached the patch file. By the way, would you tell me how to get these warning messages? I built gdb with --enable-build-warnings, but gcc didn't show them. Kei === 2003-07-22 Kei Sakamoto * m32r-rom.c, m32r-tdep.c: Update. ------=_NextPart_000_01F9_01C35059.E7ACD180 Content-Type: application/octet-stream; name="diffs" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="diffs" Content-length: 10347 diff -Naur src.orig/gdb/m32r-rom.c src/gdb/m32r-rom.c=0A= --- src.orig/gdb/m32r-rom.c Tue Jul 22 08:07:28 2003=0A= +++ src/gdb/m32r-rom.c Tue Jul 22 12:10:13 2003=0A= @@ -40,8 +40,6 @@=0A= #include =0A= #include "regcache.h"=0A= =20=0A= -extern void report_transfer_performance (unsigned long, time_t, time_t);= =0A= -=0A= /*=0A= * All this stuff just to get my host computer's IP address!=0A= */=0A= @@ -165,7 +163,8 @@=0A= #endif=0A= end_time =3D time (NULL);=0A= printf_filtered ("Start address 0x%lx\n", bfd_get_start_address (abfd));= =0A= - report_transfer_performance (data_count, start_time, end_time);=0A= + print_transfer_performance (gdb_stdout, data_count, 0,=0A= + end_time - start_time);=0A= =20=0A= /* Finally, make the PC point at the start address */=0A= if (exec_bfd)=0A= @@ -264,7 +263,9 @@=0A= =20=0A= if (regno =3D=3D SPI_REGNUM || regno =3D=3D SPU_REGNUM)=0A= { /* special handling for stack pointer (spu or spi) */=0A= - unsigned long stackmode =3D read_register (PSW_REGNUM) & 0x80;=0A= + ULONGEST stackmode, psw;=0A= + regcache_cooked_read_unsigned (current_regcache, PSW_REGNUM, &psw);=0A= + stackmode =3D psw & 0x80;=0A= =20=0A= if (regno =3D=3D SPI_REGNUM && !stackmode) /* SP =3D=3D SPI */=0A= monitor_supply_register (SP_REGNUM, val);=0A= @@ -568,8 +569,9 @@=0A= }=0A= /* Finally, make the PC point at the start address */=0A= write_pc (bfd_get_start_address (abfd));=0A= - report_transfer_performance (data_count, start_time, end_time);=0A= printf_filtered ("Start address 0x%lx\n", bfd_get_start_address (abf= d));=0A= + print_transfer_performance (gdb_stdout, data_count, 0,=0A= + end_time - start_time);=0A= }=0A= inferior_ptid =3D null_ptid; /* No process now */=0A= =20=0A= @@ -610,23 +612,23 @@=0A= mon2000_ops.to_open =3D mon2000_open;=0A= add_target (&mon2000_ops);=0A= =20=0A= - add_show_from_set=0A= - (add_set_cmd ("download-path", class_obscure, var_string,=0A= - (char *) &download_path,=0A= - "Set the default path for downloadable SREC files.",=0A= - &setlist), &showlist);=0A= -=0A= - add_show_from_set=0A= - (add_set_cmd ("board-address", class_obscure, var_string,=0A= - (char *) &board_addr,=0A= - "Set IP address for M32R-EVA target board.",=0A= - &setlist), &showlist);=0A= -=0A= - add_show_from_set=0A= - (add_set_cmd ("server-address", class_obscure, var_string,=0A= - (char *) &server_addr,=0A= - "Set IP address for download server (GDB's host computer).",=0A= - &setlist), &showlist);=0A= + add_setshow_cmd ("download-path", class_obscure,=0A= + var_string, &download_path,=0A= + "Set the default path for downloadable SREC files.",=0A= + "Show the default path for downloadable SREC files.",=0A= + NULL, NULL, &setlist, &showlist);=0A= +=0A= + add_setshow_cmd ("board-address", class_obscure,=0A= + var_string, &board_addr,=0A= + "Set IP address for M32R-EVA target board.",=0A= + "Show IP address for M32R-EVA target board.",=0A= + NULL, NULL, &setlist, &showlist);=0A= +=0A= + add_setshow_cmd ("server-address", class_obscure,=0A= + var_string, &server_addr,=0A= + "Set IP address for download server (GDB's host computer).",=0A= + "Show IP address for download server (GDB's host computer).",=0A= + NULL, NULL, &setlist, &showlist);=0A= =20=0A= add_com ("upload", class_obscure, m32r_upload_command,=0A= "Upload the srec file via the monitor's Ethernet upload capability.");= =0A= diff -Naur src.orig/gdb/m32r-tdep.c src/gdb/m32r-tdep.c=0A= --- src.orig/gdb/m32r-tdep.c Tue Jul 22 08:07:29 2003=0A= +++ src/gdb/m32r-tdep.c Tue Jul 22 13:38:11 2003=0A= @@ -111,8 +111,8 @@=0A= /* Determine appropriate breakpoint contents and size for this address. = */=0A= if (TARGET_BYTE_ORDER =3D=3D BFD_ENDIAN_BIG)=0A= {=0A= - if (((addr & 3) =3D=3D 0) &&=0A= - ((contents_cache[0] & 0x80) || (contents_cache[2] & 0x80)))=0A= + if (((addr & 3) =3D=3D 0)=0A= + && ((contents_cache[0] & 0x80) || (contents_cache[2] & 0x80)))=0A= {=0A= static unsigned char insn[] =3D M32R_BE_BREAKPOINT32;=0A= bp =3D insn;=0A= @@ -127,8 +127,8 @@=0A= }=0A= else=0A= { /* little-endian */=0A= - if (((addr & 3) =3D=3D 0) &&=0A= - ((contents_cache[1] & 0x80) || (contents_cache[3] & 0x80)))=0A= + if (((addr & 3) =3D=3D 0)=0A= + && ((contents_cache[1] & 0x80) || (contents_cache[3] & 0x80)))=0A= {=0A= static unsigned char insn[] =3D M32R_LE_BREAKPOINT32;=0A= bp =3D insn;=0A= @@ -156,8 +156,8 @@=0A= /* Determine appropriate breakpoint contents and size for this address. = */=0A= if (TARGET_BYTE_ORDER =3D=3D BFD_ENDIAN_BIG)=0A= {=0A= - if (((addr & 3) =3D=3D 0) &&=0A= - ((contents_cache[0] & 0x80) || (contents_cache[2] & 0x80)))=0A= + if (((addr & 3) =3D=3D 0)=0A= + && ((contents_cache[0] & 0x80) || (contents_cache[2] & 0x80)))=0A= {=0A= static unsigned char insn[] =3D M32R_BE_BREAKPOINT32;=0A= bplen =3D sizeof (insn);=0A= @@ -171,8 +171,8 @@=0A= else=0A= {=0A= /* little-endian */=0A= - if (((addr & 3) =3D=3D 0) &&=0A= - ((contents_cache[1] & 0x80) || (contents_cache[3] & 0x80)))=0A= + if (((addr & 3) =3D=3D 0)=0A= + && ((contents_cache[1] & 0x80) || (contents_cache[3] & 0x80)))=0A= {=0A= static unsigned char insn[] =3D M32R_BE_BREAKPOINT32;=0A= bplen =3D sizeof (insn);=0A= @@ -362,9 +362,9 @@=0A= }=0A= else=0A= {=0A= - if (((insn >> 8) =3D=3D 0xe4) && /* ld24 r4, xxxxxx; sub sp, r4 */=0A= - read_memory_unsigned_integer (current_pc + 2,=0A= - 2) =3D=3D 0x0f24)=0A= + if (((insn >> 8) =3D=3D 0xe4) /* ld24 r4, xxxxxx; sub sp, r4 */=0A= + && read_memory_unsigned_integer (current_pc + 2,=0A= + 2) =3D=3D 0x0f24)=0A= /* subtract 24 bit sign-extended negative-offset */=0A= {=0A= insn =3D read_memory_unsigned_integer (current_pc - 2, 4);=0A= @@ -564,9 +564,9 @@=0A= short n =3D op & 0xffff;=0A= info->sp_offset +=3D n;=0A= }=0A= - else if (((op >> 8) =3D=3D 0xe4) && /* ld24 r4, xxxxxx; sub sp, r4 = */=0A= - get_frame_memory_unsigned (next_frame, pc + 4,=0A= - 2) =3D=3D 0x0f24)=0A= + else if (((op >> 8) =3D=3D 0xe4) /* ld24 r4, xxxxxx; sub sp, r4 */= =0A= + && get_frame_memory_unsigned (next_frame, pc + 4,=0A= + 2) =3D=3D 0x0f24)=0A= {=0A= unsigned long n =3D op & 0xffffff;=0A= info->sp_offset +=3D n;=0A= @@ -617,7 +617,7 @@=0A= /* The SP was moved to the FP. This indicates that a new frame=0A= was created. Get THIS frame's FP value by unwinding it from=0A= the next frame. */=0A= - frame_unwind_unsigned_register (next_frame, M32R_FP_REGNUM, &this_ba= se);=0A= + this_base =3D frame_unwind_register_unsigned (next_frame, M32R_FP_RE= GNUM);=0A= /* The FP points at the last saved register. Adjust the FP back=0A= to before the first saved register giving the SP. */=0A= prev_sp =3D this_base + info->size;=0A= @@ -626,7 +626,7 @@=0A= {=0A= /* Assume that the FP is this frame's SP but with that pushed=0A= stack space added back. */=0A= - frame_unwind_unsigned_register (next_frame, M32R_SP_REGNUM, &this_ba= se);=0A= + this_base =3D frame_unwind_register_unsigned (next_frame, M32R_SP_RE= GNUM);=0A= prev_sp =3D this_base + info->size;=0A= }=0A= =20=0A= @@ -657,11 +657,11 @@=0A= m32r_read_pc (ptid_t ptid)=0A= {=0A= ptid_t save_ptid;=0A= - CORE_ADDR pc;=0A= + ULONGEST pc;=0A= =20=0A= save_ptid =3D inferior_ptid;=0A= inferior_ptid =3D ptid;=0A= - pc =3D (int) read_register (M32R_PC_REGNUM);=0A= + regcache_cooked_read_unsigned (current_regcache, M32R_PC_REGNUM, &pc);= =0A= inferior_ptid =3D save_ptid;=0A= return pc;=0A= }=0A= @@ -680,9 +680,7 @@=0A= static CORE_ADDR=0A= m32r_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)=0A= {=0A= - ULONGEST sp;=0A= - frame_unwind_unsigned_register (next_frame, M32R_SP_REGNUM, &sp);=0A= - return sp;=0A= + return frame_unwind_register_unsigned (next_frame, M32R_SP_REGNUM);=0A= }=0A= =20=0A= =20=0A= @@ -744,7 +742,7 @@=0A= else if (len < 4)=0A= {=0A= /* value gets right-justified in the register or stack word */=0A= - memcpy (valbuf + (REGISTER_RAW_SIZE (argreg) - len),=0A= + memcpy (valbuf + (register_size (gdbarch, argreg) - len),=0A= (char *) VALUE_CONTENTS (args[argnum]), len);=0A= val =3D valbuf;=0A= }=0A= @@ -763,15 +761,16 @@=0A= {=0A= /* there's room in a register */=0A= regval =3D=0A= - extract_unsigned_integer (val, REGISTER_RAW_SIZE (argreg));=0A= + extract_unsigned_integer (val,=0A= + register_size (gdbarch, argreg));=0A= regcache_cooked_write_unsigned (regcache, argreg++, regval);=0A= }=0A= =20=0A= /* Store the value 4 bytes at a time. This means that things=0A= larger than 4 bytes may go partly in registers and partly=0A= on the stack. */=0A= - len -=3D REGISTER_RAW_SIZE (argreg);=0A= - val +=3D REGISTER_RAW_SIZE (argreg);=0A= + len -=3D register_size (gdbarch, argreg);=0A= + val +=3D register_size (gdbarch, argreg);=0A= }=0A= }=0A= =20=0A= @@ -811,9 +810,7 @@=0A= static CORE_ADDR=0A= m32r_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)=0A= {=0A= - ULONGEST pc;=0A= - frame_unwind_unsigned_register (next_frame, M32R_PC_REGNUM, &pc);=0A= - return pc;=0A= + return frame_unwind_register_unsigned (next_frame, M32R_PC_REGNUM);=0A= }=0A= =20=0A= /* Given a GDB frame, determine the address of the calling function's=0A= @@ -884,7 +881,7 @@=0A= };=0A= =20=0A= static const struct frame_unwind *=0A= -m32r_frame_p (CORE_ADDR pc)=0A= +m32r_frame_sniffer (struct frame_info *next_frame)=0A= {=0A= return &m32r_frame_unwind;=0A= }=0A= @@ -966,7 +963,7 @@=0A= =20=0A= set_gdbarch_frame_align (gdbarch, m32r_frame_align);=0A= =20=0A= - frame_unwind_append_predicate (gdbarch, m32r_frame_p);=0A= + frame_unwind_append_sniffer (gdbarch, m32r_frame_sniffer);=0A= frame_base_set_default (gdbarch, &m32r_frame_base);=0A= =20=0A= /* Methods for saving / extracting a dummy frame's ID. The ID's=0A= ------=_NextPart_000_01F9_01C35059.E7ACD180--