[qwaq] Get the locals view working

All because I forgot I went the unixy way for qdb_get_data.
This commit is contained in:
Bill Currie 2020-03-31 23:23:18 +09:00
parent beecdcadbf
commit c515d63d97
4 changed files with 11 additions and 8 deletions

View File

@ -121,6 +121,7 @@
{
qdb_state_t state = qdb_get_state (target);
[locals_data setFunction:state.func];
[locals_data fetchData];
[locals_view redraw];
}

View File

@ -17,6 +17,7 @@
}
+(LocalsData *)withTarget:(qdb_target_t)target;
-setFunction:(unsigned)fnum;
-fetchData;
@end
#endif

View File

@ -64,6 +64,12 @@
return self;
}
-fetchData
{
qdb_get_data (target, func.local_data, func.local_size, data);
return self;
}
-(int)numberOfRows:(TableView *)tableview
{
if (aux_func) {
@ -74,12 +80,6 @@
return 0;
}
-(qfot_type_t *)type:(qdb_def_t *)def
{
unsigned encoding = def.type_encoding + (unsigned) target_encodings.types;
return [TypeEncodings getType:encoding fromTarget:target];
}
-(View *)tableView:(TableView *)tableview
forColumn:(TableViewColumn *)column
row:(int)row
@ -89,7 +89,8 @@
if ([column name] == "name") {
view = [NameView withName:qdb_get_string (target, defs[row].name)];
} else {
qfot_type_t *type = [self type:&defs[row]];
qfot_type_t *type = [TypeEncodings getType:defs[row].type_encoding
fromTarget:target];
unsigned offset = defs[row].offset;
view = [DefView withType:type at:offset in:data];
}

View File

@ -80,7 +80,7 @@ static void type_free (void *t, void *unused)
string encoding;
qfot_type_t *type;
if (!qdb_get_data (target, typeAddr, TYPESIZE, &buffer)) {
if (qdb_get_data (target, typeAddr, TYPESIZE, &buffer) < 0) {
return nil;
}
if (!buffer.encoding) {