quakeforge/ruamoko/qwaq/debugger/views/doubleview.r
Bill Currie f50d27ec11 [qwaq] Show dereferenced data for poitner defs
The code currently assumes a single value is referenced rather than the
beginning of an array.
2021-06-04 13:35:53 +09:00

28 lines
596 B
R

#include <string.h>
#include "ruamoko/qwaq/debugger/views/doubleview.h"
@implementation DoubleView
-initWithDef:(qdb_def_t)def in:(void *)data type:(qfot_type_t *)type
{
if (!(self = [super initWithDef:def type:type])) {
return nil;
}
self.data = (double *)(data + def.offset);
return self;
}
+(DoubleView *)withDef:(qdb_def_t)def in:(void *)data type:(qfot_type_t *)type
{
return [[[self alloc] initWithDef:def in:data type:type] autorelease];
}
-draw
{
[super draw];
string val = sprintf ("%.17g", data[0]);
[self mvprintf:{0, 0}, "%*.*s", xlen, xlen, val];
return self;
}
@end