Commit 6f106f40e225e3d7d62ebc68a9d7cfa8d038d53c

Authored by Perry Werneck
1 parent 2bdf2b3e
Exists in master and in 1 other branch develop

Debbuing API calls.

client/link.sh 0 → 100755
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +#!/bin/bash
  2 +make Debug
  3 +
  4 +sudo ln -sf $(readlink -f ../.bin/Debug/libipc3270.so.5.3) /usr/lib64/libipc3270.so.5.3
  5 +
  6 +
  7 +
client/src/session/remote/wait.cc
@@ -182,6 +182,8 @@ @@ -182,6 +182,8 @@
182 182
183 string key = convertToHost(text,-1); 183 string key = convertToHost(text,-1);
184 184
  185 + debug((const char *) __FUNCTION__, "(", (int) row, ",", (int) col, ", \"", text, "\", length=", key.size());
  186 +
185 wait(seconds, [this, key, row, col]() { 187 wait(seconds, [this, key, row, col]() {
186 188
187 int rc; 189 int rc;
@@ -194,6 +196,7 @@ @@ -194,6 +196,7 @@
194 .call() 196 .call()
195 .pop(rc); 197 .pop(rc);
196 198
  199 + debug("rc=",rc);
197 return rc; 200 return rc;
198 201
199 }); 202 });
server/src/core/methods/get.c
@@ -35,6 +35,8 @@ int ipc3270_method_get_string(GObject *session, GVariant *request, GObject *resp @@ -35,6 +35,8 @@ int ipc3270_method_get_string(GObject *session, GVariant *request, GObject *resp
35 35
36 lib3270_autoptr(char) text = NULL; 36 lib3270_autoptr(char) text = NULL;
37 37
  38 + debug("%s with %d arguments",__FUNCTION__,(int) g_variant_n_children(request));
  39 +
38 switch(g_variant_n_children(request)) { 40 switch(g_variant_n_children(request)) {
39 case 0: // No arguments 41 case 0: // No arguments
40 { 42 {
@@ -62,8 +64,11 @@ int ipc3270_method_get_string(GObject *session, GVariant *request, GObject *resp @@ -62,8 +64,11 @@ int ipc3270_method_get_string(GObject *session, GVariant *request, GObject *resp
62 64
63 g_variant_get(request, "(uuiy)", &row, &col, &len, &lf); 65 g_variant_get(request, "(uuiy)", &row, &col, &len, &lf);
64 66
  67 + debug("lib3270_get_string_at(%d,%d,%d,%d",row,col,len,lf);
65 text = lib3270_get_string_at(hSession, row, col, len, lf); 68 text = lib3270_get_string_at(hSession, row, col, len, lf);
66 69
  70 + debug("response=%s",text);
  71 +
67 } 72 }
68 break; 73 break;
69 74
server/src/core/methods/wait.c
@@ -42,6 +42,8 @@ int ipc3270_method_wait_for_string(GObject *session, GVariant *request, GObject @@ -42,6 +42,8 @@ int ipc3270_method_wait_for_string(GObject *session, GVariant *request, GObject
42 if(*error) 42 if(*error)
43 return 0; 43 return 0;
44 44
  45 + debug("%s with %d arguments",__FUNCTION__,(int) g_variant_n_children(request));
  46 +
45 switch(g_variant_n_children(request)) { 47 switch(g_variant_n_children(request)) {
46 case 2: // Text & timeout 48 case 2: // Text & timeout
47 { 49 {
@@ -84,6 +86,7 @@ int ipc3270_method_wait_for_string(GObject *session, GVariant *request, GObject @@ -84,6 +86,7 @@ int ipc3270_method_wait_for_string(GObject *session, GVariant *request, GObject
84 g_autofree gchar * converted = g_convert_with_fallback(text,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,error); 86 g_autofree gchar * converted = g_convert_with_fallback(text,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,error);
85 rc = lib3270_wait_for_string_at(hSession,row,col,converted,seconds); 87 rc = lib3270_wait_for_string_at(hSession,row,col,converted,seconds);
86 88
  89 + debug("lib3270_wait_for_string_at(%d,%d,\"%s\")=%d",row,col,converted,rc);
87 } 90 }
88 91
89 } 92 }