Skip to main content
summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorEugene Tarassov2015-09-04 20:16:52 -0400
committerEugene Tarassov2015-09-04 20:17:26 -0400
commita09de5830bf6bd180dc2709aaa41556a08f9a0ee (patch)
treecc9593163dd025b20d83955679c704de7164774a /server
parent1619e13e7d3e24ad9ee0484aca2066689a9055e4 (diff)
downloadorg.eclipse.tcf.agent-a09de5830bf6bd180dc2709aaa41556a08f9a0ee.tar.gz
org.eclipse.tcf.agent-a09de5830bf6bd180dc2709aaa41556a08f9a0ee.tar.xz
org.eclipse.tcf.agent-a09de5830bf6bd180dc2709aaa41556a08f9a0ee.zip
TCF Agent: added support for memory regions with zero size or address
Diffstat (limited to 'server')
-rw-r--r--server/tcf/services/context-proxy.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/server/tcf/services/context-proxy.c b/server/tcf/services/context-proxy.c
index 699637a4..fc562ee2 100644
--- a/server/tcf/services/context-proxy.c
+++ b/server/tcf/services/context-proxy.c
@@ -1355,9 +1355,22 @@ int context_read_reg(Context * ctx, RegisterDefinition * def, unsigned offs, uns
static void read_memory_region_property(InputStream * inp, const char * name, void * args) {
MemoryRegion * m = (MemoryRegion *)args;
- if (strcmp(name, "Addr") == 0) m->addr = (ContextAddress)json_read_uint64(inp);
- else if (strcmp(name, "Size") == 0) m->size = json_read_ulong(inp);
- else if (strcmp(name, "Offs") == 0) m->file_offs = json_read_ulong(inp);
+ if (strcmp(name, "Addr") == 0) {
+ m->addr = (ContextAddress)json_read_uint64(inp);
+ m->valid |= MM_VALID_ADDR;
+ }
+ else if (strcmp(name, "Size") == 0) {
+ m->size = json_read_ulong(inp);
+ m->valid |= MM_VALID_SIZE;
+ }
+ else if (strcmp(name, "Offs") == 0) {
+ m->file_offs = json_read_ulong(inp);
+ m->valid |= MM_VALID_FILE_OFFS;
+ }
+ else if (strcmp(name, "FileSize") == 0) {
+ m->file_size = json_read_ulong(inp);
+ m->valid |= MM_VALID_FILE_SIZE;
+ }
else if (strcmp(name, "BSS") == 0) m->bss = json_read_boolean(inp);
else if (strcmp(name, "Flags") == 0) m->flags = json_read_ulong(inp);
else if (strcmp(name, "FileName") == 0) m->file_name = json_read_alloc_string(inp);
@@ -1382,8 +1395,7 @@ static void read_memory_map_item(InputStream * inp, void * args) {
}
m = mem_buf + mem_buf_pos;
memset(m, 0, sizeof(MemoryRegion));
- if (json_read_struct(inp, read_memory_region_property, m) &&
- m->file_name != NULL && m->file_name[0] != 0) {
+ if (json_read_struct(inp, read_memory_region_property, m) && m->file_name != NULL && m->file_name[0] != 0) {
struct stat buf;
char * fnm = apply_path_map(cache->peer->host, cache->ctx, m->file_name, PATH_MAP_TO_LOCAL);
if (fnm != m->file_name) {

Back to the top