[Lldb-commits] [lldb] r173076 - in /lldb/trunk: include/lldb/Interpreter/OptionGroupFormat.h include/lldb/Target/Target.h source/Commands/CommandObjectMemory.cpp source/Interpreter/OptionGroupFormat.cpp source/Target/Target.cpp

Filipe Cabecinhas filcab at gmail.com
Mon Jan 21 12:14:07 PST 2013


Hi Enrico,

On Mon, Jan 21, 2013 at 11:20 AM, Enrico Granata <egranata at apple.com> wrote:

> ...
> @@ -674,6 +676,46 @@
>              if (bytes_read < total_byte_size)
>                  result.AppendWarningWithFormat("Not all bytes (%lu/%lu)
> were able to be read from 0x%" PRIx64 ".", bytes_read, total_byte_size,
> addr);
>          }
> +        else
> +        {
> +            // we treat c-strings as a special case because they do not
> have a fixed size
> +            if (m_format_options.GetByteSizeValue().OptionWasSet() &&
> !m_format_options.HasGDBFormat())
> +                item_byte_size =
> m_format_options.GetByteSizeValue().GetCurrentValue();
> +            else
> +                item_byte_size = target->GetMaximumSizeOfStringSummary();
> +            if (!m_format_options.GetCountValue().OptionWasSet())
> +                item_count = 1;
>
^^ didn't you mean count = 1?


> +            data_sp.reset (new DataBufferHeap ((item_byte_size+1) *
> item_count, '\0')); // account for NULLs as necessary
> +            uint8_t *data_ptr = data_sp->GetBytes();
> +            auto data_addr = addr;
> +            auto count = item_count;
> +            item_count = 0;
>
^^ Otherwise, it gets erased by this.

Thanks,

  Filipe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20130121/03581bd8/attachment.html>


More information about the lldb-commits mailing list