Hi Wolfgang,
We’re running into very similar issues debugging using lldb with the GNUstep
Android toolchain, which is using the modern (v2) ABI. Have you been able to
get any further with this?
The following lldb command seems to indicate that the root cause might be lldb
missing knowledge about the ObjC runtime. Could you check if you get the same
output for this?
(lldb) language objc class-table dump
error: current process has no Objective-C runtime loaded
Thanks,
Frederik
Am 18.06.2019 um 02:49 schrieb Wolfgang Lux <address@hidden>:
Hi all,
has anybody tips for how to debug GNUstep executables built with the
non-fragile ABI?
Gdb seems pretty useless with the non-fragile ABI because all instance variable
offsets appear to be 0 so it's impossible to inspect the contents of any
instances:
(gdb) print *self
$1 = {<> = {isa = 0x6074f8 <_OBJC_CLASS_Test>},
name = 0x6074f8 <_OBJC_CLASS_Test>, value = 0x6074f8 <_OBJC_CLASS_Test>,
parent = 0x6074f8 <_OBJC_CLASS_Test>, children = 0x6074f8 <_OBJC_CLASS_Test>}
I've also tried lldb, which at least understands the object layout:
(lldb) print *self
(Test) $0 = {
NSObject = {
isa = 0x00000000006074f8
}
name = 0x0000000000607588
value = 0x0000000000607588
parent = nil
children = 0x00000000007949b8
}
However, when I try to inspect any of the instance attributes I only get an
error message:
Error [IRForTarget]: Couldn't find Objective-C indirect ivar symbol
OBJC_IVAR_$_Test.name
error: The expression could not be prepared to run in the target
(lldb) print self->value
Error [IRForTarget]: Couldn't find Objective-C indirect ivar symbol
OBJC_IVAR_$_Test.value
error: The expression could not be prepared to run in the target
I've checked this on Ubuntu 18.04 with lldb 6.0 (and before any FreeBSD
advocates run in, it's exactly the same on FreeBSD 11.3 which comes with lldb
8.0)
All of this works fine on macOS:
(lldb) print *self
(Test) $0 = {
NSObject = {
isa = Test
}
name = 0x0000000100003118 @"$"
value = 0x0000000100003118 @"$"
parent = nil
children = 0x0000000100305910 2 key/value pairs
}
(lldb) print *self->name
(NSString) $1 = {
NSObject = {
isa = __NSCFConstantString
}
}
(lldb) print self->name
(__NSCFConstantString *) $2 = 0x0000000100003118 @"$"
Wolfgang