From 4f211a0d0c4ef0c248fd3d4493994c1a122c2eb9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 19 Aug 2014 15:48:31 +0200 Subject: [PATCH] gdb: print the SwNodeIndex properly if there are multiple blocks Change-Id: I178d365e71ef3377b1a2cfc115bb297640161efe --- solenv/gdb/libreoffice/sw.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py index 515718e9ae2e..97cba136b937 100644 --- a/solenv/gdb/libreoffice/sw.py +++ b/solenv/gdb/libreoffice/sw.py @@ -19,8 +19,10 @@ class SwPositionPrinter(object): def to_string(self): node = self.value['nNode']['pNd'].dereference(); + block = node['pBlock'].dereference(); + nodeindex = block['nStart'] + node['nOffset'] offset = self.value['nContent']['m_nIndex'] - return "%s (node %d, offset %d)" % (self.typename, node['nOffset'], offset) + return "%s (node %d, offset %d)" % (self.typename, nodeindex, offset) class SwNodeIndexPrinter(object): '''Prints SwNodeIndex.''' @@ -31,7 +33,9 @@ class SwNodeIndexPrinter(object): def to_string(self): node = self.value['pNd'].dereference(); - return "%s (node %d)" % (self.typename, node['nOffset']) + block = node['pBlock'].dereference(); + nodeindex = block['nStart'] + node['nOffset'] + return "%s (node %d)" % (self.typename, nodeindex) class SwIndexPrinter(object): '''Prints SwIndex.'''