* m32c.opc (BRK, GDBBRK): Remove debug logic.
authorDJ Delorie <dj@redhat.com>
Tue, 17 Jun 2008 00:34:37 +0000 (00:34 +0000)
committerDJ Delorie <dj@redhat.com>
Tue, 17 Jun 2008 00:34:37 +0000 (00:34 +0000)
* main.c (main): Add option to set raw console.
* mem.h (m32c_use_raw_console): Declare.
* mem.c (m32c_sim_restore_console): Only restore console if it's
been previously set.
(m32c_use_raw_console): Define.
(mem_get_byte): Set raw console if m32c_use_raw_console is set.

sim/m32c/ChangeLog
sim/m32c/m32c.opc
sim/m32c/main.c
sim/m32c/mem.c
sim/m32c/mem.h

index 8a30574731ae9dad812f8d3d0207481e69cf1053..4788c8ba3acc2468664258f0623535febbbc0731 100644 (file)
@@ -1,3 +1,13 @@
+2008-06-16  DJ Delorie  <dj@redhat.com>
+
+       * m32c.opc (BRK, GDBBRK): Remove debug logic.
+       * main.c (main): Add option to set raw console.
+       * mem.h (m32c_use_raw_console): Declare.
+       * mem.c (m32c_sim_restore_console): Only restore console if it's
+       been previously set.
+       (m32c_use_raw_console): Define.
+       (mem_get_byte): Set raw console if m32c_use_raw_console is set.
+
 2008-06-06  Vladimir Prus  <vladimir@codesourcery.com>
             Daniel Jacobowitz  <dan@codesourcery.com>
             Joseph Myers  <joseph@codesourcery.com>
index 9f5bd4ab4e725858b0e172d8dcea26a604a9adfc..3fe6cf069a83442613bd725d2e49e6def281679a 100644 (file)
@@ -680,7 +680,7 @@ next_opcode:
   /* We report the break to our caller with the PC still pointing at the 
      breakpoint instruction.  */
   put_reg (pc, m32c_opcode_pc);
-  if (verbose || 1)
+  if (verbose)
     printf("[break]\n");
   if (in_gdb || (regs.r_intbl == 0 && regs.r_intbh == 0))
     return M32C_MAKE_HIT_BREAK ();
@@ -700,7 +700,7 @@ next_opcode:
   /* We report the break to our caller with the PC still pointing at the 
      breakpoint instruction.  */
   put_reg (pc, m32c_opcode_pc);
-  if (verbose || 1)
+  if (verbose)
     printf("[gdb break]\n");
   return M32C_MAKE_HIT_BREAK ();
 
index 7187210ce5f93388c5e391125bd4e8f31759b57b..243be70e9134547de6ff8151c7637961ef7938ba 100644 (file)
@@ -122,7 +122,7 @@ main (int argc, char **argv)
 
   in_gdb = 0;
 
-  while ((o = getopt (argc, argv, "tc:vdm:")) != -1)
+  while ((o = getopt (argc, argv, "tc:vdm:C")) != -1)
     switch (o)
       {
       case 't':
@@ -131,6 +131,9 @@ main (int argc, char **argv)
       case 'c':
        console_port_s = optarg;
        break;
+      case 'C':
+       m32c_use_raw_console = 1;
+       break;
       case 'v':
        verbose++;
        break;
@@ -151,7 +154,7 @@ main (int argc, char **argv)
        break;
       case '?':
        fprintf (stderr,
-                "usage: run [-v] [-t] [-d] [-m r8c|m16c|m32cm|m32c]"
+                "usage: run [-v] [-C] [-c port] [-t] [-d] [-m r8c|m16c|m32cm|m32c]"
                 " program\n");
        exit (1);
       }
index 474fc5e75f9bf97a01bb92c9240aec8d581334c5..20d23500b7c205308f348aaab763d9de4f8ba1ac 100644 (file)
@@ -50,6 +50,7 @@ static unsigned char **pt[L1_LEN];
 
 int m32c_console_ifd = 0;
 int m32c_console_ofd = 1;
+int m32c_use_raw_console = 0;
 
 #ifdef TIMER_A
 Timer_A timer_a;
@@ -394,7 +395,8 @@ stdin_ready ()
 void
 m32c_sim_restore_console ()
 {
-  tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
+  if (console_raw)
+    tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
   console_raw = 0;
 }
 
@@ -409,9 +411,9 @@ mem_get_byte (int address)
     case 0x2ed:                /* m32c uart1c1 */
     case 0x3ad:                /* m16c uart1c1 */
 
-#if 0
-      if (!console_raw)
+      if (!console_raw && m32c_use_raw_console)
        {
+         struct termios attr;
          tcgetattr (m32c_console_ifd, &attr);
          tcgetattr (m32c_console_ifd, &oattr);
          /* We want each key to be sent as the user presses them.  */
@@ -420,7 +422,6 @@ mem_get_byte (int address)
          console_raw = 1;
          atexit (m32c_sim_restore_console);
        }
-#endif
 
       if (stdin_ready ())
        return 0x02;            /* tx empty and rx full */
index ad53a01f595569cd03620815bad9778dfd18a34e..52ad2d67e35f26d7bc2f697a37ff264f9251817d 100644 (file)
@@ -41,3 +41,5 @@ void mem_get_blk (int address, void *bufptr, int nbytes);
 int sign_ext (int v, int bits);
 
 void m32c_sim_restore_console ();
+
+extern int m32c_use_raw_console;
This page took 0.028527 seconds and 4 git commands to generate.