diff options
author | Greg Clayton <gclayton@apple.com> | 2013-01-25 18:06:21 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-01-25 18:06:21 +0000 |
commit | c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2 (patch) | |
tree | 9a0132fc3b0bb4f38d06a0f352ee75ac57994771 /lldb/source/Breakpoint/BreakpointIDList.cpp | |
parent | d0ed6c249dbd6bd488b6491b536a387548c00f7e (diff) | |
download | bcm5719-llvm-c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2.tar.gz bcm5719-llvm-c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2.zip |
<rdar://problem/13069948>
Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.
So I defined a new "lldb::offset_t" which should be used for all file offsets.
After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.
Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.
llvm-svn: 173463
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointIDList.cpp')
-rw-r--r-- | lldb/source/Breakpoint/BreakpointIDList.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp index e7e92992156..24101b1442f 100644 --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -38,7 +38,7 @@ BreakpointIDList::GetSize() } BreakpointID & -BreakpointIDList::GetBreakpointIDAtIndex (uint32_t index) +BreakpointIDList::GetBreakpointIDAtIndex (size_t index) { if (index < m_breakpoint_ids.size()) return m_breakpoint_ids[index]; @@ -47,7 +47,7 @@ BreakpointIDList::GetBreakpointIDAtIndex (uint32_t index) } bool -BreakpointIDList::RemoveBreakpointIDAtIndex (uint32_t index) +BreakpointIDList::RemoveBreakpointIDAtIndex (size_t index) { if (index >= m_breakpoint_ids.size()) return false; @@ -89,10 +89,8 @@ BreakpointIDList::AddBreakpointID (const char *bp_id_str) } bool -BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, uint32_t *position) +BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, size_t *position) { - BreakpointIDArray::iterator tmp_pos; - for (size_t i = 0; i < m_breakpoint_ids.size(); ++i) { BreakpointID tmp_id = m_breakpoint_ids[i]; @@ -108,7 +106,7 @@ BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, uint32_t *position) } bool -BreakpointIDList::FindBreakpointID (const char *bp_id_str, uint32_t *position) +BreakpointIDList::FindBreakpointID (const char *bp_id_str, size_t *position) { BreakpointID temp_bp_id; break_id_t bp_id; @@ -124,7 +122,7 @@ BreakpointIDList::FindBreakpointID (const char *bp_id_str, uint32_t *position) } void -BreakpointIDList::InsertStringArray (const char **string_array, uint32_t array_size, CommandReturnObject &result) +BreakpointIDList::InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result) { if (string_array == NULL) return; @@ -174,8 +172,8 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman bool is_range = false; current_arg = old_args.GetArgumentAtIndex (i); - uint32_t range_start_len = 0; - uint32_t range_end_pos = 0; + size_t range_start_len = 0; + size_t range_end_pos = 0; if (BreakpointIDList::StringContainsIDRangeExpression (current_arg, &range_start_len, &range_end_pos)) { is_range = true; @@ -350,8 +348,8 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman bool BreakpointIDList::StringContainsIDRangeExpression (const char *in_string, - uint32_t *range_start_len, - uint32_t *range_end_pos) + size_t *range_start_len, + size_t *range_end_pos) { bool is_range_expression = false; std::string arg_str = in_string; @@ -368,7 +366,7 @@ BreakpointIDList::StringContainsIDRangeExpression (const char *in_string, for (int i = 0; i < specifiers_size && !is_range_expression; ++i) { const char *specifier_str = BreakpointID::g_range_specifiers[i]; - int len = strlen (specifier_str); + size_t len = strlen (specifier_str); idx = arg_str.find (BreakpointID::g_range_specifiers[i]); if (idx != std::string::npos) { |