CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
150 lines
3.2 KiB
Plaintext
150 lines
3.2 KiB
Plaintext
#import <Foundation/Foundation.h>
|
|
|
|
// SourceBase will be the base class of Source. We'll pass a Source object into a
|
|
// function as a SourceBase, and then see if the dynamic typing can get us through the KVO
|
|
// goo and all the way back to Source.
|
|
|
|
@interface SourceBase: NSObject
|
|
{
|
|
uint32_t _value;
|
|
}
|
|
- (SourceBase *) init;
|
|
- (uint32_t) getValue;
|
|
@end
|
|
|
|
@implementation SourceBase
|
|
- (SourceBase *) init
|
|
{
|
|
[super init];
|
|
_value = 10;
|
|
return self;
|
|
}
|
|
- (uint32_t) getValue
|
|
{
|
|
return _value;
|
|
}
|
|
@end
|
|
|
|
// Source is a class that will be observed by the Observer class below.
|
|
// When Observer sets itself up to observe this property (in initWithASource)
|
|
// the KVO system will overwrite the "isa" pointer of the object with the "kvo'ed"
|
|
// one.
|
|
|
|
@interface Source : SourceBase
|
|
{
|
|
int _property;
|
|
}
|
|
- (Source *) init;
|
|
- (void) setProperty: (int) newValue;
|
|
@end
|
|
|
|
@implementation Source
|
|
- (Source *) init
|
|
{
|
|
[super init];
|
|
_property = 20;
|
|
return self;
|
|
}
|
|
- (void) setProperty: (int) newValue
|
|
{
|
|
_property = newValue; // This is the line in setProperty, make sure we step to here.
|
|
}
|
|
@end
|
|
|
|
@interface SourceDerived : Source
|
|
{
|
|
int _derivedValue;
|
|
}
|
|
- (SourceDerived *) init;
|
|
- (uint32_t) getValue;
|
|
@end
|
|
|
|
@implementation SourceDerived
|
|
- (SourceDerived *) init
|
|
{
|
|
[super init];
|
|
_derivedValue = 30;
|
|
return self;
|
|
}
|
|
- (uint32_t) getValue
|
|
{
|
|
return _derivedValue;
|
|
}
|
|
@end
|
|
|
|
// Observer is the object that will watch Source and cause KVO to swizzle it...
|
|
|
|
@interface Observer : NSObject
|
|
{
|
|
Source *_source;
|
|
}
|
|
+ (Observer *) observerWithSource: (Source *) source;
|
|
- (Observer *) initWithASource: (Source *) source;
|
|
- (void) observeValueForKeyPath: (NSString *) path
|
|
ofObject: (id) object
|
|
change: (NSDictionary *) change
|
|
context: (void *) context;
|
|
@end
|
|
|
|
@implementation Observer
|
|
|
|
+ (Observer *) observerWithSource: (Source *) inSource;
|
|
{
|
|
Observer *retval;
|
|
|
|
retval = [[Observer alloc] initWithASource: inSource];
|
|
return retval;
|
|
}
|
|
|
|
- (Observer *) initWithASource: (Source *) source
|
|
{
|
|
[super init];
|
|
_source = source;
|
|
[_source addObserver: self
|
|
forKeyPath: @"property"
|
|
options: (NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
|
|
context: NULL];
|
|
return self;
|
|
}
|
|
|
|
- (void) observeValueForKeyPath: (NSString *) path
|
|
ofObject: (id) object
|
|
change: (NSDictionary *) change
|
|
context: (void *) context
|
|
{
|
|
printf ("Observer function called.\n");
|
|
return;
|
|
}
|
|
@end
|
|
|
|
|
|
int patval; // external symbol, will not be completely stripped
|
|
int pat(int in) { // external symbol, will not be completely stripped
|
|
if (patval == 0)
|
|
patval = in;
|
|
return patval;
|
|
}
|
|
|
|
static int fooval; // static symbol, stripped
|
|
int foo() { // external symbol, will not be completely stripped
|
|
if (fooval == 0)
|
|
fooval = 5;
|
|
return fooval;
|
|
}
|
|
|
|
int bazval = 10; // external symbol, will not be completely stripped
|
|
int baz () { // external symbol, will not be completely stripped
|
|
return foo() + bazval;
|
|
}
|
|
|
|
static int barval = 15; // static symbol, stripped
|
|
static int bar () { // static symbol, stripped; __lldb_unnamed_symbol from func starts
|
|
return baz() + barval;
|
|
}
|
|
|
|
int calculate () // external symbol, will not be completely stripped
|
|
{
|
|
return bar();
|
|
}
|
|
|