Skip to content

Commit e72ceaa

Browse files
Using lldb's internal typedefs to avoid namespace collision
1. tid_t --> lldb::tid_t 2. offset_t --> lldb::ofset_t
1 parent aad27bf commit e72ceaa

File tree

19 files changed

+41
-41
lines changed

19 files changed

+41
-41
lines changed

lldb/source/API/SBBreakpoint.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ uint32_t SBBreakpoint::GetIgnoreCount() const {
342342
return count;
343343
}
344344

345-
void SBBreakpoint::SetThreadID(tid_t tid) {
345+
void SBBreakpoint::SetThreadID(lldb::tid_t tid) {
346346
LLDB_INSTRUMENT_VA(this, tid);
347347

348348
BreakpointSP bkpt_sp = GetSP();
@@ -353,10 +353,10 @@ void SBBreakpoint::SetThreadID(tid_t tid) {
353353
}
354354
}
355355

356-
tid_t SBBreakpoint::GetThreadID() {
356+
lldb::tid_t SBBreakpoint::GetThreadID() {
357357
LLDB_INSTRUMENT_VA(this);
358358

359-
tid_t tid = LLDB_INVALID_THREAD_ID;
359+
lldb::tid_t tid = LLDB_INVALID_THREAD_ID;
360360
BreakpointSP bkpt_sp = GetSP();
361361
if (bkpt_sp) {
362362
std::lock_guard<std::recursive_mutex> guard(

lldb/source/API/SBBreakpointLocation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ bool SBBreakpointLocation::GetCommandLineCommands(SBStringList &commands) {
302302
return has_commands;
303303
}
304304

305-
void SBBreakpointLocation::SetThreadID(tid_t thread_id) {
305+
void SBBreakpointLocation::SetThreadID(lldb::tid_t thread_id) {
306306
LLDB_INSTRUMENT_VA(this, thread_id);
307307

308308
BreakpointLocationSP loc_sp = GetSP();
@@ -313,10 +313,10 @@ void SBBreakpointLocation::SetThreadID(tid_t thread_id) {
313313
}
314314
}
315315

316-
tid_t SBBreakpointLocation::GetThreadID() {
316+
lldb::tid_t SBBreakpointLocation::GetThreadID() {
317317
LLDB_INSTRUMENT_VA(this);
318318

319-
tid_t tid = LLDB_INVALID_THREAD_ID;
319+
lldb::tid_t tid = LLDB_INVALID_THREAD_ID;
320320
BreakpointLocationSP loc_sp = GetSP();
321321
if (loc_sp) {
322322
std::lock_guard<std::recursive_mutex> guard(

lldb/source/API/SBBreakpointName.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ bool SBBreakpointName::GetAutoContinue() {
347347
return bp_name->GetOptions().IsAutoContinue();
348348
}
349349

350-
void SBBreakpointName::SetThreadID(tid_t tid) {
350+
void SBBreakpointName::SetThreadID(lldb::tid_t tid) {
351351
LLDB_INSTRUMENT_VA(this, tid);
352352

353353
BreakpointName *bp_name = GetBreakpointName();
@@ -361,7 +361,7 @@ void SBBreakpointName::SetThreadID(tid_t tid) {
361361
UpdateName(*bp_name);
362362
}
363363

364-
tid_t SBBreakpointName::GetThreadID() {
364+
lldb::tid_t SBBreakpointName::GetThreadID() {
365365
LLDB_INSTRUMENT_VA(this);
366366

367367
BreakpointName *bp_name = GetBreakpointName();

lldb/source/Expression/DWARFExpression.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static llvm::Error ReadRegisterValueAsScalar(RegisterContext *reg_ctx,
130130

131131
/// Return the length in bytes of the set of operands for \p op. No guarantees
132132
/// are made on the state of \p data after this call.
133-
static offset_t GetOpcodeDataSize(const DataExtractor &data,
133+
static lldb::offset_t GetOpcodeDataSize(const DataExtractor &data,
134134
const lldb::offset_t data_offset,
135135
const uint8_t op, const DWARFUnit *dwarf_cu) {
136136
lldb::offset_t offset = data_offset;
@@ -358,7 +358,7 @@ lldb::addr_t DWARFExpression::GetLocation_DW_OP_addr(const DWARFUnit *dwarf_cu,
358358
error = true;
359359
break;
360360
}
361-
const offset_t op_arg_size =
361+
const lldb::offset_t op_arg_size =
362362
GetOpcodeDataSize(m_data, offset, op, dwarf_cu);
363363
if (op_arg_size == LLDB_INVALID_OFFSET) {
364364
error = true;
@@ -418,7 +418,7 @@ bool DWARFExpression::Update_DW_OP_addr(const DWARFUnit *dwarf_cu,
418418
m_data.SetData(encoder.GetDataBuffer());
419419
return true;
420420
}
421-
const offset_t op_arg_size =
421+
const lldb::offset_t op_arg_size =
422422
GetOpcodeDataSize(m_data, offset, op, dwarf_cu);
423423
if (op_arg_size == LLDB_INVALID_OFFSET)
424424
break;
@@ -435,7 +435,7 @@ bool DWARFExpression::ContainsThreadLocalStorage(
435435

436436
if (op == DW_OP_form_tls_address || op == DW_OP_GNU_push_tls_address)
437437
return true;
438-
const offset_t op_arg_size =
438+
const lldb::offset_t op_arg_size =
439439
GetOpcodeDataSize(m_data, offset, op, dwarf_cu);
440440
if (op_arg_size == LLDB_INVALID_OFFSET)
441441
return false;
@@ -515,7 +515,7 @@ bool DWARFExpression::LinkThreadLocalStorage(
515515
}
516516

517517
if (!decoded_data) {
518-
const offset_t op_arg_size =
518+
const lldb::offset_t op_arg_size =
519519
GetOpcodeDataSize(m_data, offset, op, dwarf_cu);
520520
if (op_arg_size == LLDB_INVALID_OFFSET)
521521
return false;

lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ class ReturnValueExtractor {
641641

642642
DataExtractor de(&raw_data, sizeof(raw_data), m_byte_order, m_addr_size);
643643

644-
offset_t offset = 0;
644+
lldb::offset_t offset = 0;
645645
std::optional<uint64_t> byte_size = type.GetByteSize(m_process_sp.get());
646646
if (!byte_size)
647647
return {};

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) {
256256
if (process->ReadMemoryFromInferior (kernel_addresses_64[i], uval, 8, read_err) == 8)
257257
{
258258
DataExtractor data (&uval, 8, process->GetByteOrder(), process->GetAddressByteSize());
259-
offset_t offset = 0;
259+
lldb::offset_t offset = 0;
260260
uint64_t addr = data.GetU64 (&offset);
261261
if (CheckForKernelImageAtAddress(addr, process).IsValid()) {
262262
return addr;
@@ -270,7 +270,7 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) {
270270
if (process->ReadMemoryFromInferior (kernel_addresses_32[i], uval, 4, read_err) == 4)
271271
{
272272
DataExtractor data (&uval, 4, process->GetByteOrder(), process->GetAddressByteSize());
273-
offset_t offset = 0;
273+
lldb::offset_t offset = 0;
274274
uint32_t addr = data.GetU32 (&offset);
275275
if (CheckForKernelImageAtAddress(addr, process).IsValid()) {
276276
return addr;

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ DynamicLoaderDarwin::GetThreadLocalData(const lldb::ModuleSP module_sp,
11511151
// TLS data for the pthread_key on a specific thread yet. If we have we
11521152
// can re-use it since its location will not change unless the process
11531153
// execs.
1154-
const tid_t tid = thread_sp->GetID();
1154+
const lldb::tid_t tid = thread_sp->GetID();
11551155
auto tid_pos = m_tid_to_tls_map.find(tid);
11561156
if (tid_pos != m_tid_to_tls_map.end()) {
11571157
auto tls_pos = tid_pos->second.find(key);

lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ InstrumentationRuntimeMainThreadChecker::GetBacktracesFromExtendedStopInfo(
261261

262262
StructuredData::ObjectSP thread_id_obj =
263263
info->GetObjectForDotSeparatedPath("tid");
264-
tid_t tid = thread_id_obj ? thread_id_obj->GetUnsignedIntegerValue() : 0;
264+
lldb::tid_t tid = thread_id_obj ? thread_id_obj->GetUnsignedIntegerValue() : 0;
265265

266266
// We gather symbolication addresses above, so no need for HistoryThread to
267267
// try to infer the call addresses.

lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -770,13 +770,13 @@ std::string InstrumentationRuntimeTSan::GetLocationDescription(
770770
Sprintf("Location is a %ld-byte heap object at 0x%llx", size, addr);
771771
}
772772
} else if (type == "stack") {
773-
tid_t tid = loc->GetAsDictionary()
773+
lldb::tid_t tid = loc->GetAsDictionary()
774774
->GetValueForKey("thread_id")
775775
->GetUnsignedIntegerValue();
776776

777777
result = Sprintf("Location is stack of thread %d", tid);
778778
} else if (type == "tls") {
779-
tid_t tid = loc->GetAsDictionary()
779+
lldb::tid_t tid = loc->GetAsDictionary()
780780
->GetValueForKey("thread_id")
781781
->GetUnsignedIntegerValue();
782782

@@ -948,7 +948,7 @@ static std::string GenerateThreadName(const std::string &path,
948948
if (path == "mops") {
949949
size_t size =
950950
o->GetObjectForDotSeparatedPath("size")->GetUnsignedIntegerValue();
951-
tid_t thread_id =
951+
lldb::tid_t thread_id =
952952
o->GetObjectForDotSeparatedPath("thread_id")->GetUnsignedIntegerValue();
953953
bool is_write =
954954
o->GetObjectForDotSeparatedPath("is_write")->GetBooleanValue();
@@ -979,15 +979,15 @@ static std::string GenerateThreadName(const std::string &path,
979979
}
980980

981981
if (path == "threads") {
982-
tid_t thread_id =
982+
lldb::tid_t thread_id =
983983
o->GetObjectForDotSeparatedPath("thread_id")->GetUnsignedIntegerValue();
984984
result = Sprintf("Thread %zu created", thread_id);
985985
}
986986

987987
if (path == "locs") {
988988
std::string type = std::string(
989989
o->GetAsDictionary()->GetValueForKey("type")->GetStringValue());
990-
tid_t thread_id =
990+
lldb::tid_t thread_id =
991991
o->GetObjectForDotSeparatedPath("thread_id")->GetUnsignedIntegerValue();
992992
int fd = o->GetObjectForDotSeparatedPath("file_descriptor")
993993
->GetSignedIntegerValue();
@@ -1007,7 +1007,7 @@ static std::string GenerateThreadName(const std::string &path,
10071007
}
10081008

10091009
if (path == "stacks") {
1010-
tid_t thread_id =
1010+
lldb::tid_t thread_id =
10111011
o->GetObjectForDotSeparatedPath("thread_id")->GetUnsignedIntegerValue();
10121012
result = Sprintf("Thread %" PRIu64, thread_id);
10131013
}
@@ -1034,7 +1034,7 @@ static void AddThreadsForPath(const std::string &path,
10341034

10351035
StructuredData::ObjectSP thread_id_obj =
10361036
o->GetObjectForDotSeparatedPath("thread_os_id");
1037-
tid_t tid =
1037+
lldb::tid_t tid =
10381038
thread_id_obj ? thread_id_obj->GetUnsignedIntegerValue() : 0;
10391039

10401040
ThreadSP new_thread_sp =

lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ InstrumentationRuntimeUBSan::GetBacktracesFromExtendedStopInfo(
321321

322322
StructuredData::ObjectSP thread_id_obj =
323323
info->GetObjectForDotSeparatedPath("tid");
324-
tid_t tid = thread_id_obj ? thread_id_obj->GetUnsignedIntegerValue() : 0;
324+
lldb::tid_t tid = thread_id_obj ? thread_id_obj->GetUnsignedIntegerValue() : 0;
325325

326326
// We gather symbolication addresses above, so no need for HistoryThread to
327327
// try to infer the call addresses.

0 commit comments

Comments
 (0)