Commit 09631d4e authored by Bernhard Link's avatar Bernhard Link

add --print-counts and --print-offsets

parent 74f0b95a
2010-04-07
* Add support for Generic Events (XGE)
* Fix bug in error reporting when multiple STRUCTs have the same name
* add --print-counts --print-offsets
2010-03-30
* Add support for XInputExtension 1.5, and partial support for
XInputExtension 2.0
......
......@@ -390,7 +390,7 @@ char *strndup(const char *str,size_t n) {
}
#endif
enum {LO_DEFAULT=0, LO_TIMESTAMPS, LO_RELTIMESTAMPS, LO_VERSION, LO_HELP};
enum {LO_DEFAULT=0, LO_TIMESTAMPS, LO_RELTIMESTAMPS, LO_VERSION, LO_HELP, LO_PRINTCOUNTS, LO_PRINTOFFSETS};
static int long_only_option = 0;
static const struct option longoptions[] = {
{"display", required_argument, NULL, 'd'},
......@@ -412,6 +412,8 @@ static const struct option longoptions[] = {
{"version", no_argument, &long_only_option, LO_VERSION},
{"timestamps", no_argument, &long_only_option, LO_TIMESTAMPS},
{"relative-timestamps", no_argument, &long_only_option, LO_RELTIMESTAMPS},
{"print-counts", no_argument, &long_only_option, LO_PRINTCOUNTS},
{"print-offsets", no_argument, &long_only_option, LO_PRINTOFFSETS},
{NULL, 0, NULL, 0}
};
......@@ -420,6 +422,9 @@ static void catchsig(int signum UNUSED)
caught_child_signal = true;
}
extern bool print_counts;
extern bool print_offsets;
int main(int argc, char *argv[]) {
int listener,r;
const char *msg;
......@@ -526,6 +531,12 @@ argv[0]);
case LO_RELTIMESTAMPS:
print_reltimestamps = true;
break;
case LO_PRINTCOUNTS:
print_counts = true;
break;
case LO_PRINTOFFSETS:
print_offsets = true;
break;
}
break;
case ':':
......
......@@ -36,8 +36,8 @@ enum package_direction { TO_SERVER, TO_CLIENT };
static void startline(struct connection *c, enum package_direction d, const char *format, ...) FORMAT(printf,3,4);
static const bool print_counts = false;
static const bool print_offsets = false;
const bool print_counts;
const bool print_offsets;
static inline unsigned int padded(unsigned int s) {
return (s+3)&(~3);
......
......@@ -116,6 +116,15 @@ before each line.
Note that the time a packet is printed is between the time
a packet is received and the time a packet is sent,
but it gives no other information than that.
.TP
.B \-\-print-offsets
Print offsets of all fields
(useful to debug nested lists in protocol descriptions)
.TP
.B \-\-print-counts
Print counts
(useful to debug lists in protocol descriptions)
.SH "ENVIRONMENT VARIABLES"
.TP
.B DISPLAY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment