summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nieto Cid <dnietoc@gmail.com>2010-07-26 13:18:47 -0300
committerDiego Nieto Cid <dnietoc@gmail.com>2011-04-08 14:36:19 -0300
commit8ff4dc8b26e35c192d090ad1b058493ca8e7269e (patch)
tree1ea9e6df92f2c4058442f5bbddf11436edbf82a2
parenta9a5bcb152def4c737abb84a665232fadfb5e5b2 (diff)
Add debugging messages.
* console-client/xkb/lex.l(include_file): Log file changes. * console-client/xkb/parser.y(key_set_keysym): Log symbol associations. (include_section): Log section being read. (symbolssect,keycodesect,key_new): Log current key. * console-client/xkb/xkbdata.c(keyname_add): Log keyname, keycode and hash. (set_rmod_keycode): Log modifier, keyname and keycode.
-rw-r--r--console-client/xkb/lex.l3
-rw-r--r--console-client/xkb/parser.y16
-rw-r--r--console-client/xkb/xkbdata.c4
3 files changed, 17 insertions, 6 deletions
diff --git a/console-client/xkb/lex.l b/console-client/xkb/lex.l
index 8887e7a5..71d6dfc9 100644
--- a/console-client/xkb/lex.l
+++ b/console-client/xkb/lex.l
@@ -323,6 +323,8 @@ overlay2 { yylval.val = 2; return OVERLAY; }
{
YY_BUFFER_STATE buffer;
+ debug_printf ("including file %s\n.", fname);
+
if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
{
fprintf (stderr, "Includes nested too deeply\n");
@@ -358,6 +360,7 @@ overlay2 { yylval.val = 2; return OVERLAY; }
lineno = include_stack[include_stack_ptr].currline;
filename = include_stack[include_stack_ptr].filename;
yy_switch_to_buffer (include_stack[include_stack_ptr].buffer);
+ debug_printf ("closing file. going back to %s.\n", filename);
return (0);
}
}
diff --git a/console-client/xkb/parser.y b/console-client/xkb/parser.y
index 79dfdbba..66134f89 100644
--- a/console-client/xkb/parser.y
+++ b/console-client/xkb/parser.y
@@ -266,6 +266,7 @@ keycodesect:
| "minimum" '=' NUM ';' keycodesect
{
min_keys = $3;
+ debug_printf ("working on key: %d\n", $3);
current_key = &keys[$3];
}
| MAXIMUM '=' NUM ';' keycodesect
@@ -1053,7 +1054,7 @@ symbolssect:
{ include_sections ($3, XKBSYMBOLS, "symbols", $2); }
symbolinclude
| symbolssect actiondef
-| symbolssect "key" '.' {current_key = default_key; } keydesc ';'
+| symbolssect "key" '.' {debug_printf ("working on default key.\n"); current_key = default_key; } keydesc ';'
| symbolssect error ';' { yyerror ("Error in symbol section\n"); }
;
@@ -1253,7 +1254,7 @@ include_section (char *incl, int sectionsymbol, char *dirname,
}
include_file (includefile, new_mm, strdup (filename));
-
+ debug_printf ("skipping to section %s\n", (sectionname ? sectionname : "default"));
/* If there is a sectionname not the entire file should be included,
the scanner should be positioned at the required section. */
int err;
@@ -1389,10 +1390,12 @@ key_set_keysym (struct key *key, group_t group, int level, symbol ks)
}
else
/* For NoSymbol leave the old symbol intact. */
- if (!ks)
+ if (!ks) {
+ debug_printf ("symbol %d was not added to key.\n", ks);
return;
+ }
-
+ debug_printf ("symbol '%c'(%d) added to key for group %d and level %d.\n", ks, ks, group, level);
keysyms[level++] = ks;
}
@@ -1459,6 +1462,7 @@ key_new (char *keyname)
if (!isempty ((char *) &keys[kc], sizeof (struct key)))
{
current_key = &dummy_key;
+ debug_printf ("working on dummy key due to merge mode.\n");
return;
}
else
@@ -1474,8 +1478,11 @@ key_new (char *keyname)
current_key = &keys[kc];
}
+ debug_printf ("working on key %s(%d)", keyname, kc);
+
if (current_key->numgroups == 0 || merge_mode == replace)
{
+ debug_printf (" cloned default key");
/* Clone the default key. */
memcpy (current_key, default_key, sizeof (struct key));
for (group = 0; group < 3; group++)
@@ -1486,6 +1493,7 @@ key_new (char *keyname)
current_key->groups[group].width = 0;
}
}
+ debug_printf ("\n");
}
/* Load the XKB configuration from the section XKBKEYMAP in the
diff --git a/console-client/xkb/xkbdata.c b/console-client/xkb/xkbdata.c
index ad71e0b3..767bf38a 100644
--- a/console-client/xkb/xkbdata.c
+++ b/console-client/xkb/xkbdata.c
@@ -83,7 +83,7 @@ keyname_add (char *keyname, int keycode)
kn->rmods = 0;
kn_int = keyname_hash(keyname);
- debug_printf ("add : %d\n", kn_mapping.locp_offset);
+ debug_printf ("add key %s(%d) hash: %d\n", keyname, keycode, kn_int);
hurd_ihash_add (&kn_mapping, kn_int, kn);
return 0;
@@ -449,7 +449,7 @@ set_rmod_keycode (char *keyname, int rmod)
{
keycode_t kc = keyname_find (keyname);
keys[kc].mods.rmods = rmod;
- debug_printf ("kc %d = %d\n", kc, rmod);
+ debug_printf ("%s (kc %d) rmod: %d\n", keyname, kc, rmod);
}
/* Initialize XKB data structures. */