[haiku-commits] haiku: hrev49410 - in src/apps: debugger/value debugger/user_interface/gui/team_window debugger/value/value_handlers debuganalyzer/gui/table debugger/types

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 18 Jul 2015 05:15:09 +0200 (CEST)

hrev49410 adds 7 changesets to branch 'master'
old head: cac898133b402ece363dcc677dbd112d8926a4b4
new head: 8a5d051fa30aa845a016db0759eb0b15732ede63
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=8a5d051fa30a+%5Ecac898133b40

----------------------------------------------------------------------------

4c880a79bcb5: 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.

5b026a296048: Debugger: Improve variable tooltips.

VariablesView:
- Tooltips now indicate if there was a problem resolving either the location
or the actual value of a given variable, as well as whether or not the
variable is editable in its current location.

568f200843b1: Debugger: Add ValueWriter support class.

- Given a value + corresponding location description, this handles
ensuring that the data ends up in the appropriate locations in the
target team.

8988902ec3f0: Debugger: Implement editor hooks for integer values.

IntegerValueHandler:
- Add hook for acquiring value editor.

df459da6ed9a: {Tree,Table}: Add cell rect accessor.

BColumnListView:
- Add helper method for getting the visible rect of a given field.
Refactor SuggestTextPosition to use it.

{Tree,Table}:
- Add wrapper to retrieve table cell rect using the aforementioned
BCLV helper.

220ccc72f663: Debugger: Fix incorrect comparison.

8a5d051fa30a: Debugger: Minor fix to text control editor.

TableCellTextControlEditor:
- Switch BTextControl inheritance to public, as gcc2 otherwise fails to
properly dynamic_cast to BTextControl, which breaks the latter
internally.

[ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

16 files changed, 357 insertions(+), 50 deletions(-)
headers/private/interface/ColumnListView.h | 3 +
src/apps/debuganalyzer/gui/table/Table.cpp | 17 +++
src/apps/debuganalyzer/gui/table/Table.h | 3 +
src/apps/debuganalyzer/gui/table/TreeTable.cpp | 18 +++
src/apps/debuganalyzer/gui/table/TreeTable.h | 3 +
src/apps/debugger/Jamfile | 1 +
src/apps/debugger/types/ValueLocation.cpp | 12 +-
src/apps/debugger/types/ValueLocation.h | 11 +-
.../gui/team_window/VariablesView.cpp | 92 +++++++------
.../gui/value/TableCellTextControlEditor.h | 2 +-
src/apps/debugger/value/ValueWriter.cpp | 135 +++++++++++++++++++
src/apps/debugger/value/ValueWriter.h | 45 +++++++
.../value_formatters/IntegerValueFormatter.cpp | 2 +-
.../value/value_handlers/IntegerValueHandler.cpp | 38 ++++++
.../value/value_handlers/IntegerValueHandler.h | 4 +
src/kits/interface/ColumnListView.cpp | 21 ++-

############################################################################

Commit: 4c880a79bcb5b89e395144d6ed570d280da01c40
URL: http://cgit.haiku-os.org/haiku/commit/?id=4c880a79bcb5
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 14 15:56:46 2015 UTC

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.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/types/ValueLocation.cpp
b/src/apps/debugger/types/ValueLocation.cpp
index beda735..ab57384 100644
--- a/src/apps/debugger/types/ValueLocation.cpp
+++ b/src/apps/debugger/types/ValueLocation.cpp
@@ -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;
}

diff --git a/src/apps/debugger/types/ValueLocation.h
b/src/apps/debugger/types/ValueLocation.h
index ac6eb3b..045e7db 100644
--- a/src/apps/debugger/types/ValueLocation.h
+++ b/src/apps/debugger/types/ValueLocation.h
@@ -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;
};



############################################################################

Commit: 5b026a2960484d7c862ed8e9142d57b8f71fb797
URL: http://cgit.haiku-os.org/haiku/commit/?id=5b026a296048
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sun Jun 14 16:27:59 2015 UTC

Debugger: Improve variable tooltips.

