* 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-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>
/* 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 ();
/* 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 ();
in_gdb = 0;
- while ((o = getopt (argc, argv, "tc:vdm:")) != -1)
+ while ((o = getopt (argc, argv, "tc:vdm:C")) != -1)
switch (o)
{
case 't':
case 'c':
console_port_s = optarg;
break;
+ case 'C':
+ m32c_use_raw_console = 1;
+ break;
case 'v':
verbose++;
break;
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);
}
int m32c_console_ifd = 0;
int m32c_console_ofd = 1;
+int m32c_use_raw_console = 0;
#ifdef TIMER_A
Timer_A timer_a;
void
m32c_sim_restore_console ()
{
- tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
+ if (console_raw)
+ tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
console_raw = 0;
}
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. */
console_raw = 1;
atexit (m32c_sim_restore_console);
}
-#endif
if (stdin_ready ())
return 0x02; /* tx empty and rx full */
int sign_ext (int v, int bits);
void m32c_sim_restore_console ();
+
+extern int m32c_use_raw_console;