2020-03-31 11:48:38 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include "debugger/stringview.h"
|
|
|
|
|
|
|
|
@implementation StringView
|
|
|
|
|
|
|
|
-initWithType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data
|
|
|
|
{
|
|
|
|
if (!(self = [super initWithType:type])) {
|
|
|
|
return nil;
|
|
|
|
}
|
2020-03-31 15:03:53 +00:00
|
|
|
self.data = (int *)(data + offset);
|
2020-03-31 11:48:38 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
+(StringView *)withType:(qfot_type_t *)type at:(unsigned)offset in:(void *)data
|
|
|
|
{
|
|
|
|
return [[[self alloc] initWithType:type at:offset in:data] autorelease];
|
|
|
|
}
|
|
|
|
|
|
|
|
-draw
|
|
|
|
{
|
|
|
|
[super draw];
|
2020-03-31 15:03:53 +00:00
|
|
|
string val = sprintf ("FIXME %s", qdb_get_string (target, data[0]));// quote string
|
2020-04-01 10:57:24 +00:00
|
|
|
[self mvprintf:{0, 0}, "%*.*s", xlen, xlen, val];
|
2020-03-31 11:48:38 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|