mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[qwaq] Pass debug target into the def views
Needed for any views that have to fetch additional data (strings, fields, etc).
This commit is contained in:
parent
c515d63d97
commit
bd7212a411
5 changed files with 25 additions and 7 deletions
|
@ -3,12 +3,17 @@
|
|||
|
||||
#include <types.h>
|
||||
#include "ui/view.h"
|
||||
#include "debugger/debug.h"
|
||||
|
||||
@interface DefView : View
|
||||
{
|
||||
qfot_type_t *type;
|
||||
qdb_target_t target;
|
||||
}
|
||||
+(DefView *)withType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data;
|
||||
+(DefView *)withType:(qfot_type_t *)type
|
||||
at:(unsigned)offset
|
||||
in:(void *)data
|
||||
target:(qdb_target_t)target;
|
||||
-initWithType:(qfot_type_t *)type;
|
||||
@end
|
||||
|
||||
|
|
|
@ -31,10 +31,23 @@ static string meta_views[] = {
|
|||
return self;
|
||||
}
|
||||
|
||||
-setTarget:(qdb_target_t)target
|
||||
{
|
||||
self.target = target;
|
||||
return self;
|
||||
}
|
||||
|
||||
+(DefView *)withType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data
|
||||
{
|
||||
return [self withType:type at:offset in:data target:nil];
|
||||
}
|
||||
|
||||
+(DefView *)withType:(qfot_type_t *)type
|
||||
at:(unsigned)offset
|
||||
in:(void *)data
|
||||
target:(qdb_target_t)target
|
||||
{
|
||||
string metaname = nil;
|
||||
//printf("%d %d %d %d\n", type.meta, type.size, type.encoding, type.type);
|
||||
if (type.meta == ty_alias) {
|
||||
type = type.alias.aux_type;
|
||||
}
|
||||
|
@ -44,7 +57,7 @@ static string meta_views[] = {
|
|||
}
|
||||
id class = obj_lookup_class (metaname);
|
||||
if (class) {
|
||||
return [class withType:type at:offset in:data];
|
||||
return [[class withType:type at:offset in:data] setTarget:target];
|
||||
}
|
||||
return [NameView withName:"Invalid Meta"];
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
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 = [DefView withType:type at:offset in:data target:target];
|
||||
}
|
||||
[view resizeTo:{[column width], 1}];
|
||||
return view;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
@interface StringView : DefView
|
||||
{
|
||||
string *data;
|
||||
int *data;
|
||||
}
|
||||
+(StringView *)withType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data;
|
||||
@end
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
if (!(self = [super initWithType:type])) {
|
||||
return nil;
|
||||
}
|
||||
self.data = (string *)(data + offset);
|
||||
self.data = (int *)(data + offset);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
-draw
|
||||
{
|
||||
[super draw];
|
||||
string val = sprintf ("FIXME %s", data[0]);// quote string
|
||||
string val = sprintf ("FIXME %s", qdb_get_string (target, data[0]));// quote string
|
||||
[self mvaddstr:{0, 0}, str_mid (val, 0, xlen)];
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue