Make Scalar::GetValue more consistent
authorPavel Labath <labath@google.com>
Fri, 2 Sep 2016 09:25:36 +0000 (09:25 +0000)
committerPavel Labath <labath@google.com>
Fri, 2 Sep 2016 09:25:36 +0000 (09:25 +0000)
commit21159ee68171686865d67823e8c61ecb43a302d5
tree4d052ebfe57dbbd5723cec0884874fc71fcc1e92
parentb952ece2df20ef7ffc3afed3c1b6f8e7e1ddd01b
Make Scalar::GetValue more consistent

Summary:
It seems the original intention of the function was printing signed values in decimal format, and
unsigned values in hex (without the leading "0x"). However, signed and unsigned long were
exchanged, which lead to amusing test failures in TestMemoryFind.py.

Instead of just switching the two, I think we should just print everything in decimal here, as
the current behaviour is very confusing (especially when one does not request printing of types).
Nothing seems to depend on this behaviour except and we already have a way for the user to
request the format he wants when printing values for most commands (which presumably does not go
through this function).

I also add a unit tests for the function in question.

Reviewers: clayborg, granata.enrico

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D24126

llvm-svn: 280476
lldb/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
lldb/source/Core/Scalar.cpp
lldb/unittests/Core/ScalarTest.cpp