[Ttssh2-commit] [5590] デバッグモードで使用するモードを選べるようにした。

svnno****@sourc***** svnno****@sourc*****
2014年 5月 19日 (月) 18:05:23 JST


Revision: 5590
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5590
Author:   doda
Date:     2014-05-19 18:05:23 +0900 (Mon, 19 May 2014)
Log Message:
-----------
デバッグモードで使用するモードを選べるようにした。

Modified Paths:
--------------
    trunk/installer/release/TERATERM.INI
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/keyboard.c
    trunk/teraterm/ttpset/ttset.c

-------------- next part --------------
Modified: trunk/installer/release/TERATERM.INI
===================================================================
--- trunk/installer/release/TERATERM.INI	2014-05-19 08:03:12 UTC (rev 5589)
+++ trunk/installer/release/TERATERM.INI	2014-05-19 09:05:23 UTC (rev 5590)
@@ -460,6 +460,7 @@
 
 ; Display all characters (debug mode)
 Debug=off
+DebugModes=all
 
 ; Delimters for word selection
 ;  (compatible with earlier versions of Tera Term)

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2014-05-19 08:03:12 UTC (rev 5589)
+++ trunk/teraterm/common/tttypes.h	2014-05-19 09:05:23 UTC (rev 5590)
@@ -275,6 +275,13 @@
 #define CSF_CBREAD      2
 #define CSF_CBRW        (CSF_CBREAD | CSF_CBWRITE)
 
+// Debug Flags (used in ts.DebugModes)
+#define DBGF_NONE	0
+#define DBGF_NORM	1
+#define DBGF_HEXD	2
+#define DBGF_NOUT	4
+#define DBGF_ALL	(DBGF_NORM | DBGF_HEXD | DBGF_NOUT)
+
 // Title Reporting Type
 #define IdTitleReportIgnore 0
 #define IdTitleReportAccept 8
@@ -574,6 +581,7 @@
 	WORD JoinSplitURL;
 	char JoinSplitURLIgnoreEOLChar;
 	char MulticastName[MAX_PATH];
+	WORD DebugModes;
 };
 
 typedef struct tttset TTTSet, *PTTSet;
@@ -1037,6 +1045,9 @@
  * Increment the number of this macro value
  * when you change TMap or member of TMap.
  *
+ * - At version 4.83, ttset_memfilemap was replaced with ttset_memfilemap_24.
+ *   added tttset.DebugModes
+ *
  * - At version 4.82, ttset_memfilemap was replaced with ttset_memfilemap_23.
  *   added tttset.MulticastName
  *

Modified: trunk/teraterm/teraterm/keyboard.c
===================================================================
--- trunk/teraterm/teraterm/keyboard.c	2014-05-19 08:03:12 UTC (rev 5589)
+++ trunk/teraterm/teraterm/keyboard.c	2014-05-19 09:05:23 UTC (rev 5590)
@@ -565,9 +565,11 @@
       (VKey==VK_MENU)) return KEYDOWN_CONTROL;
 
   /* debug mode */
-  if ((ts.Debug>0) && (VKey == VK_ESCAPE) && ShiftKey()) {
+  if (ts.Debug && (VKey == VK_ESCAPE) && ShiftKey()) {
     MessageBeep(0);
-	DebugFlag = (DebugFlag+1)%DEBUG_FLAG_MAXD;
+    do {
+      DebugFlag = (DebugFlag+1)%DEBUG_FLAG_MAXD;
+    } while (DebugFlag != DEBUG_FLAG_NONE && !((ts.DebugModes >> (DebugFlag-1)) & 1));
     CodeCount = 0;
     PeekMessage((LPMSG)&M,HWin,WM_CHAR,WM_CHAR,PM_REMOVE);
     return KEYDOWN_CONTROL;

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2014-05-19 08:03:12 UTC (rev 5589)
+++ trunk/teraterm/ttpset/ttset.c	2014-05-19 09:05:23 UTC (rev 5590)
@@ -1534,6 +1534,28 @@
 
 	GetPrivateProfileString(Section, "JoinSplitURLIgnoreEOLChar", "\\", Temp, sizeof(Temp), FName);
 	ts->JoinSplitURLIgnoreEOLChar = Temp[0];
+
+	// Debug modes.
+	GetPrivateProfileString(Section, "DebugModes", "all", Temp, sizeof(Temp), FName);
+	if (_stricmp(Temp, "on") == 0 || _stricmp(Temp, "all") == 0)
+		ts->DebugModes = DBGF_ALL;
+	else if (_stricmp(Temp, "off") == 0 || _stricmp(Temp, "none") == 0) {
+		ts->DebugModes = DBGF_NONE;
+		ts->Debug = FALSE;
+	}
+	else {
+		ts->DebugModes = DBGF_NONE;
+		for (i=1; GetNthString(Temp, i, sizeof(Temp2), Temp2); i++) {
+			if (_stricmp(Temp2, "normal") == 0)
+				ts->DebugModes |= DBGF_NORM;
+			else if (_stricmp(Temp2, "hex") == 0)
+				ts->DebugModes |= DBGF_HEXD;
+			else if (_stricmp(Temp2, "noout") == 0)
+				ts->DebugModes |= DBGF_NOUT;
+		}
+		if (ts->DebugModes == DBGF_NONE)
+			ts->Debug = FALSE;
+	}
 }
 
 void FAR PASCAL WriteIniFile(PCHAR FName, PTTSet ts)
@@ -2700,6 +2722,38 @@
 
 	_snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%c", ts->JoinSplitURLIgnoreEOLChar);
 	WritePrivateProfileString(Section, "JoinSplitURLIgnoreEOLChar", Temp, FName);
+
+	// Debug modes.
+	if (ts->DebugModes == DBGF_ALL) {
+		strncpy_s(Temp, sizeof(Temp), "all", _TRUNCATE);
+	}
+	else {
+		if (ts->DebugModes & DBGF_NORM) {
+			strncpy_s(Temp, sizeof(Temp), "normal", _TRUNCATE);
+		}
+		else {
+			Temp[0] = 0;
+		}
+
+		if (ts->DebugModes & DBGF_HEXD) {
+			if (Temp[0] != 0) {
+				strncat_s(Temp, sizeof(Temp), ",", _TRUNCATE);
+			}
+			strncat_s(Temp, sizeof(Temp), "hex", _TRUNCATE);
+		}
+
+		if (ts->DebugModes & DBGF_NOUT) {
+			if (Temp[0] != 0) {
+				strncat_s(Temp, sizeof(Temp), ",", _TRUNCATE);
+			}
+			strncat_s(Temp, sizeof(Temp), "noout", _TRUNCATE);
+		}
+
+		if (Temp[0] == 0) {
+			strncpy_s(Temp, sizeof(Temp), "none", _TRUNCATE);
+		}
+	}
+	WritePrivateProfileString(Section, "DebugModes", Temp, FName);
 }
 
 #define VTEditor "VT editor keypad"



Ttssh2-commit メーリングリストの案内