host_platform_sp->GetDescription());
uint32_t idx;
- for (idx = 0; 1; ++idx) {
+ for (idx = 0; true; ++idx) {
const char *plugin_name =
PluginManager::GetPlatformPluginNameAtIndex(idx);
if (plugin_name == nullptr)
break;
case 'v':
- m_verbose = 1;
+ m_verbose = true;
break;
case 'A':
case 'e':
if (option_arg == "block") {
- m_end_line_is_block_end = 1;
+ m_end_line_is_block_end = true;
break;
}
if (option_arg.getAsInteger(0, m_end_line))
static bool DumpUInt(ExecutionContextScope *exe_scope, const Address &address,
uint32_t byte_size, Stream *strm) {
if (exe_scope == nullptr || byte_size == 0)
- return 0;
+ return false;
std::vector<uint8_t> buf(byte_size, 0);
if (ReadBytes(exe_scope, address, &buf[0], buf.size()) == buf.size()) {
match_info_ptr->GetNameMatchType(),
match_info_ptr->GetProcessInfo().GetName())) {
// Skip NULLs
- while (1) {
+ while (true) {
const uint8_t *p = data.PeekData(offset, 1);
if ((p == NULL) || (*p != '\0'))
break;
std::unique_lock<std::mutex> lock;
OptionParser::Prepare(lock);
int val;
- while (1) {
+ while (true) {
int long_options_index = -1;
val = OptionParser::Parse(argv.size(), &*argv.begin(), sstr.GetString(),
long_options, &long_options_index);
bool failed_once = false;
uint32_t dash_dash_pos = -1;
- while (1) {
+ while (true) {
bool missing_argument = false;
int long_options_index = -1;
std::unique_lock<std::mutex> lock;
OptionParser::Prepare(lock);
int val;
- while (1) {
+ while (true) {
int long_options_index = -1;
val = OptionParser::Parse(argv.size(), &*argv.begin(), sstr.GetString(),
long_options, &long_options_index);
uint32_t integer_bytes = 0;
// True if return values are in FP return registers.
- bool use_fp_regs = 0;
+ bool use_fp_regs = false;
// True if we found any non floating point field in structure.
- bool found_non_fp_field = 0;
+ bool found_non_fp_field = false;
// True if return values are in r2 register.
- bool use_r2 = 0;
+ bool use_r2 = false;
// True if return values are in r3 register.
- bool use_r3 = 0;
+ bool use_r3 = false;
// True if the result is copied into our data buffer
- bool sucess = 0;
+ bool sucess = false;
std::string name;
bool is_complex;
uint32_t count;
nullptr, nullptr);
if (field_compiler_type.IsFloatingPointType(count, is_complex))
- use_fp_regs = 1;
+ use_fp_regs = true;
else
- found_non_fp_field = 1;
+ found_non_fp_field = true;
}
if (use_fp_regs && !found_non_fp_field) {
// structure
integer_bytes = integer_bytes + *field_byte_width +
padding; // Increase the consumed bytes.
- use_r2 = 1;
+ use_r2 = true;
} else {
// There isn't enough space left in r2 for this field, so this
// will be in r3.
integer_bytes = integer_bytes + *field_byte_width +
padding; // Increase the consumed bytes.
- use_r3 = 1;
+ use_r3 = true;
}
}
// We already have consumed at-least 8 bytes that means r2 is done,
// and this field will be in r3. Check if this field can fit in r3.
else if (integer_bytes + *field_byte_width + padding <= 16) {
integer_bytes = integer_bytes + *field_byte_width + padding;
- use_r3 = 1;
+ use_r3 = true;
} else {
// There isn't any space left for this field, this should not
// happen as we have already checked the overall size is not
// Vector types up to 16 bytes are returned in GP return registers
if (type_flags & eTypeIsVector) {
if (*byte_size <= 8)
- use_r2 = 1;
+ use_r2 = true;
else {
- use_r2 = 1;
- use_r3 = 1;
+ use_r2 = true;
+ use_r3 = true;
}
}
error);
if (bytes_copied != r2_info->byte_size)
return return_valobj_sp;
- sucess = 1;
+ sucess = true;
}
if (use_r3) {
reg_ctx->ReadRegister(r3_info, r3_value);
if (bytes_copied != r3_info->byte_size)
return return_valobj_sp;
- sucess = 1;
+ sucess = true;
}
if (sucess) {
// The result is in our data buffer. Create a variable object out of
break;
last_expr = implicit_cast->getSubExpr();
- } while (0);
+ } while (false);
// is_lvalue is used to record whether the expression returns an assignable
// Lvalue or an Rvalue. This is relevant because they are handled
break;
sources.push_back(runtime_decl_vendor->GetImporterSource());
- } while (0);
+ } while (false);
do {
DeclVendor *modules_decl_vendor =
break;
sources.push_back(modules_decl_vendor->GetImporterSource());
- } while (0);
+ } while (false);
if (!is_shared_context) {
// Update the scratch AST context's merger to reflect any new sources we
sources.push_back({*scratch_ast_context->getASTContext(),
*scratch_ast_context->getFileManager(),
scratch_ast_context->GetOriginMap()});
- } while (0);
+ }
+ while (false)
+ ;
m_merger_up =
llvm::make_unique<clang::ExternalASTMerger>(target, sources);
context.m_found.type = true;
}
}
- } while (0);
+ } while (false);
}
if (!context.m_found.type) {
}
context.AddNamedDecl(copied_named_decl);
- } while (0);
+ } while (false);
}
- } while (0);
+ } while (false);
}
template <class D> class TaggedASTDecl {
if (FindObjCMethodDeclsWithOrigin(current_id, context,
original_interface_decl, "at origin"))
return; // found it, no need to look any further
- } while (0);
+ } while (false);
StreamString ss;
if (*cursor == ' ' || *cursor == '(')
sc_list.Append(candidate_sc);
}
- } while (0);
+ } while (false);
if (sc_list.GetSize()) {
// We found a good function symbol. Use that.
"in debug info");
return;
- } while (0);
+ } while (false);
do {
// Check the modules only if the debug information didn't have a complete
current_id, context, interface_decl_from_modules, "in modules"))
return;
}
- } while (0);
+ } while (false);
do {
// Check the runtime only if the debug information didn't have a complete
FindObjCMethodDeclsWithOrigin(current_id, context, runtime_interface_decl,
"in runtime");
- } while (0);
+ } while (false);
}
static bool FindObjCPropertyAndIvarDeclsWithOrigin(
complete_iface_decl);
return;
- } while (0);
+ } while (false);
do {
// Check the modules only if the debug information didn't have a complete
if (FindObjCPropertyAndIvarDeclsWithOrigin(current_id, context, *this,
interface_decl_from_modules))
return;
- } while (0);
+ } while (false);
do {
// Check the runtime only if the debug information didn't have a complete
if (FindObjCPropertyAndIvarDeclsWithOrigin(
current_id, context, *this, interface_decl_from_runtime))
return;
- } while (0);
+ } while (false);
}
typedef llvm::DenseMap<const FieldDecl *, uint64_t> FieldOffsetMap;
name.GetCString());
context.AddNamedDecl(parser_named_decl);
- } while (0);
+ } while (false);
}
if (name.GetCString()[0] == '$' && !namespace_decl) {
context.m_found.variable = true;
}
}
- } while (0);
+ } while (false);
}
if (target && !context.m_found.variable && !namespace_decl) {
if (sub_op) {
operand2 = NOT(operand2);
- carry_in = 1;
+ carry_in = true;
imm = -imm; // For the Register plug offset context below
} else {
- carry_in = 0;
+ carry_in = false;
}
ProcState proc_state;
std::unique_ptr<class_rw_t> class_rw;
if (!Read_objc_class(process, objc_class))
- return 0;
+ return false;
if (!Read_class_row(process, *objc_class, class_ro, class_rw))
- return 0;
+ return false;
static ConstString NSObject_name("NSObject");
non_const_interface_decl->lookup(name);
return (result.size() != 0);
- } while (0);
+ } while (false);
SetNoExternalVisibleDeclsForName(decl_ctx, name);
return false;
uint32_t stepsLeft = 256;
- while (1) {
+ while (true) {
if (--stepsLeft == 0) {
m_is_valid = false;
return;
decls.push_back(iface_decl);
ret++;
break;
- } while (0);
+ } while (false);
return ret;
}
triple.setEnvironmentName(os_env.environment);
return arch;
}
- } while (0);
+ } while (false);
offset = cmd_offset + load_cmd.cmdsize;
}
for (uint32_t i = 0; i < num_retries; ++i) {
if (SendRequestPacketNoLock(request_packet)) {
const uint8_t request_sequence_id = (uint8_t)request_packet.GetData()[1];
- while (1) {
+ while (true) {
if (WaitForPacketWithTimeoutMicroSecondsNoLock(
reply_packet,
std::chrono::microseconds(GetPacketTimeout()).count())) {
DelayedPropertyList &delayed_properties, AccessType &default_accessibility,
bool &is_a_class, ClangASTImporter::LayoutInfo &layout_info) {
if (!parent_die)
- return 0;
+ return false;
// Get the parent byte size so we can verify any members will fit
const uint64_t parent_byte_size =
ClangASTContext *ast =
llvm::dyn_cast_or_null<ClangASTContext>(class_clang_type.GetTypeSystem());
if (ast == nullptr)
- return 0;
+ return false;
for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid();
die = die.GetSibling()) {
if (die.Tag() == DW_TAG_inlined_subroutine) {
inlined_die = die;
- while (1) {
+ while (true) {
die = die.GetParent();
if (die) {
clang::DeclContext *lhs_decl_ctx = lhs_decl->getDeclContext();
clang::DeclContext *rhs_decl_ctx = rhs_decl->getDeclContext();
if (lhs_decl_ctx && rhs_decl_ctx) {
- while (1) {
+ while (true) {
if (lhs_decl_ctx && rhs_decl_ctx) {
const clang::Decl::Kind lhs_decl_ctx_kind =
lhs_decl_ctx->getDeclKind();
// make sure the names match as well
lhs_decl_ctx = lhs_decl->getDeclContext();
rhs_decl_ctx = rhs_decl->getDeclContext();
- while (1) {
+ while (true) {
switch (lhs_decl_ctx->getDeclKind()) {
case clang::Decl::TranslationUnit:
// We don't care about the translation unit names
break;
}
}
- return 0;
+ return false;
}
void ClangASTContext::DumpSummary(lldb::opaque_compiler_type_t type,
to_objc_interface->setSuperClass(m_source_ctx->getTrivialTypeSourceInfo(
m_source_ctx->getObjCInterfaceType(imported_from_superclass)));
- } while (0);
+ } while (false);
}
}
CompilerType *function_pointer_type_ptr) const {
if (IsValid())
return m_type_system->IsBlockPointerType(m_type, function_pointer_type_ptr);
- return 0;
+ return false;
}
bool CompilerType::IsIntegerType(bool &is_signed) const {
// Now calculate the offset to pass the subsequent line 0 entries.
uint32_t first_non_zero_line = prologue_end_line_idx;
- while (1) {
+ while (true) {
LineEntry line_entry;
if (line_table->GetLineEntryAtIndex(first_non_zero_line,
line_entry)) {
uint32_t line_index = 0;
bool found = false;
- while (1) {
+ while (true) {
LineEntry this_line;
line_index = comp_unit->FindLineEntry(line_index, line_entry.line, nullptr,
false, &this_line);
event_explanation = ts.GetData();
}
- } while (0);
+ } while (false);
if (event_explanation)
log->Printf("Process::RunThreadPlan(): execution interrupted: %s %s",
out_str.clear();
addr_t curr_addr = addr.GetLoadAddress(this);
Address address(addr);
- while (1) {
+ while (true) {
size_t length = ReadCStringFromMemory(address, buf, sizeof(buf), error);
if (length == 0)
break;
// Otherwise, don't let the base plan override what the other plans say
// to do, since presumably if there were other plans they would know what
// to do...
- while (1) {
+ while (true) {
if (PlanIsBasePlan(current_plan))
break;
} else {
Vote thread_vote = eVoteNoOpinion;
ThreadPlan *plan_ptr = GetCurrentPlan();
- while (1) {
+ while (true) {
if (plan_ptr->PlanExplainsStop(event_ptr)) {
thread_vote = plan_ptr->ShouldReportStop(event_ptr);
break;
return;
}
- while (1) {
+ while (true) {
int master_plan_idx;
bool discard = true;
// FIXME: ValueObject::Cast doesn't currently work correctly, at least not
// for scalars.
// Turn that back on when that works.
- if (/* DISABLES CODE */ (0) && sc.function != nullptr) {
+ if (/* DISABLES CODE */ (false) && sc.function != nullptr) {
Type *function_type = sc.function->GetType();
if (function_type) {
CompilerType return_type =
break;
case '"': {
- while (1) {
+ while (true) {
bool was_escaped = false;
int escaped_ch = GetEscapedChar(was_escaped);
if (escaped_ch == -1) {
std::string value;
std::string key;
- while (1) {
+ while (true) {
JSONParser::Token token = GetToken(value);
if (token == JSONParser::Token::String) {
std::string value;
std::string key;
- while (1) {
+ while (true) {
JSONValue::SP value_sp = ParseJSONValue();
if (value_sp)
array_up->AppendObject(value_sp);
struct timeval *tv_ptr = nullptr;
struct timeval tv = {0, 0};
- while (1) {
+ while (true) {
using namespace std::chrono;
// Setup out relative timeout based on the end time if we have one
if (m_end_time.hasValue()) {
std::string value;
std::string key;
- while (1) {
+ while (true) {
JSONParser::Token token = json_parser.GetToken(value);
if (token == JSONParser::Token::String) {
std::string value;
std::string key;
- while (1) {
+ while (true) {
StructuredData::ObjectSP value_sp = ParseJSONValue(json_parser);
if (value_sp)
array_up->AddItem(value_sp);
#endif
struct kevent death_event;
- while (1) {
+ while (true) {
int n_events = kevent(kq_id, NULL, 0, &death_event, 1, NULL);
if (n_events == -1) {
if (errno == EINTR)
#endif
#endif
- while (1) {
+ while (true) {
pid_t child_pid = waitpid(pid, &status, 0);
DNBLogThreadedIf(LOG_PROCESS, "waitpid_thread (): waitpid (pid = %i, "
"&status, 0) => %i, status = %i, errno = %i",
break;
case '"': {
- while (1) {
+ while (true) {
bool was_escaped = false;
int escaped_ch = GetEscapedChar(was_escaped);
if (escaped_ch == -1) {
std::string value;
std::string key;
- while (1) {
+ while (true) {
JSONParser::Token token = GetToken(value);
if (token == JSONParser::Token::String) {
std::string value;
std::string key;
- while (1) {
+ while (true) {
JSONValue::SP value_sp = ParseJSONValue();
if (value_sp)
array_up->AppendObject(value_sp);
MachThreadSP thread_sp(GetThreadByID(tid));
if (thread_sp)
return thread_sp->RestoreRegisterState(save_id);
- return 0;
+ return false;
}
nub_size_t MachThreadList::NumThreads() const {
}
if (interval_usec == 0) {
- enable = 0;
+ enable = false;
}
DNBProcessSetEnableAsyncProfiling(pid, enable, interval_usec, scan_type);
while (*c != '\0' &&
(*c == ' ' || *c == '\t' || *c == '\n' || *c == '\r'))
c++;
- while (1) {
+ while (true) {
if (!isdigit(*c)) {
return true;
}
cstr = data.GetCStr(&offset);
if (cstr) {
// Skip NULLs
- while (1) {
+ while (true) {
const char *p = data.PeekCStr(offset);
if ((p == NULL) || (*p != '\0'))
break;
RNBContext::event_read_thread_exiting;
// Spin waiting to get the A packet.
- while (1) {
+ while (true) {
DNBLogThreadedIf(LOG_RNB_MAX,
"%s ctx.Events().WaitForSetEvents( 0x%08x ) ...",
__FUNCTION__, event_mask);
uint32_t event_mask = RNBContext::event_read_packet_available;
// Spin waiting to get the A packet.
- while (1) {
+ while (true) {
DNBLogThreadedIf(LOG_RNB_MAX,
"%s ctx.Events().WaitForSetEvents( 0x%08x ) ...",
__FUNCTION__, event_mask);