gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debugging on Linux with non-fragile ABI?


From: Wolfgang Lux
Subject: Debugging on Linux with non-fragile ABI?
Date: Thu, 18 Jul 2019 11:49:23 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]