@@ -576,19 +576,19 @@ def dump_stack_history_entries(options, result, addr, history):
576
576
unsigned idx;
577
577
malloc_stack_entry entries[MAX_HISTORY];
578
578
} $malloc_stack_history;
579
- $malloc_stack_history info = { (task_t)mach_task_self(), 0 };
579
+ $malloc_stack_history lldb_info = { (task_t)mach_task_self(), 0 };
580
580
uint32_t max_stack_frames = MAX_FRAMES;
581
581
enumerate_callback_t callback = [] (mach_stack_logging_record_t stack_record, void *baton) -> void {
582
- $malloc_stack_history *info = ($malloc_stack_history *)baton;
583
- if (info ->idx < MAX_HISTORY) {
584
- malloc_stack_entry *stack_entry = &(info ->entries[info ->idx]);
582
+ $malloc_stack_history *lldb_info = ($malloc_stack_history *)baton;
583
+ if (lldb_info ->idx < MAX_HISTORY) {
584
+ malloc_stack_entry *stack_entry = &(lldb_info ->entries[lldb_info ->idx]);
585
585
stack_entry->address = stack_record.address;
586
586
stack_entry->type_flags = stack_record.type_flags;
587
587
stack_entry->argument = stack_record.argument;
588
588
stack_entry->num_frames = 0;
589
589
stack_entry->frames[0] = 0;
590
590
stack_entry->frames_err = (kern_return_t)__mach_stack_logging_frames_for_uniqued_stack (
591
- info ->task,
591
+ lldb_info ->task,
592
592
stack_record.stack_identifier,
593
593
stack_entry->frames,
594
594
(uint32_t)MAX_FRAMES,
@@ -597,10 +597,10 @@ def dump_stack_history_entries(options, result, addr, history):
597
597
if (stack_entry->num_frames < MAX_FRAMES)
598
598
stack_entry->frames[stack_entry->num_frames] = 0;
599
599
}
600
- ++info ->idx;
600
+ ++lldb_info ->idx;
601
601
};
602
- (kern_return_t)__mach_stack_logging_enumerate_records (info .task, (uint64_t)0x%x, callback, &info );
603
- info ''' % (options .max_frames , options .max_history , addr )
602
+ (kern_return_t)__mach_stack_logging_enumerate_records (lldb_info .task, (uint64_t)0x%x, callback, &lldb_info );
603
+ lldb_info ''' % (options .max_frames , options .max_history , addr )
604
604
605
605
frame = lldb .debugger .GetSelectedTarget ().GetProcess (
606
606
).GetSelectedThread ().GetSelectedFrame ()
@@ -924,18 +924,18 @@ def ptr_refs(debugger, command, result, dict):
924
924
void *ptr;
925
925
} callback_baton_t;
926
926
range_callback_t range_callback = [](task_t task, void *baton, unsigned type, uintptr_t ptr_addr, uintptr_t ptr_size) -> void {
927
- callback_baton_t *info = (callback_baton_t *)baton;
927
+ callback_baton_t *lldb_info = (callback_baton_t *)baton;
928
928
typedef void* T;
929
929
const unsigned size = sizeof(T);
930
930
T *array = (T*)ptr_addr;
931
931
for (unsigned idx = 0; ((idx + 1) * sizeof(T)) <= ptr_size; ++idx) {
932
- if (array[idx] == info ->ptr) {
933
- if (info ->num_matches < MAX_MATCHES) {
934
- info ->matches[info ->num_matches].addr = (void*)ptr_addr;
935
- info ->matches[info ->num_matches].size = ptr_size;
936
- info ->matches[info ->num_matches].offset = idx*sizeof(T);
937
- info ->matches[info ->num_matches].type = type;
938
- ++info ->num_matches;
932
+ if (array[idx] == lldb_info ->ptr) {
933
+ if (lldb_info ->num_matches < MAX_MATCHES) {
934
+ lldb_info ->matches[lldb_info ->num_matches].addr = (void*)ptr_addr;
935
+ lldb_info ->matches[lldb_info ->num_matches].size = ptr_size;
936
+ lldb_info ->matches[lldb_info ->num_matches].offset = idx*sizeof(T);
937
+ lldb_info ->matches[lldb_info ->num_matches].type = type;
938
+ ++lldb_info ->num_matches;
939
939
}
940
940
}
941
941
}
@@ -1033,18 +1033,18 @@ def cstr_refs(debugger, command, result, dict):
1033
1033
unsigned cstr_len;
1034
1034
} callback_baton_t;
1035
1035
range_callback_t range_callback = [](task_t task, void *baton, unsigned type, uintptr_t ptr_addr, uintptr_t ptr_size) -> void {
1036
- callback_baton_t *info = (callback_baton_t *)baton;
1037
- if (info ->cstr_len < ptr_size) {
1036
+ callback_baton_t *lldb_info = (callback_baton_t *)baton;
1037
+ if (lldb_info ->cstr_len < ptr_size) {
1038
1038
const char *begin = (const char *)ptr_addr;
1039
1039
const char *end = begin + ptr_size - info->cstr_len;
1040
1040
for (const char *s = begin; s < end; ++s) {
1041
- if ((int)memcmp(s, info ->cstr, info ->cstr_len) == 0) {
1042
- if (info ->num_matches < MAX_MATCHES) {
1043
- info ->matches[info ->num_matches].addr = (void*)ptr_addr;
1044
- info ->matches[info ->num_matches].size = ptr_size;
1045
- info ->matches[info ->num_matches].offset = s - begin;
1046
- info ->matches[info ->num_matches].type = type;
1047
- ++info ->num_matches;
1041
+ if ((int)memcmp(s, lldb_info ->cstr, lldb_info ->cstr_len) == 0) {
1042
+ if (lldb_info ->num_matches < MAX_MATCHES) {
1043
+ lldb_info ->matches[lldb_info ->num_matches].addr = (void*)ptr_addr;
1044
+ lldb_info ->matches[lldb_info ->num_matches].size = ptr_size;
1045
+ lldb_info ->matches[lldb_info ->num_matches].offset = s - begin;
1046
+ lldb_info ->matches[lldb_info ->num_matches].type = type;
1047
+ ++lldb_info ->num_matches;
1048
1048
}
1049
1049
}
1050
1050
}
@@ -1135,17 +1135,17 @@ def malloc_info_impl(debugger, result, options, args):
1135
1135
void *ptr;
1136
1136
} callback_baton_t;
1137
1137
range_callback_t range_callback = [](task_t task, void *baton, unsigned type, uintptr_t ptr_addr, uintptr_t ptr_size) -> void {
1138
- callback_baton_t *info = (callback_baton_t *)baton;
1139
- if (info ->num_matches == 0) {
1140
- uint8_t *p = (uint8_t *)info ->ptr;
1138
+ callback_baton_t *lldb_info = (callback_baton_t *)baton;
1139
+ if (lldb_info ->num_matches == 0) {
1140
+ uint8_t *p = (uint8_t *)lldb_info ->ptr;
1141
1141
uint8_t *lo = (uint8_t *)ptr_addr;
1142
1142
uint8_t *hi = lo + ptr_size;
1143
1143
if (lo <= p && p < hi) {
1144
- info ->matches[info ->num_matches].addr = (void*)ptr_addr;
1145
- info ->matches[info ->num_matches].size = ptr_size;
1146
- info ->matches[info ->num_matches].offset = p - lo;
1147
- info ->matches[info ->num_matches].type = type;
1148
- info ->num_matches = 1;
1144
+ lldb_info ->matches[lldb_info ->num_matches].addr = (void*)ptr_addr;
1145
+ lldb_info ->matches[lldb_info ->num_matches].size = ptr_size;
1146
+ lldb_info ->matches[lldb_info ->num_matches].offset = p - lo;
1147
+ lldb_info ->matches[lldb_info ->num_matches].type = type;
1148
+ lldb_info ->num_matches = 1;
1149
1149
}
1150
1150
}
1151
1151
};
@@ -1397,24 +1397,24 @@ def objc_refs(debugger, command, result, dict):
1397
1397
typedef Class (*class_getSuperclass_type)(void *isa);
1398
1398
range_callback_t range_callback = [](task_t task, void *baton, unsigned type, uintptr_t ptr_addr, uintptr_t ptr_size) -> void {
1399
1399
class_getSuperclass_type class_getSuperclass_impl = (class_getSuperclass_type)class_getSuperclass;
1400
- callback_baton_t *info = (callback_baton_t *)baton;
1400
+ callback_baton_t *lldb_info = (callback_baton_t *)baton;
1401
1401
if (sizeof(Class) <= ptr_size) {
1402
1402
Class *curr_class_ptr = (Class *)ptr_addr;
1403
1403
Class *matching_class_ptr = (Class *)bsearch (curr_class_ptr,
1404
- (const void *)info ->classes,
1405
- sizeof(info ->classes)/sizeof(Class),
1404
+ (const void *)lldb_info ->classes,
1405
+ sizeof(lldb_info ->classes)/sizeof(Class),
1406
1406
sizeof(Class),
1407
- info ->compare_callback);
1407
+ lldb_info ->compare_callback);
1408
1408
if (matching_class_ptr) {
1409
1409
bool match = false;
1410
- if (info ->isa) {
1410
+ if (lldb_info ->isa) {
1411
1411
Class isa = *curr_class_ptr;
1412
- if (info ->isa == isa)
1412
+ if (lldb_info ->isa == isa)
1413
1413
match = true;
1414
- else { // if (info ->objc.match_superclasses) {
1414
+ else { // if (lldb_info ->objc.match_superclasses) {
1415
1415
Class super = class_getSuperclass_impl(isa);
1416
1416
while (super) {
1417
- if (super == info ->isa) {
1417
+ if (super == lldb_info ->isa) {
1418
1418
match = true;
1419
1419
break;
1420
1420
}
@@ -1425,12 +1425,12 @@ def objc_refs(debugger, command, result, dict):
1425
1425
else
1426
1426
match = true;
1427
1427
if (match) {
1428
- if (info ->num_matches < MAX_MATCHES) {
1429
- info ->matches[info ->num_matches].addr = (void*)ptr_addr;
1430
- info ->matches[info ->num_matches].size = ptr_size;
1431
- info ->matches[info ->num_matches].offset = 0;
1432
- info ->matches[info ->num_matches].type = type;
1433
- ++info ->num_matches;
1428
+ if (lldb_info ->num_matches < MAX_MATCHES) {
1429
+ lldb_info ->matches[lldb_info ->num_matches].addr = (void*)ptr_addr;
1430
+ lldb_info ->matches[lldb_info ->num_matches].size = ptr_size;
1431
+ lldb_info ->matches[lldb_info ->num_matches].offset = 0;
1432
+ lldb_info ->matches[lldb_info ->num_matches].type = type;
1433
+ ++lldb_info ->num_matches;
1434
1434
}
1435
1435
}
1436
1436
}
0 commit comments