VariablesView:
- Tooltips now indicate if there was a problem resolving either the location
or the actual value of a given variable, as well as whether or not the
variable is editable in its current location.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
index 33feb49..df0c924 100644
--- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
@@ -1509,51 +1509,65 @@
VariablesView::VariableTableModel::GetToolTipForTablePath(
if (node == NULL)
return false;

- if (node->NodeChild()->LocationResolutionState() != B_OK)
- return false;
-
BString tipData;
- switch (columnIndex) {
- case 0:
- {
- ValueLocation* location = node->NodeChild()->Location();
- for (int32 i = 0; i < location->CountPieces(); i++) {
- ValuePieceLocation piece = location->PieceAt(i);
- BString pieceData;
- switch (piece.type) {
- case VALUE_PIECE_LOCATION_MEMORY:
- pieceData.SetToFormat("(%"
B_PRId32 "): Address: %#"
- B_PRIx64 ", Size: %"
B_PRId64 " bytes", i,
- piece.address,
piece.size);
- break;
- case VALUE_PIECE_LOCATION_REGISTER:
- {
- Architecture* architecture =
fThread->GetTeam()
- ->GetArchitecture();
- pieceData.SetToFormat("(%"
B_PRId32 "): Register (%s)",
- i,
architecture->Registers()[piece.reg].Name());
- break;
+ ValueNodeChild* child = node->NodeChild();
+ status_t error = child->LocationResolutionState();
+ if (error != B_OK)
+ tipData.SetToFormat("Unable to resolve location: %s",
strerror(error));
+ else {
+ ValueNode* valueNode = child->Node();
+ if (valueNode == NULL)
+ return false;
+ error = valueNode->LocationAndValueResolutionState();
+ if (error != B_OK) {
+ tipData.SetToFormat("Unable to resolve value: %s\n\n",
+ strerror(error));
+ }
+
+ switch (columnIndex) {
+ case 0:
+ {
+ ValueLocation* location = child->Location();
+ for (int32 i = 0; i < location->CountPieces();
i++) {
+ ValuePieceLocation piece =
location->PieceAt(i);
+ BString pieceData;
+ switch (piece.type) {
+ case
VALUE_PIECE_LOCATION_MEMORY:
+
pieceData.SetToFormat("(%" B_PRId32 "): Address: "
+ "%#" B_PRIx64
", Size: %" B_PRId64 " bytes\n",
+ i,
piece.address, piece.size);
+ break;
+ case
VALUE_PIECE_LOCATION_REGISTER:
+ {
+ Architecture*
architecture = fThread->GetTeam()
+
->GetArchitecture();
+
pieceData.SetToFormat("(%" B_PRId32 "): Register "
+ "(%s)\n", i,
+
architecture->Registers()[piece.reg].Name());
+ break;
+ }
+ default:
+ break;
}
- default:
- break;
- }

- tipData += pieceData;
- if (i < location->CountPieces() - 1)
- tipData += "\n";
+ tipData += pieceData;
+ }
+ tipData += "Editable: ";
+ tipData += error == B_OK &&
location->IsEditable()
+ ? "Yes" : "No";
+ break;
}
- break;
- }
- case 1:
- {
- Value* value = node->GetValue();
- if (value != NULL)
- value->ToString(tipData);
+ case 1:
+ {
+ Value* value = node->GetValue();
+ if (value != NULL)
+ value->ToString(tipData);

- break;
+ break;
+ }
+ default:
+ break;
}
- default:
- break;
}

if (tipData.IsEmpty())

############################################################################

Commit: 568f200843b1a3261696d01ba1db8a15e50ef86b
URL: http://cgit.haiku-os.org/haiku/commit/?id=568f200843b1
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Wed Jun 24 21:51:42 2015 UTC

Debugger: Add ValueWriter support class.

- Given a value + corresponding location description, this handles
ensuring that the data ends up in the appropriate locations in the
target team.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile
index 6e71466..648b3cf 100644
--- a/src/apps/debugger/Jamfile
+++ b/src/apps/debugger/Jamfile
@@ -340,6 +340,7 @@ local sources =
ValueNode.cpp
ValueNodeContainer.cpp
ValueNodeManager.cpp
+ ValueWriter.cpp

# value/type_handlers
BListTypeHandler.cpp
diff --git a/src/apps/debugger/value/ValueWriter.cpp
b/src/apps/debugger/value/ValueWriter.cpp
new file mode 100644
index 0000000..705e694
--- /dev/null
+++ b/src/apps/debugger/value/ValueWriter.cpp
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * Copyright 2013-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include "ValueWriter.h"
+
+#include "Architecture.h"
+#include "BitBuffer.h"
+#include "CpuState.h"
+#include "DebuggerInterface.h"
+#include "Register.h"
+#include "TeamMemory.h"
+#include "Tracing.h"
+#include "ValueLocation.h"
+
+
+ValueWriter::ValueWriter(Architecture* architecture,
+ DebuggerInterface* interface, CpuState* cpuState, thread_id
targetThread)
+ :
+ fArchitecture(architecture),
+ fDebuggerInterface(interface),
+ fCpuState(cpuState),
+ fTargetThread(targetThread)
+{
+ fArchitecture->AcquireReference();
+ fDebuggerInterface->AcquireReference();
+ if (fCpuState != NULL)
+ fCpuState->AcquireReference();
+}
+
+
+ValueWriter::~ValueWriter()
+{
+ fArchitecture->ReleaseReference();
+ fDebuggerInterface->ReleaseReference();
+ if (fCpuState != NULL)
+ fCpuState->ReleaseReference();
+}
+
+
+status_t
+ValueWriter::WriteValue(ValueLocation* location, BVariant& value)
+{
+ if (!location->IsWritable())
+ return B_BAD_VALUE;
+
+ int32 count = location->CountPieces();
+ if (fCpuState == NULL) {
+ for (int32 i = 0; i < count; i++) {
+ const ValuePieceLocation piece = location->PieceAt(i);
+ if (piece.type == VALUE_PIECE_LOCATION_REGISTER) {
+ TRACE_LOCALS(" -> asked to write value with
register piece, "
+ "but no CPU state to write to.\n");
+ return B_UNSUPPORTED;
+ }
+ }
+ }
+
+ bool cpuStateWriteNeeded = false;
+ size_t byteOffset = 0;
+ bool bigEndian = fArchitecture->IsBigEndian();
+ const Register* registers = fArchitecture->Registers();
+ for (int32 i = 0; i < count; i++) {
+ ValuePieceLocation piece = location->PieceAt(
+ bigEndian ? i : count - i - 1);
+ uint32 bytesToWrite = piece.size;
+
+ uint8* targetData = (uint8*)value.Bytes() + byteOffset;
+
+ switch (piece.type) {
+ case VALUE_PIECE_LOCATION_MEMORY:
+ {
+ target_addr_t address = piece.address;
+
+ TRACE_LOCALS(" piece %" B_PRId32 ": memory
address: %#"
+ B_PRIx64 ", bits: %" B_PRIu32 "\n", i,
address,
+ bytesToWrite * 8);
+
+ ssize_t bytesWritten =
fDebuggerInterface->WriteMemory(address,
+ targetData, bytesToWrite);
+
+ if (bytesWritten < 0)
+ return bytesWritten;
+ if ((uint32)bytesWritten != bytesToWrite)
+ return B_BAD_ADDRESS;
+
+ break;
+ }
+ case VALUE_PIECE_LOCATION_REGISTER:
+ {
+ TRACE_LOCALS(" piece %" B_PRId32 ": register:
%" B_PRIu32
+ ", bits: %" B_PRIu32 "\n", i,
piece.reg, bitSize);
+
+ const Register* target = registers + piece.reg;
+ BVariant pieceValue;
+ switch (bytesToWrite) {
+ case 1:
+
pieceValue.SetTo(*(uint8*)targetData);
+ break;
+ case 2:
+
pieceValue.SetTo(*(uint16*)targetData);
+ break;
+ case 4:
+
pieceValue.SetTo(*(uint32*)targetData);
+ break;
+ case 8:
+
pieceValue.SetTo(*(uint64*)targetData);
+ break;
+ default:
+ TRACE_LOCALS("Asked to write
unsupported piece size %"
+ B_PRId32 " to
register\n", bytesToWrite);
+ return B_UNSUPPORTED;
+ }
+
+ if (!fCpuState->SetRegisterValue(target,
pieceValue))
+ return B_NO_MEMORY;
+
+ cpuStateWriteNeeded = true;
+ break;
+ }
+ default:
+ return B_UNSUPPORTED;
+ }
+
+ byteOffset += bytesToWrite;
+ }
+
+ if (cpuStateWriteNeeded)
+ return fDebuggerInterface->SetCpuState(fTargetThread,
fCpuState);
+
+ return B_OK;
+}
diff --git a/src/apps/debugger/value/ValueWriter.h
b/src/apps/debugger/value/ValueWriter.h
new file mode 100644
index 0000000..8a5ed07
--- /dev/null
+++ b/src/apps/debugger/value/ValueWriter.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef VALUE_WRITER_H
+#define VALUE_WRITER_H
+
+
+#include <OS.h>
+#include <String.h>
+
+#include <Variant.h>
+
+
+class Architecture;
+class CpuState;
+class DebuggerInterface;
+class ValueLocation;
+
+
+class ValueWriter {
+public:
+
ValueWriter(Architecture* architecture,
+
DebuggerInterface* interface,
+
CpuState* cpuState,
+
thread_id targetThread);
+ //
cpuState can be NULL
+ ~ValueWriter();
+
+ Architecture* GetArchitecture() const
+ {
return fArchitecture; }
+
+ status_t
WriteValue(ValueLocation* location,
+
BVariant& value);
+
+private:
+ Architecture* fArchitecture;
+ DebuggerInterface* fDebuggerInterface;
+ CpuState* fCpuState;
+ thread_id fTargetThread;
+};
+
+
+#endif // VALUE_WRITER_H

############################################################################

Commit: 8988902ec3f090a8bba362be9eb7c8c3be1f33d6
URL: http://cgit.haiku-os.org/haiku/commit/?id=8988902ec3f0
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jun 27 01:31:12 2015 UTC

Debugger: Implement editor hooks for integer values.

IntegerValueHandler:
- Add hook for acquiring value editor.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/value/value_handlers/IntegerValueHandler.cpp
b/src/apps/debugger/value/value_handlers/IntegerValueHandler.cpp
index b95dc37..5955aa9 100644
--- a/src/apps/debugger/value/value_handlers/IntegerValueHandler.cpp
+++ b/src/apps/debugger/value/value_handlers/IntegerValueHandler.cpp
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -17,6 +18,7 @@
#include "SettingsDescription.h"
#include "SettingsMenu.h"
#include "TableCellFormattedValueRenderer.h"
+#include "TableCellIntegerEditor.h"


static const char* const kFormatSettingID = "format";
@@ -182,6 +184,42 @@ IntegerValueHandler::GetTableCellValueRenderer(Value*
_value,


status_t
+IntegerValueHandler::GetTableCellValueEditor(Value* _value,
+ Settings* settings, TableCellValueEditor*& _editor)
+{
+ IntegerValue* value = dynamic_cast<IntegerValue*>(_value);
+ if (value == NULL)
+ return B_BAD_VALUE;
+
+ IntegerValueFormatter::Config* config = NULL;
+ status_t error = CreateIntegerFormatterConfig(value, config);
+ if (error != B_OK)
+ return error;
+ BReference<IntegerValueFormatter::Config> configReference(config, true);
+
+ ValueFormatter* formatter;
+ error = CreateValueFormatter(config, formatter);
+ if (error != B_OK)
+ return error;
+ BReference<ValueFormatter> formatterReference(formatter, true);
+
+ TableCellIntegerEditor* editor = new(std::nothrow)
TableCellIntegerEditor(
+ value, formatter);
+ if (editor == NULL)
+ return B_NO_MEMORY;
+
+ BReference<TableCellIntegerEditor> editorReference(editor, true);
+ error = editor->Init();
+ if (error != B_OK)
+ return error;
+
+ editorReference.Detach();
+ _editor = editor;
+ return B_OK;
+}
+
+
+status_t
IntegerValueHandler::CreateTableCellValueSettingsMenu(Value* value,
Settings* settings, SettingsMenu*& _menu)
{
diff --git a/src/apps/debugger/value/value_handlers/IntegerValueHandler.h
b/src/apps/debugger/value/value_handlers/IntegerValueHandler.h
index 09dbcaa..e8c7143 100644
--- a/src/apps/debugger/value/value_handlers/IntegerValueHandler.h
+++ b/src/apps/debugger/value/value_handlers/IntegerValueHandler.h
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015, Rene Gollent, rene@xxxxxxxxxxx.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
* Distributed under the terms of the MIT License.
*/
@@ -28,6 +29,9 @@ public:

ValueFormatter*& _formatter);
virtual status_t
GetTableCellValueRenderer(Value* value,

TableCellValueRenderer*& _renderer);
+ virtual status_t GetTableCellValueEditor(Value*
value,
+
Settings* settings,
+
TableCellValueEditor*& _editor);
virtual status_t
CreateTableCellValueSettingsMenu(Value* value,

Settings* settings, SettingsMenu*& _menu);


############################################################################

Commit: df459da6ed9a147f1c3fb2ca70429ee20c2d1058
URL: http://cgit.haiku-os.org/haiku/commit/?id=df459da6ed9a
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Thu Jul 16 01:34:44 2015 UTC

{Tree,Table}: Add cell rect accessor.

BColumnListView:
- Add helper method for getting the visible rect of a given field.
Refactor SuggestTextPosition to use it.

{Tree,Table}:
- Add wrapper to retrieve table cell rect using the aforementioned
BCLV helper.

----------------------------------------------------------------------------

diff --git a/headers/private/interface/ColumnListView.h
b/headers/private/interface/ColumnListView.h
index 76558bc..76fd0bc 100644
--- a/headers/private/interface/ColumnListView.h
+++ b/headers/private/interface/ColumnListView.h
@@ -363,6 +363,9 @@ public:
BPoint
SuggestTextPosition(const BRow* row,
const
BColumn* column = NULL) const;

+ BRect GetFieldRect(const
BRow* row,
+ const
BColumn* column) const;
+
void SetLatchWidth(float
width);
float LatchWidth() const;
virtual void DrawLatch(BView* view, BRect
frame,
diff --git a/src/apps/debuganalyzer/gui/table/Table.cpp
b/src/apps/debuganalyzer/gui/table/Table.cpp
index 2eb7b93..059d5d1 100644
--- a/src/apps/debuganalyzer/gui/table/Table.cpp
+++ b/src/apps/debuganalyzer/gui/table/Table.cpp
@@ -499,6 +499,23 @@ Table::RemoveTableListener(TableListener* listener)
}


+status_t
+Table::GetCellRectAt(int32 rowIndex, int32 colIndex, BRect& _output) const
+{
+ BRow* row = fRows.ItemAt(rowIndex);
+ if (row == NULL)
+ return B_ENTRY_NOT_FOUND;
+
+ AbstractColumn* column = fColumns.ItemAt(colIndex);
+ if (column == NULL)
+ return B_ENTRY_NOT_FOUND;
+
+ _output = GetFieldRect(row, column);
+
+ return B_OK;
+}
+
+
bool
Table::GetToolTipAt(BPoint point, BToolTip** _tip)
{
diff --git a/src/apps/debuganalyzer/gui/table/Table.h
b/src/apps/debuganalyzer/gui/table/Table.h
index 99abf68..649e0e3 100644
--- a/src/apps/debuganalyzer/gui/table/Table.h
+++ b/src/apps/debuganalyzer/gui/table/Table.h
@@ -135,6 +135,9 @@ public:
bool
AddTableListener(TableListener* listener);
void
RemoveTableListener(TableListener* listener);

+ virtual status_t GetCellRectAt(int32 rowIndex,
int32 colIndex,
+ BRect&
_output) const;
+
protected:
virtual bool GetToolTipAt(BPoint point,
BToolTip** _tip);

diff --git a/src/apps/debuganalyzer/gui/table/TreeTable.cpp
b/src/apps/debuganalyzer/gui/table/TreeTable.cpp
index c69149e..7c4eaaa 100644
--- a/src/apps/debuganalyzer/gui/table/TreeTable.cpp
+++ b/src/apps/debuganalyzer/gui/table/TreeTable.cpp
@@ -843,6 +843,24 @@ TreeTable::RemoveTreeTableListener(TreeTableListener*
listener)
}


+status_t
+TreeTable::GetCellRectAt(const TreeTablePath& path, int32 colIndex,
+ BRect& _output) const
+{
+ TreeTableNode* node = _NodeForPath(path);
+ if (node == NULL)
+ return B_ENTRY_NOT_FOUND;
+
+ AbstractColumn* column = fColumns.ItemAt(colIndex);
+ if (column == NULL)
+ return B_ENTRY_NOT_FOUND;
+
+ _output = GetFieldRect(node->Row(), column);
+
+ return B_OK;
+}
+
+
bool
TreeTable::GetToolTipAt(BPoint point, BToolTip** _tip)
{
diff --git a/src/apps/debuganalyzer/gui/table/TreeTable.h
b/src/apps/debuganalyzer/gui/table/TreeTable.h
index 81d8924..92d35f8 100644
--- a/src/apps/debuganalyzer/gui/table/TreeTable.h
+++ b/src/apps/debuganalyzer/gui/table/TreeTable.h
@@ -195,6 +195,9 @@ public:
void RemoveTreeTableListener(

TreeTableListener* listener);

+ virtual status_t GetCellRectAt(const
TreeTablePath& path,
+ int32
colIndex, BRect& _output) const;
+
protected:
virtual bool GetToolTipAt(BPoint point,
BToolTip** _tip);

diff --git a/src/kits/interface/ColumnListView.cpp
b/src/kits/interface/ColumnListView.cpp
index bc28cc8..10f2d58 100644
--- a/src/kits/interface/ColumnListView.cpp
+++ b/src/kits/interface/ColumnListView.cpp
@@ -1502,9 +1502,22 @@ BPoint
BColumnListView::SuggestTextPosition(const BRow* row,
const BColumn* inColumn) const
{
+ BRect rect(GetFieldRect(row, inColumn));
+
+ font_height fh;
+ fOutlineView->GetFontHeight(&fh);
+ float baseline = floor(rect.top + fh.ascent
+ + (rect.Height() + 1 - (fh.ascent + fh.descent)) / 2);
+ return BPoint(rect.left + 8, baseline);
+}
+
+
+BRect
+BColumnListView::GetFieldRect(const BRow* row, const BColumn* inColumn) const
+{
BRect rect;
GetRowRect(row, &rect);
- if (inColumn) {
+ if (inColumn != NULL) {
float leftEdge = MAX(kLeftMargin, LatchWidth());
for (int index = 0; index < fColumns.CountItems(); index++) {
BColumn* column = (BColumn*) fColumns.ItemAt(index);
@@ -1521,11 +1534,7 @@ BColumnListView::SuggestTextPosition(const BRow* row,
}
}

- font_height fh;
- fOutlineView->GetFontHeight(&fh);
- float baseline = floor(rect.top + fh.ascent
- + (rect.Height() + 1 - (fh.ascent + fh.descent)) / 2);
- return BPoint(rect.left + 8, baseline);
+ return rect;
}



############################################################################

Commit: 220ccc72f663efdc1e0c717388419260d3ea9c1a
URL: http://cgit.haiku-os.org/haiku/commit/?id=220ccc72f663
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jul 18 03:03:49 2015 UTC

Debugger: Fix incorrect comparison.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/value/value_formatters/IntegerValueFormatter.cpp
b/src/apps/debugger/value/value_formatters/IntegerValueFormatter.cpp
index 1ab2800..a85626d 100644
--- a/src/apps/debugger/value/value_formatters/IntegerValueFormatter.cpp
+++ b/src/apps/debugger/value/value_formatters/IntegerValueFormatter.cpp
@@ -143,7 +143,7 @@ IntegerValueFormatter::_ValidateSigned(const BString&
input, type_code type,
}
case B_INT32_TYPE:
{
- if (parsedValue < INT32_MAX || parsedValue > INT32_MAX)
+ if (parsedValue < INT32_MIN || parsedValue > INT32_MAX)
return B_BAD_VALUE;

newValue.SetTo((int32)parsedValue);

############################################################################

Revision: hrev49410
Commit: 8a5d051fa30aa845a016db0759eb0b15732ede63
URL: http://cgit.haiku-os.org/haiku/commit/?id=8a5d051fa30a
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jul 18 03:02:06 2015 UTC

Debugger: Minor fix to text control editor.

TableCellTextControlEditor:
- Switch BTextControl inheritance to public, as gcc2 otherwise fails to
properly dynamic_cast to BTextControl, which breaks the latter
internally.

----------------------------------------------------------------------------

diff --git
a/src/apps/debugger/user_interface/gui/value/TableCellTextControlEditor.h
b/src/apps/debugger/user_interface/gui/value/TableCellTextControlEditor.h
index 7dfe962..9db2a6b 100644
--- a/src/apps/debugger/user_interface/gui/value/TableCellTextControlEditor.h
+++ b/src/apps/debugger/user_interface/gui/value/TableCellTextControlEditor.h
@@ -12,7 +12,7 @@

// common base class for editors that input a value via a text field
class TableCellTextControlEditor : public TableCellFormattedValueEditor,
- protected BTextControl {
+ public BTextControl {
public:

TableCellTextControlEditor(

::Value* initialValue,


Other related posts:

  • » [haiku-commits] haiku: hrev49410 - in src/apps: debugger/value debugger/user_interface/gui/team_window debugger/value/value_handlers debuganalyzer/gui/table debugger/types - anevilyak