diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-02 03:51:35 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-02 03:51:35 +0000 |
commit | a10caefe11d4a3120d5048e2ac7d92d782f67e96 (patch) | |
tree | 395a6f23df70eb01ab288ec07c8233d230bd6c6e /source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp | |
parent | e06f7d9006acc873682fb49bad22133e8ff40de5 (diff) |
sanitise sign comparisons
This is a mechanical change addressing the various sign comparison warnings that
are identified by both clang and gcc. This helps cleanup some of the warning
spew that occurs during builds.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@205390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp')
-rw-r--r-- | source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp index 1768798f7..ff7f758cf 100644 --- a/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -479,7 +479,8 @@ AssemblyParse_x86::instruction_length (Address addr, int &length) const bool prefer_file_cache = true; Error error; Target *target = m_exe_ctx.GetTargetPtr(); - if (target->ReadMemory (addr, prefer_file_cache, opcode_data.data(), max_op_byte_size, error) == -1) + if (target->ReadMemory (addr, prefer_file_cache, opcode_data.data(), + max_op_byte_size, error) == static_cast<size_t>(-1)) { return false; } @@ -552,7 +553,8 @@ AssemblyParse_x86::get_non_call_site_unwind_plan (UnwindPlan &unwind_plan) // An unrecognized/junk instruction break; } - if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, insn_len, error) == -1) + if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, + insn_len, error) == static_cast<size_t>(-1)) { // Error reading the instruction out of the file, stop scanning break; @@ -600,7 +602,7 @@ AssemblyParse_x86::get_non_call_site_unwind_plan (UnwindPlan &unwind_plan) bool need_to_push_row = false; // the PUSH instruction has moved the stack pointer - if the CFA is set in terms of the stack pointer, // we need to add a new row of instructions. - if (row->GetCFARegister() == m_lldb_sp_regnum) + if (row->GetCFARegister() == static_cast<uint32_t>(m_lldb_sp_regnum)) { need_to_push_row = true; row->SetCFAOffset (current_sp_bytes_offset_from_cfa); @@ -645,7 +647,7 @@ AssemblyParse_x86::get_non_call_site_unwind_plan (UnwindPlan &unwind_plan) if (sub_rsp_pattern_p (stack_offset)) { current_sp_bytes_offset_from_cfa += stack_offset; - if (row->GetCFARegister() == m_lldb_sp_regnum) + if (row->GetCFARegister() == static_cast<uint32_t>(m_lldb_sp_regnum)) { row->SetOffset (current_func_text_offset + insn_len); row->SetCFAOffset (current_sp_bytes_offset_from_cfa); @@ -699,7 +701,8 @@ loopnext: uint8_t bytebuf[7]; Address last_seven_bytes(end_of_fun); last_seven_bytes.SetOffset (last_seven_bytes.GetOffset() - 7); - if (target->ReadMemory (last_seven_bytes, prefer_file_cache, bytebuf, 7, error) != -1) + if (target->ReadMemory (last_seven_bytes, prefer_file_cache, bytebuf, 7, + error) != static_cast<size_t>(-1)) { if (bytebuf[5] == 0x5d && bytebuf[6] == 0xc3) // mov, ret { @@ -715,7 +718,8 @@ loopnext: uint8_t bytebuf[2]; Address last_two_bytes(end_of_fun); last_two_bytes.SetOffset (last_two_bytes.GetOffset() - 2); - if (target->ReadMemory (last_two_bytes, prefer_file_cache, bytebuf, 2, error) != -1) + if (target->ReadMemory (last_two_bytes, prefer_file_cache, bytebuf, 2, + error) != static_cast<size_t>(-1)) { if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3) // mov, ret { @@ -776,7 +780,8 @@ AssemblyParse_x86::get_fast_unwind_plan (AddressRange& func, UnwindPlan &unwind_ uint8_t bytebuf[4]; Error error; const bool prefer_file_cache = true; - if (target->ReadMemory (func.GetBaseAddress(), prefer_file_cache, bytebuf, sizeof (bytebuf), error) == -1) + if (target->ReadMemory (func.GetBaseAddress(), prefer_file_cache, bytebuf, + sizeof (bytebuf), error) == static_cast<size_t>(-1)) return false; uint8_t i386_prologue[] = {0x55, 0x89, 0xe5}; @@ -859,7 +864,8 @@ AssemblyParse_x86::find_first_non_prologue_insn (Address &address) // An error parsing the instruction, i.e. probably data/garbage - stop scanning break; } - if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, insn_len, error) == -1) + if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, + insn_len, error) == static_cast<size_t>(-1)) { // Error reading the instruction out of the file, stop scanning break; |