diff options
author | eutarass | 2009-03-16 21:57:52 +0000 |
---|---|---|
committer | eutarass | 2009-03-16 21:57:52 +0000 |
commit | baca74ebedf385215ea7d9abef2ccdd72b9b032e (patch) | |
tree | 3049f540cb8b6dd281291e329904c67a67448e6b | |
parent | b2e764eb2640ddf5825ce8cc516fb5f89306fffa (diff) | |
download | org.eclipse.tcf.agent-baca74ebedf385215ea7d9abef2ccdd72b9b032e.tar.gz org.eclipse.tcf.agent-baca74ebedf385215ea7d9abef2ccdd72b9b032e.tar.xz org.eclipse.tcf.agent-baca74ebedf385215ea7d9abef2ccdd72b9b032e.zip |
Bug 264723: API extension to TCF Registers and Memory services
-rw-r--r-- | memoryservice.c | 13 | ||||
-rw-r--r-- | registers.c | 21 |
2 files changed, 34 insertions, 0 deletions
diff --git a/memoryservice.c b/memoryservice.c index 68c45a89..af3c7b0a 100644 --- a/memoryservice.c +++ b/memoryservice.c @@ -88,6 +88,19 @@ static void write_context(OutputStream * out, Context * ctx) { write_stream(out, ':'); json_write_ulong(out, sizeof(char *)); + write_stream(out, ','); + json_write_string(out, "AccessTypes"); + write_stream(out, ':'); + write_stream(out, '['); + json_write_string(out, "instruction"); + write_stream(out, ','); + json_write_string(out, "data"); +#if !defined(_WRS_KERNEL) + write_stream(out, ','); + json_write_string(out, "user"); +#endif + write_stream(out, ']'); + write_stream(out, '}'); } diff --git a/registers.c b/registers.c index e0f1f12f..06bf8740 100644 --- a/registers.c +++ b/registers.c @@ -454,6 +454,26 @@ static void command_setm(char * token, Channel * c) { write_stream(&c->out, MARKER_EOM); } +static void read_filter_attrs(InputStream * inp, char * nm, void * arg) { + loc_free(json_skip_object(inp)); +} + +static void command_search(char * token, Channel * c) { + char id[256]; + + json_read_string(&c->inp, id, sizeof(id)); + if (read_stream(&c->inp) != 0) exception(ERR_JSON_SYNTAX); + json_read_struct(&c->inp, read_filter_attrs, NULL); + if (read_stream(&c->inp) != 0) exception(ERR_JSON_SYNTAX); + if (read_stream(&c->inp) != MARKER_EOM) exception(ERR_JSON_SYNTAX); + + write_stringz(&c->out, "R"); + write_stringz(&c->out, token); + write_errno(&c->out, ERR_UNSUPPORTED); + write_stringz(&c->out, "null"); + write_stream(&c->out, MARKER_EOM); +} + void ini_registers_service(Protocol * proto) { add_command_handler(proto, REGISTERS, "getContext", command_get_context); add_command_handler(proto, REGISTERS, "getChildren", command_get_children); @@ -461,6 +481,7 @@ void ini_registers_service(Protocol * proto) { add_command_handler(proto, REGISTERS, "set", command_set); add_command_handler(proto, REGISTERS, "getm", command_getm); add_command_handler(proto, REGISTERS, "setm", command_setm); + add_command_handler(proto, REGISTERS, "search", command_search); } #endif |