Debugger: Add writable property to ValueLocation.

Value{Piece}Location:
- Add member to indicate whether the current location, respectively
  all its pieces are in locations where they can theoretically be
  modified.
This commit is contained in:
Rene Gollent
2015-07-17 22:03:21 -04:00
parent cac898133b
commit 4c880a79bc
2 changed files with 20 additions and 3 deletions
+10 -2
View File
@@ -47,14 +47,16 @@ ValuePieceLocation::Normalize(bool bigEndian)
ValueLocation::ValueLocation()
:
fBigEndian(false)
fBigEndian(false),
fWritable(false)
{
}
ValueLocation::ValueLocation(bool bigEndian)
:
fBigEndian(bigEndian)
fBigEndian(bigEndian),
fWritable(false)
{
}
@@ -212,6 +214,7 @@ ValueLocation::SetTo(const ValueLocation& other, uint64 bitOffset,
void
ValueLocation::Clear()
{
fWritable = false;
fPieces.clear();
}
@@ -227,6 +230,11 @@ ValueLocation::AddPiece(const ValuePieceLocation& piece)
return false;
}
if (fPieces.size() == 1)
fWritable = piece.writable;
else
fWritable = fWritable && piece.writable;
return true;
}
+10 -1
View File
@@ -37,12 +37,16 @@ struct ValuePieceLocation {
// significant bit)
value_piece_location_type type;
void* value; // used for storing implicit values
bool writable; // indicates if the piece is in a
// location in the target team
// where it can be modified
ValuePieceLocation()
:
type(VALUE_PIECE_LOCATION_INVALID),
value(NULL)
value(NULL),
writable(false)
{
}
@@ -97,12 +101,14 @@ struct ValuePieceLocation {
{
type = VALUE_PIECE_LOCATION_MEMORY;
this->address = address;
this->writable = true;
}
void SetToRegister(uint32 reg)
{
type = VALUE_PIECE_LOCATION_REGISTER;
this->reg = reg;
this->writable = true;
}
void SetSize(target_size_t size)
@@ -128,6 +134,7 @@ struct ValuePieceLocation {
SetSize(size);
type = VALUE_PIECE_LOCATION_IMPLICIT;
value = valueData;
writable = false;
return true;
}
@@ -153,6 +160,7 @@ public:
void Clear();
bool IsBigEndian() const { return fBigEndian; }
bool IsWritable() const { return fWritable; }
bool AddPiece(const ValuePieceLocation& piece);
@@ -170,6 +178,7 @@ private:
private:
PieceVector fPieces;
bool fBigEndian;
bool fWritable;
};