diff options
author | Enrico Granata <egranata@apple.com> | 2013-06-04 22:54:16 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-06-04 22:54:16 +0000 |
commit | d325bf9da163f128a47d45a7c19bce41f9a57198 (patch) | |
tree | 4ea4f580dc0df9a63f083c93a076a1ddc89542f9 /lldb/source/Commands/CommandObjectMemory.cpp | |
parent | 4ec309700b2eb026ca33c6f9930de11e07ac6bb2 (diff) | |
download | bcm5719-llvm-d325bf9da163f128a47d45a7c19bce41f9a57198.tar.gz bcm5719-llvm-d325bf9da163f128a47d45a7c19bce41f9a57198.zip |
<rdar://problem/13239809>
Two things:
1) fixing a bug where memory read was not clearing the m_force flag after it was passed, so that subsequent memory reads would not need to be forced even if over boundary
2) adding a setting target.max-memory-read-size that you can set instead of the hardcoded 1024 bytes limit we had before
llvm-svn: 183276
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 4d49e7ba9bd..fe44ad052ab 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -44,7 +44,7 @@ g_option_table[] = { LLDB_OPT_SET_3, true , "type" ,'t', required_argument, NULL, 0, eArgTypeNone ,"The name of a type to view memory as."}, { LLDB_OPT_SET_1| LLDB_OPT_SET_2| - LLDB_OPT_SET_3, false, "force" ,'r', no_argument, NULL, 0, eArgTypeNone ,"Necessary if reading over 1024 bytes of memory."}, + LLDB_OPT_SET_3, false, "force" ,'r', no_argument, NULL, 0, eArgTypeNone ,"Necessary if reading over target.max-memory-read-size bytes."}, }; @@ -119,6 +119,7 @@ public: m_num_per_line.Clear(); m_output_as_binary = false; m_view_as_type.Clear(); + m_force = false; } Error @@ -642,15 +643,16 @@ protected: item_count = total_byte_size / item_byte_size; } - if (total_byte_size > 1024 && !m_memory_options.m_force) + uint32_t max_unforced_size = target->GetMaximumMemReadSize(); + + if (total_byte_size > max_unforced_size && !m_memory_options.m_force) { - result.AppendErrorWithFormat("Normally, \'memory read\' will not read over 1Kbyte of data.\n"); - result.AppendErrorWithFormat("Please use --force to override this restriction.\n"); + result.AppendErrorWithFormat("Normally, \'memory read\' will not read over %" PRIu32 " bytes of data.\n",max_unforced_size); + result.AppendErrorWithFormat("Please use --force to override this restriction just once.\n"); + result.AppendErrorWithFormat("or set target.max-memory-read-size if you will often need a larger limit.\n"); return false; } - - DataBufferSP data_sp; size_t bytes_read = 0; if (clang_ast_type.GetOpaqueQualType()) |