added a dumpState() call to help debugging EscParse

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25419 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2008-05-10 13:30:15 +00:00
parent 4d25ad47a9
commit 3082bb7d0c
2 changed files with 41 additions and 1 deletions
+39 -1
View File
@@ -281,12 +281,48 @@ TermParse::PtyReader()
} }
void
TermParse::DumpState(int *groundtable, int *parsestate, uchar c)
{
static const struct {
int *p;
const char *name;
} tables[] = {
#define T(t) \
{ t, #t }
T(gUTF8GroundTable),
T(gCS96GroundTable),
T(gISO8859GroundTable),
T(gSJISGroundTable),
T(gEscTable),
T(gCsiTable),
T(gDecTable),
T(gScrTable),
T(gIgnoreTable),
T(gIesTable),
T(gEscIgnoreTable),
T(gMbcsTable),
{ NULL, NULL }
};
int i;
fprintf(stderr, "groundtable: ");
for (i = 0; tables[i].p; i++)
if (tables[i].p == groundtable)
fprintf(stderr, "%s\t", tables[i].name);
fprintf(stderr, "parsestate: ");
for (i = 0; tables[i].p; i++)
if (tables[i].p == parsestate)
fprintf(stderr, "%s\t", tables[i].name);
fprintf(stderr, "char: 0x%02x (%d)\n", c, c);
}
int32 int32
TermParse::EscParse() TermParse::EscParse()
{ {
int tmp; int tmp;
int top, bot; int top, bot;
int cs96; int cs96 = 0;
uchar curess = 0; uchar curess = 0;
uchar cbuf[4], dstbuf[4]; uchar cbuf[4], dstbuf[4];
@@ -310,6 +346,8 @@ TermParse::EscParse()
if (GetReaderBuf(c) < B_OK) if (GetReaderBuf(c) < B_OK)
break; break;
//DumpState(groundtable, parsestate, c);
if (now_coding != fView->Encoding()) { if (now_coding != fView->Encoding()) {
/* /*
* Change coding, change parse table. * Change coding, change parse table.
+2
View File
@@ -60,6 +60,8 @@ private:
int32 EscParse(); int32 EscParse();
int32 PtyReader(); int32 PtyReader();
void DumpState(int *groundtable, int *parsestate, uchar c);
static int32 _ptyreader_thread(void *); static int32 _ptyreader_thread(void *);
static int32 _escparse_thread(void *); static int32 _escparse_thread(void *);