[Libreoffice-commits] core.git: solenv/gdb

2023-07-17 Thread Michael Stahl (via logerrit)
 solenv/gdb/libreoffice/sw.py |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 2c524ab87e336418c3ee7370f76284a53dff1c82
Author: Michael Stahl 
AuthorDate: Mon Jul 17 14:16:24 2023 +0200
Commit: Michael Stahl 
CommitDate: Mon Jul 17 16:39:16 2023 +0200

solenv: gdb: BigPtrArrayPrinter, try both 0 and 0ul

Apparently commit ea858ca92488309789e8381a358af1d9f6f6 broke it on
Fedora 38, where i now get:
  gdb.error: No type named std::_Head_base<0ul, BlockInfo**, false>.

So try both variants.

Change-Id: If344077df7a6b329286bc1296446562301305946
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154525
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 2b5cc7c7278b..50d0f2221f2e 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,7 +194,12 @@ class BigPtrArrayPrinter(object):
 # libstdc++ unique_ptr is a std::tuple which contains multiple
 # _M_head_impl members and gdb may pick the wrong one by default
 # so have to manually cast it to the one that contains the array
-self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0ul, 
BlockInfo**, false>"))['_M_head_impl']
+try:
+# supposedly works on Debian gdb 13.2
+self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0ul, 
BlockInfo**, false>"))['_M_head_impl']
+except gdb.error:
+# works on Fedora gdb 13.2
+self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0, 
BlockInfo**, false>"))['_M_head_impl']
 self.count = array['m_nSize']
 self.pos = 0
 self.block_count = array['m_nBlock']


[Libreoffice-commits] core.git: solenv/gdb

2023-06-15 Thread Julien Nabet (via logerrit)
 solenv/gdb/libreoffice/sw.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ea858ca92488309789e8381a358af1d9f6f6
Author: Julien Nabet 
AuthorDate: Thu Jun 15 12:22:57 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu Jun 15 17:12:50 2023 +0200

gdb: BigPtrArrayPrinter, add the suffix, so 0->0ul

On pc Debian testing with GNU gdb (Debian 13.2-1) 13.2, I got this trying 
to debug tdf#131173

Thread 1 "soffice.bin" hit Breakpoint 1, SwUndoTableMerge::UndoImpl 
(this=0x5599a0d302b0, rContext=...) at sw/source/core/undo/untbl.cxx:1878
1878SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( 
aIdx.GetNode(),
(gdb) p rDoc.GetNodes()
$1 = (SwNodes &) @0x5599a0477000: { = BigPtrArray of length 
18Python Exception : No type named std::_Head_base<0, 
BlockInfo**, false>.
, m_vIndices = 0x5599a04a4478, m_rMyDoc = @0x5599a0479590, m_pEndOfPostIts 
= 0x5599a04739b0, m_pEndOfInserts = 0x5599a042da70,
  m_pEndOfAutotext = 0x5599a04764b0, m_pEndOfRedlines = 0x5599a04765e0, 
m_pEndOfContent = std::unique_ptr = {get() = 0x5599a0478d20},
  m_aOutlineNodes = {> = {m_vector = std::__debug::vector of length 0, 
capacity 0}, static npos = 18446744073709551615},
  m_bInNodesDel = false, m_bInDelUpdOutline = false}

with the patch, I got:
(gdb) p rDoc.GetNodes()
$1 = (SwNodes &) @0x55c379492b10: { = BigPtrArray of length 18 
= {
[   0] 0x55c37948c9a0StartNode ,
[   1] 0x55c3794859a0  EndNode ,
[   2] 0x55c379492bb0StartNode ,
[   3] 0x55c37948a6c0  EndNode ,
[   4] 0x55c3794925a0StartNode ,
[   5] 0x55c37948ff10  EndNode ,
[   6] 0x55c379492630StartNode ,
[   7] 0x55c379490040  EndNode ,
[   8] 0x55c3794926c0StartNode ,
[   9]  0x55c3795bd170   TableNode ,
[  10]   0x55c379606280  StartNode ,
[  11]0x55c379616ee8  TextNode "",
[  12]   0x55c37960cd70EndNode ,
[  13]  0x55c379612780 EndNode ,
[  14]  0x55c3794b6628TextNode "",
[  15]  0x55c37962d848TextNode "",
[  16]  0x55c379616778TextNode "",
[  17] 0x55c37948fd20  EndNode }, m_vIndices = 0x55c3794bda68, 
m_rMyDoc = @0x55c379492f80, m_pEndOfPostIts = 0x55c3794859a0, m_pEndOfInserts = 
0x55c37948a6c0, m_pEndOfAutotext = 0x55c37948ff10,
  m_pEndOfRedlines = 0x55c379490040, m_pEndOfContent = 
std::unique_ptr = {get() = 0x55c37948fd20}, m_aOutlineNodes = 
{> 
= {
  m_vector = std::__debug::vector of length 0, capacity 0}, static npos 
= 18446744073709551615}, m_bInNodesDel = false, m_bInDelUpdOutline = false}

Change-Id: I492b49dd1a554dc95abb0ed97fa99541c8dbd7f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153111
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 206eda25fa18..2b5cc7c7278b 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,7 +194,7 @@ class BigPtrArrayPrinter(object):
 # libstdc++ unique_ptr is a std::tuple which contains multiple
 # _M_head_impl members and gdb may pick the wrong one by default
 # so have to manually cast it to the one that contains the array
-self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0, 
BlockInfo**, false>"))['_M_head_impl']
+self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0ul, 
BlockInfo**, false>"))['_M_head_impl']
 self.count = array['m_nSize']
 self.pos = 0
 self.block_count = array['m_nBlock']


[Libreoffice-commits] core.git: solenv/gdb

2022-09-24 Thread Michael Stahl (via logerrit)
 solenv/gdb/libreoffice/sw.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 03714397c8a657a3ac451cc42ffc7578c567d081
Author: Michael Stahl 
AuthorDate: Fri Sep 23 17:35:42 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 24 13:40:53 2022 +0200

solenv: gdb: unbreak MarkBasePrinter

(regression from commit b1cefa026d52fad4557d10c721fe9d5e57200bd6)

Also unbreak SwXTextRangePrinter, not sure why that broke.

Change-Id: I4d6f640e0b8422fcf9ae84fffabc77161311eac1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140522
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 3ca9a7f64413..206eda25fa18 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -111,7 +111,7 @@ class MarkBasePrinter(object):
 def children(self):
 m = self.value.cast(self.value.dynamic_type)
 return [ ( v, m[ v ] )
-for v in ( 'm_aName', 'm_pPos1', 'm_pPos2' ) ].__iter__()
+for v in ( 'm_aName', 'm_oPos1', 'm_oPos2' ) ].__iter__()
 
 class SwXTextRangeImplPrinter(object):
 '''Prints SwXTextRange::Impl.'''
@@ -165,7 +165,7 @@ class SwXTextRangePrinter(object):
 self.value = value
 
 def to_string(self):
-return "%s %s" % (self.typename, self.value['m_pImpl'])
+return "%s %s" % (self.typename, 
self.value['m_pImpl']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0, 
SwXTextRange::Impl*, false>"))['_M_head_impl'].dereference())
 
 class BigPtrArrayPrinter(object):
 '''Prints BigPtrArray.'''


[Libreoffice-commits] core.git: solenv/gdb

2022-09-16 Thread Noel Grandin (via logerrit)
 solenv/gdb/libreoffice/sw.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6e2b926f82dd0da2edd0ca6edaf6fc0a0a8ceef9
Author: Noel Grandin 
AuthorDate: Fri Sep 16 11:13:04 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 16 12:11:48 2022 +0200

fix SwContentIndexPrinter pretty printer

after
commit 739f3bb7228fa8c33029af46093b4646f848814b
Author: Noel Grandin 
Date:   Wed Aug 31 15:29:20 2022 +0200
improve the SwContentIndex debug pretty printer

Change-Id: Ib7b30f2f7d9a33f70243d8b72357b6f9823bc397
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140062
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index fc5ff62dad0e..3ca9a7f64413 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -51,9 +51,9 @@ class SwContentIndexPrinter(object):
 if pNode:
 node = pNode.dereference()
 block = node['m_pBlock'].dereference();
-nodeindex = block['nStart'] + node['m_nOffset']
+nodeindex = str(block['nStart'] + node['m_nOffset'])
 offset = self.value['m_nIndex']
-return "%s (node %d offset %d)" % (self.typename, nodeindex, offset)
+return "%s (node %s offset %s)" % (self.typename, nodeindex, offset)
 
 class SwPaMPrinter(object):
 '''Prints SwPaM.'''


[Libreoffice-commits] core.git: solenv/gdb

2022-02-09 Thread Michael Stahl (via logerrit)
 solenv/gdb/libreoffice/sw.py |   15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

New commits:
commit a10a031199b36914ba14705e417efd76dbb0383a
Author: Michael Stahl 
AuthorDate: Tue Feb 8 18:53:56 2022 +0100
Commit: Michael Stahl 
CommitDate: Wed Feb 9 14:11:01 2022 +0100

gdb: fix SwXTextCursorPrinter

m_pImpl was removed in commit cb0991e32987108d900ec7e8fcd4ce477ebc9fb4

Change-Id: I9ca0cdbca97242ace5243f140ac2e17055b3f718
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129685
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 7a5ce193684b..707d0a425518 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -122,8 +122,8 @@ class SwXTextRangeImplPrinter(object):
 children = [('mark', mark)]
 return children.__iter__()
 
-class SwXTextCursorImplPrinter(object):
-'''Prints SwXTextCursor::Impl.'''
+class SwXTextCursorPrinter(object):
+'''Prints SwXTextCursor.'''
 
 def __init__(self, typename, value):
 self.typename = typename
@@ -161,16 +161,6 @@ class SwXTextRangePrinter(object):
 def to_string(self):
 return "%s %s" % (self.typename, self.value['m_pImpl'])
 
-class SwXTextCursorPrinter(object):
-'''Prints SwXTextCursor.'''
-
-def __init__(self, typename, value):
-self.typename = typename
-self.value = value
-
-def to_string(self):
-return "%s %s" % (self.typename, self.value['m_pImpl'])
-
 class BigPtrArrayPrinter(object):
 '''Prints BigPtrArray.'''
 
@@ -305,7 +295,6 @@ def build_pretty_printers():
 printer.add('SwXTextRange::Impl', SwXTextRangeImplPrinter)
 printer.add('sw::UnoImplPtr', SwUnoImplPtrPrinter)
 printer.add('SwXTextRange', SwXTextRangePrinter)
-printer.add('SwXTextCursor::Impl', SwXTextCursorImplPrinter)
 printer.add('SwXTextCursor', SwXTextCursorPrinter)
 
 def register_pretty_printers(obj):


[Libreoffice-commits] core.git: solenv/gdb

2021-12-03 Thread Michael Stahl (via logerrit)
 solenv/gdb/libreoffice/sw.py |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c9267ca4fa7fa94a1bf79320bec54428a6ad4804
Author: Michael Stahl 
AuthorDate: Thu Dec 2 11:57:40 2021 +0100
Commit: Michael Stahl 
CommitDate: Fri Dec 3 10:21:13 2021 +0100

gdb: BigPtrArrayPrinter gets confused by libstdc++ std::unique_ptr

It looks like this in libstdc++:

   = {
m_ppInf = {
  _M_t = {
 >> = {
  _M_t = {
 >> = {
   >> = {
, 
true>> = {
  _M_head_impl = {}
}, },
  > = {
_M_head_impl = 0x567fd20
  }, }, }
}, }
},

Note there are 2 _M_head_impl members, and somehow gdb 11.1-2.fc34 picks
the wrong one.

A manual cast to std::_Head_base<0, BlockInfo**, false> seems to help.

Change-Id: I1332c2fc6eb2661d417fd92a73aed977bbb1dcea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126220
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index e170709fb79c..7a5ce193684b 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -8,6 +8,7 @@
 #
 
 import six
+import gdb
 from libreoffice.util import printing
 
 class SwPositionPrinter(object):
@@ -194,7 +195,10 @@ class BigPtrArrayPrinter(object):
 class _iterator(six.Iterator):
 
 def __init__(self, array):
-self.blocks = array['m_ppInf']['_M_t']['_M_t']['_M_head_impl']
+# libstdc++ unique_ptr is a std::tuple which contains multiple
+# _M_head_impl members and gdb may pick the wrong one by default
+# so have to manually cast it to the one that contains the array
+self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0, 
BlockInfo**, false>"))['_M_head_impl']
 self.count = array['m_nSize']
 self.pos = 0
 self.block_count = array['m_nBlock']


[Libreoffice-commits] core.git: solenv/gdb

2021-07-01 Thread Jan-Marek Glogowski (via logerrit)
 solenv/gdb/libreoffice/vcl.py |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 66fc670dd3d06f58286532be2de0189ec955f476
Author: Jan-Marek Glogowski 
AuthorDate: Thu Jul 1 19:04:25 2021 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Thu Jul 1 19:47:12 2021 +0200

GDB vcl.py: actually return a string in to_string

... and hopefully make it python2.7 compatible... definitly a
"brown paperbag" fix... well it did work locally ;-)

I just noticed, because Jenkins spilled some errors from GDB on
hang with:

Traceback (most recent call last):
  File "/.../instdir/program/libvcllo.so-gdb.py", line 23, in 
module = importlib.import_module('libreoffice.' + mod)
  File "/.../python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/.../solenv/gdb/libreoffice/vcl.py", line 101
print('STACK', end =", ")

Change-Id: I500e8fea07e9865235e37673dee6374108fefbf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118237
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/solenv/gdb/libreoffice/vcl.py b/solenv/gdb/libreoffice/vcl.py
index ee9634fd5efc..ce595747587a 100644
--- a/solenv/gdb/libreoffice/vcl.py
+++ b/solenv/gdb/libreoffice/vcl.py
@@ -94,19 +94,17 @@ class ImplSchedulerContextPrinter(object):
 self.prio = gdb.lookup_type('TaskPriority')
 
 def to_string(self):
-print('{')
+res = "{\n"
 if self.value['mnTimerPeriod']:
-print('mnTimerPeriod =', self.value['mnTimerPeriod'])
+res = res + "mnTimerPeriod = " + str(self.value['mnTimerPeriod']) 
+ "\n"
 if self.value['mpSchedulerStack']:
-print('STACK', end =", ")
-print(self.value['mpSchedulerStack'].dereference())
+res = res + "STACK, " + 
str(self.value['mpSchedulerStack'].dereference())
 if self.value['mpFirstSchedulerData']:
 for key, value in self.prio.items():
 first = self.value['mpFirstSchedulerData'][value.enumval]
 if first:
-print(key.replace('TaskPriority::', ''), end =", ")
-print(first.dereference())
-print('}')
+res = res + key.replace('TaskPriority::', '') + ", " + 
str(first.dereference())
+return res + "}"
 
 printer = None
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2021-06-29 Thread Jan-Marek Glogowski (via logerrit)
 solenv/gdb/libreoffice/vcl.py |   31 +++
 1 file changed, 27 insertions(+), 4 deletions(-)

New commits:
commit a40334ef4deb03c207b7f959a0a9c93ef3e5c459
Author: Jan-Marek Glogowski 
AuthorDate: Tue Jun 29 01:42:50 2021 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Tue Jun 29 22:42:42 2021 +0200

Extend and fix Scheduler GDB printer

Adds a pretty printer for the whole Scheduler context and fixes an
off-by-one error when dumping the ImplSchedulerData singly-linked
list.

Change-Id: I94129fc164986b379f33854651ff6df766eff97f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118075
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/solenv/gdb/libreoffice/vcl.py b/solenv/gdb/libreoffice/vcl.py
index 6a99c9f21f7c..ee9634fd5efc 100644
--- a/solenv/gdb/libreoffice/vcl.py
+++ b/solenv/gdb/libreoffice/vcl.py
@@ -40,7 +40,7 @@ class ImplSchedulerDataPrinter(object):
 task_type = "Timer"
 else:
 task_type = "Task"
-res = "{:7s}{:10s} active: {:6s}".format( task_type, 
str(task['mePriority']), str(task['mbActive']) )
+res = "{:7s}{:10s} active: {:6s}".format( task_type, 
str(task['mePriority']).replace('TaskPriority::',''), str(task['mbActive']) )
 name = task['mpDebugName']
 if not name:
 res = res + "   (task debug name not set)"
@@ -48,9 +48,9 @@ class ImplSchedulerDataPrinter(object):
 res = "{} '{}' ({})".format(res, str(name.string()), 
str(task.dynamic_type))
 val_type = gdb.lookup_type(str( task.dynamic_type )).pointer()
 timer = gdbobj['mpTask'].cast( val_type )
-if (task_type == "Timer"):
+if task_type == "Timer":
 res = "{}: {}ms".format(res, timer['mnTimeout'])
-else:
+elif task_type == "Idle":
 assert 0 == timer['mnTimeout'], "Idle with timeout == 
{}".format( timer['mnTimeout'] )
 return res
 else:
@@ -76,7 +76,7 @@ class ImplSchedulerDataPrinter(object):
 return self
 
 def __next__(self):
-if not self.value['mpNext']:
+if not self.value:
 raise StopIteration()
 
 pos = str(self.pos)
@@ -86,6 +86,28 @@ class ImplSchedulerDataPrinter(object):
 
 return (pos, name)
 
+class ImplSchedulerContextPrinter(object):
+
+def __init__(self, typename, value):
+self.typename = typename
+self.value = value
+self.prio = gdb.lookup_type('TaskPriority')
+
+def to_string(self):
+print('{')
+if self.value['mnTimerPeriod']:
+print('mnTimerPeriod =', self.value['mnTimerPeriod'])
+if self.value['mpSchedulerStack']:
+print('STACK', end =", ")
+print(self.value['mpSchedulerStack'].dereference())
+if self.value['mpFirstSchedulerData']:
+for key, value in self.prio.items():
+first = self.value['mpFirstSchedulerData'][value.enumval]
+if first:
+print(key.replace('TaskPriority::', ''), end =", ")
+print(first.dereference())
+print('}')
+
 printer = None
 
 def build_pretty_printers():
@@ -93,6 +115,7 @@ def build_pretty_printers():
 
 printer = printing.Printer("libreoffice/vcl")
 printer.add('ImplSchedulerData', ImplSchedulerDataPrinter)
+printer.add('ImplSchedulerContext', ImplSchedulerContextPrinter)
 
 def register_pretty_printers(obj):
 printing.register_pretty_printer(printer, obj)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2020-10-09 Thread Stephan Bergmann (via logerrit)
 solenv/gdb/boost/util/printing.py   |5 -
 solenv/gdb/libreoffice/util/printing.py |5 -
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit f9d9a21d0271d3ddc689dfe12983ec6c96d8ccbc
Author: Stephan Bergmann 
AuthorDate: Fri Oct 9 15:25:06 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 9 17:04:24 2020 +0200

Adapt solenv/gdb/ to old Python

After 4a899a5f8a72ea29a6919316afe3627de9f33e95 "Fix Python deprecation 
warnings"e.g. 

started to complain

> Traceback (most recent call last):
>   File 
"/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/instdir/program/libuno_sal.so.3-gdb.py",
 line 23, in 
> module = importlib.import_module('libreoffice.' + mod)
>   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in 
import_module
> __import__(name)
>   File 
"/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/solenv/gdb/libreoffice/sal.py",
 line 14, in 
> from libreoffice.util import printing
>   File 
"/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/solenv/gdb/libreoffice/util/printing.py",
 line 10, in 
> from collections.abc import Mapping
> ImportError: No module named abc

etc. when lode's bin/kill-wrapper calls gdb to obtain backtraces of hung
processes.

Change-Id: I4fe6c6fa97bbb455a071dd28e5c1ab33f2337a0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104119
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/solenv/gdb/boost/util/printing.py 
b/solenv/gdb/boost/util/printing.py
index 85a91c9340a4..22bf29f8030a 100644
--- a/solenv/gdb/boost/util/printing.py
+++ b/solenv/gdb/boost/util/printing.py
@@ -19,7 +19,10 @@
 # along with this program.  If not, see .
 
 
-from collections.abc import Mapping
+try:
+from collections.abc import Mapping
+except:
+from collections import Mapping
 import gdb
 import re
 import six
diff --git a/solenv/gdb/libreoffice/util/printing.py 
b/solenv/gdb/libreoffice/util/printing.py
index 30e311678025..a31e353cfa4d 100644
--- a/solenv/gdb/libreoffice/util/printing.py
+++ b/solenv/gdb/libreoffice/util/printing.py
@@ -7,7 +7,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-from collections.abc import Mapping
+try:
+from collections.abc import Mapping
+except:
+from collections import Mapping
 import gdb
 import re
 import six
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2020-09-24 Thread Stephan Bergmann (via logerrit)
 solenv/gdb/boost/util/printing.py   |2 +-
 solenv/gdb/libreoffice/util/printing.py |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4a899a5f8a72ea29a6919316afe3627de9f33e95
Author: Stephan Bergmann 
AuthorDate: Thu Sep 24 09:53:24 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 24 11:28:52 2020 +0200

Fix Python deprecation warnings

I noticed these "DeprecationWarning: Using or importing the ABCs from
'collections' instead of from 'collections.abc' is deprecated since Python 
3.3,
and in 3.9 it will stop working" now when running tests with
CPPUNITTRACE='gdb --args' on Fedora 32.

Change-Id: If263dacb9df5c1fffd2be2418e13e69b96070c77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103294
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/solenv/gdb/boost/util/printing.py 
b/solenv/gdb/boost/util/printing.py
index ca8b6c28eeca..85a91c9340a4 100644
--- a/solenv/gdb/boost/util/printing.py
+++ b/solenv/gdb/boost/util/printing.py
@@ -19,7 +19,7 @@
 # along with this program.  If not, see .
 
 
-from collections import Mapping
+from collections.abc import Mapping
 import gdb
 import re
 import six
diff --git a/solenv/gdb/libreoffice/util/printing.py 
b/solenv/gdb/libreoffice/util/printing.py
index b44c1ec8bd5c..30e311678025 100644
--- a/solenv/gdb/libreoffice/util/printing.py
+++ b/solenv/gdb/libreoffice/util/printing.py
@@ -7,7 +7,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-from collections import Mapping
+from collections.abc import Mapping
 import gdb
 import re
 import six
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2020-02-24 Thread Jens Carl (via logerrit)
 solenv/gdb/six.py |   69 +-
 1 file changed, 48 insertions(+), 21 deletions(-)

New commits:
commit 8324f9284c840ae1cde7cda584bf30531f484b01
Author: Jens Carl 
AuthorDate: Sat Jan 25 16:35:42 2020 -0800
Commit: Jens Carl 
CommitDate: Tue Feb 25 06:56:23 2020 +0100

six: upgrade release to 1.14.0 used by gdb

Change-Id: I450f5cd83e116baab8d1750a9ed7def002e234c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89317
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/solenv/gdb/six.py b/solenv/gdb/six.py
index 47ecf52bd2d5..5fe9f8e141ee 100644
--- a/solenv/gdb/six.py
+++ b/solenv/gdb/six.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2018 Benjamin Peterson
+# Copyright (c) 2010-2020 Benjamin Peterson
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@ import sys
 import types
 
 __author__ = "Benjamin Peterson "
-__version__ = "1.12.0"
+__version__ = "1.14.0"
 
 
 # Useful for very coarse version differentiation.
@@ -255,9 +255,11 @@ _moved_attributes = [
 MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", 
"zip_longest"),
 MovedModule("builtins", "__builtin__"),
 MovedModule("configparser", "ConfigParser"),
+MovedModule("collections_abc", "collections", "collections.abc" if 
sys.version_info >= (3, 3) else "collections"),
 MovedModule("copyreg", "copy_reg"),
 MovedModule("dbm_gnu", "gdbm", "dbm.gnu"),
-MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"),
+MovedModule("dbm_ndbm", "dbm", "dbm.ndbm"),
+MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread" if 
sys.version_info < (3, 9) else "_thread"),
 MovedModule("http_cookiejar", "cookielib", "http.cookiejar"),
 MovedModule("http_cookies", "Cookie", "http.cookies"),
 MovedModule("html_entities", "htmlentitydefs", "html.entities"),
@@ -642,9 +644,11 @@ if PY3:
 if sys.version_info[1] <= 1:
 _assertRaisesRegex = "assertRaisesRegexp"
 _assertRegex = "assertRegexpMatches"
+_assertNotRegex = "assertNotRegexpMatches"
 else:
 _assertRaisesRegex = "assertRaisesRegex"
 _assertRegex = "assertRegex"
+_assertNotRegex = "assertNotRegex"
 else:
 def b(s):
 return s
@@ -666,6 +670,7 @@ else:
 _assertCountEqual = "assertItemsEqual"
 _assertRaisesRegex = "assertRaisesRegexp"
 _assertRegex = "assertRegexpMatches"
+_assertNotRegex = "assertNotRegexpMatches"
 _add_doc(b, """Byte literal""")
 _add_doc(u, """Text literal""")
 
@@ -682,6 +687,10 @@ def assertRegex(self, *args, **kwargs):
 return getattr(self, _assertRegex)(*args, **kwargs)
 
 
+def assertNotRegex(self, *args, **kwargs):
+return getattr(self, _assertNotRegex)(*args, **kwargs)
+
+
 if PY3:
 exec_ = getattr(moves.builtins, "exec")
 
@@ -717,16 +726,7 @@ else:
 """)
 
 
-if sys.version_info[:2] == (3, 2):
-exec_("""def raise_from(value, from_value):
-try:
-if from_value is None:
-raise value
-raise value from from_value
-finally:
-value = None
-""")
-elif sys.version_info[:2] > (3, 2):
+if sys.version_info[:2] > (3,):
 exec_("""def raise_from(value, from_value):
 try:
 raise value from from_value
@@ -806,13 +806,33 @@ if sys.version_info[:2] < (3, 3):
 _add_doc(reraise, """Reraise an exception.""")
 
 if sys.version_info[0:2] < (3, 4):
+# This does exactly the same what the :func:`py3:functools.update_wrapper`
+# function does on Python versions after 3.2. It sets the ``__wrapped__``
+# attribute on ``wrapper`` object and it doesn't raise an error if any of
+# the attributes mentioned in ``assigned`` and ``updated`` are missing on
+# ``wrapped`` object.
+def _update_wrapper(wrapper, wrapped,
+assigned=functools.WRAPPER_ASSIGNMENTS,
+updated=functools.WRAPPER_UPDATES):
+for attr in assigned:
+try:
+value = getattr(wrapped, attr)
+except AttributeError:
+continue
+else:
+setattr(wrapper, attr, value)
+for attr in updated:
+getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
+wrapper.__wrapped__ = wrapped
+return wrapper
+_update_wrapper.__doc__ = functools.update_wrapper.__doc__
+
 def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
   updated=functools.WRAPPER_UPDATES):
-def wrapper(f):
-f = functools.wraps(wrapped, assigned, updated)(f)
-f.__wrapped__ = wrapped
-return f
-return wrapper
+return functools.partial(_update_wrapper, wrapped=wrapped,
+ assigned=assigned, updated=updated)
+wraps.__doc__ = functools.wraps.__doc__
+
 else:
 

[Libreoffice-commits] core.git: solenv/gdb

2019-06-25 Thread Noel Grandin (via logerrit)
 solenv/gdb/libreoffice/tl.py |   24 
 1 file changed, 24 deletions(-)

New commits:
commit 2f00a7c61fff9c091f08b6aaa4f829cd34fb3745
Author: Noel Grandin 
AuthorDate: Tue Jun 25 13:23:16 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 25 13:23:16 2019 +0200

remove Fraction pretty-printer

no longer necessary after
commit 31589bf0239679d73417902655045c48c4868016
Date:   Mon Jun 24 15:02:55 2019 +0200
tdf#94677 Calc is slow opening large CSV, improve tools::Fraction

Change-Id: I1c9ee043a51216f7005bf8a4bf60bb4b4e39ab61

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 44f3c78210cb..22ca3ba57c5f 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -53,29 +53,6 @@ class ColorPrinter(object):
 else:
 return "rgb(%d, %d, %d)" % (r, g, b)
 
-class FractionPrinter(object):
-'''Prints fraction'''
-
-def __init__(self, typename, val):
-self.typename = typename
-self.val = val
-
-def to_string(self):
-# Workaround gdb bug 
 "ptype does not
-# find inner C++ class type without -readnow"
-gdb.lookup_type('Fraction')
-# This would be simpler and more reliable if we could call the 
operator* on mpImpl to get the internal Impl.
-# Different libc have different structures. Some have one _M_t, some 
have two nested.
-tmp = self.val['mpImpl']['_M_t']
-if tmp.type.fields()[0].name == '_M_t': tmp = tmp['_M_t']
-impl = 
tmp['_M_head_impl'].dereference().cast(gdb.lookup_type('Fraction::Impl'))
-numerator = impl['value']['num']
-denominator = impl['value']['den']
-if impl['valid']:
-return "%d/%d" % (numerator, denominator)
-else:
-return "invalid %s %d/%d" % (self.typename, numerator, denominator)
-
 class DateTimeImpl(object):
 
 def __init__(self, date, time):
@@ -228,7 +205,6 @@ def build_pretty_printers():
 # various types
 printer.add('BigInt', BigIntPrinter)
 printer.add('Color', ColorPrinter)
-printer.add('Fraction', FractionPrinter)
 printer.add('DateTime', DateTimePrinter)
 printer.add('Date', DatePrinter)
 printer.add('Time', TimePrinter)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: solenv/gdb

2019-05-28 Thread Jens Carl (via logerrit)
 solenv/gdb/six.py |  536 +-
 1 file changed, 456 insertions(+), 80 deletions(-)

New commits:
commit 1c7a2eff17f09feaa2709eaab60855f8e1aa7469
Author: Jens Carl 
AuthorDate: Mon May 27 20:17:24 2019 +
Commit: Michael Stahl 
CommitDate: Tue May 28 11:30:06 2019 +0200

six: upgrade release to 1.12.0 used by gdb

Change-Id: I816ccde944903e0ff3ac23e92632056a3192b060
Reviewed-on: https://gerrit.libreoffice.org/73069
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/solenv/gdb/six.py b/solenv/gdb/six.py
index 85898ec71275..47ecf52bd2d5 100644
--- a/solenv/gdb/six.py
+++ b/solenv/gdb/six.py
@@ -1,6 +1,4 @@
-"""Utilities for writing code that runs on Python 2 and 3"""
-
-# Copyright (c) 2010-2013 Benjamin Peterson
+# Copyright (c) 2010-2018 Benjamin Peterson
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -20,17 +18,24 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
+"""Utilities for writing code that runs on Python 2 and 3"""
+
+from __future__ import absolute_import
+
+import functools
+import itertools
 import operator
 import sys
 import types
 
 __author__ = "Benjamin Peterson "
-__version__ = "1.4.1"
+__version__ = "1.12.0"
 
 
 # Useful for very coarse version differentiation.
 PY2 = sys.version_info[0] == 2
 PY3 = sys.version_info[0] == 3
+PY34 = sys.version_info[0:2] >= (3, 4)
 
 if PY3:
 string_types = str,
@@ -53,6 +58,7 @@ else:
 else:
 # It's possible to have sizeof(long) != sizeof(Py_ssize_t).
 class X(object):
+
 def __len__(self):
 return 1 << 31
 try:
@@ -84,9 +90,13 @@ class _LazyDescr(object):
 
 def __get__(self, obj, tp):
 result = self._resolve()
-setattr(obj, self.name, result)
-# This is a bit ugly, but it avoids running this again.
-delattr(tp, self.name)
+setattr(obj, self.name, result)  # Invokes __set__.
+try:
+# This is a bit ugly, but it avoids running this again by
+# removing this descriptor.
+delattr(obj.__class__, self.name)
+except AttributeError:
+pass
 return result
 
 
@@ -104,6 +114,27 @@ class MovedModule(_LazyDescr):
 def _resolve(self):
 return _import_module(self.mod)
 
+def __getattr__(self, attr):
+_module = self._resolve()
+value = getattr(_module, attr)
+setattr(self, attr, value)
+return value
+
+
+class _LazyModule(types.ModuleType):
+
+def __init__(self, name):
+super(_LazyModule, self).__init__(name)
+self.__doc__ = self.__class__.__doc__
+
+def __dir__(self):
+attrs = ["__doc__", "__name__"]
+attrs += [attr.name for attr in self._moved_attributes]
+return attrs
+
+# Subclasses should override this
+_moved_attributes = []
+
 
 class MovedAttribute(_LazyDescr):
 
@@ -130,9 +161,75 @@ class MovedAttribute(_LazyDescr):
 return getattr(module, self.attr)
 
 
+class _SixMetaPathImporter(object):
+
+"""
+A meta path importer to import six.moves and its submodules.
+
+This class implements a PEP302 finder and loader. It should be compatible
+with Python 2.5 and all existing versions of Python3
+"""
+
+def __init__(self, six_module_name):
+self.name = six_module_name
+self.known_modules = {}
+
+def _add_module(self, mod, *fullnames):
+for fullname in fullnames:
+self.known_modules[self.name + "." + fullname] = mod
+
+def _get_module(self, fullname):
+return self.known_modules[self.name + "." + fullname]
+
+def find_module(self, fullname, path=None):
+if fullname in self.known_modules:
+return self
+return None
+
+def __get_module(self, fullname):
+try:
+return self.known_modules[fullname]
+except KeyError:
+raise ImportError("This loader does not know module " + fullname)
+
+def load_module(self, fullname):
+try:
+# in case of a reload
+return sys.modules[fullname]
+except KeyError:
+pass
+mod = self.__get_module(fullname)
+if isinstance(mod, MovedModule):
+mod = mod._resolve()
+else:
+mod.__loader__ = self
+sys.modules[fullname] = mod
+return mod
+
+def is_package(self, fullname):
+"""
+Return true, if the named module is a package.
+
+We need this method to get correct spec objects with
+Python 3.4 (see PEP451)
+"""
+return hasattr(self.__get_module(fullname), "__path__")
+
+def get_code(self, fullname):
+"""Return None
+
+Required, if is_package is implemented"""
+

[Libreoffice-commits] core.git: solenv/gdb

2019-05-16 Thread Jens Carl (via logerrit)
 solenv/gdb/autoload.template |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 84d8b0b7c442490a00925073950fb07d834eaf97
Author: Jens Carl 
AuthorDate: Wed May 15 10:11:47 2019 -0700
Commit: Michael Stahl 
CommitDate: Thu May 16 11:23:00 2019 +0200

Make gdb autoload template more pythonic

Replace vim modeline with Python specific one to avoid problems with
tabs and spaces, and also make code more pythonic.

Change-Id: Ia0959787ceea740b5c97f500c60ef423fbed0651
Reviewed-on: https://gerrit.libreoffice.org/72375
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/solenv/gdb/autoload.template b/solenv/gdb/autoload.template
index 816380e5cf8e..fdbcce200233 100644
--- a/solenv/gdb/autoload.template
+++ b/solenv/gdb/autoload.template
@@ -1,4 +1,4 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
 #
 # This file is part of the LibreOffice project.
 #
@@ -7,20 +7,20 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
+import importlib
 import os.path
 import sys
-import importlib
 
 import gdb
 
-pythondir = os.path.normpath('%PYTHONDIR%')
+PP_PATH = os.path.normpath('%PYTHONDIR%')
 
 if gdb.current_objfile():
-if pythondir not in sys.path:
-sys.path.insert(0, pythondir)
+if PP_PATH not in sys.path:
+sys.path.insert(0, PP_PATH)
 
-for mod in str.split("%MODULES%"):
-module=importlib.import_module("libreoffice."+mod)
+for mod in '%MODULES%'.split():
+module = importlib.import_module('libreoffice.' + mod)
 module.register_pretty_printers(gdb.current_objfile())
 
 try:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: solenv/gdb

2019-04-21 Thread Noel Grandin (via logerrit)
 solenv/gdb/libreoffice/tl.py |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 8859b4b5b04c863ebc9df67c20afd330feaadf00
Author: Noel Grandin 
AuthorDate: Sun Apr 21 18:15:23 2019 +0200
Commit: Noel Grandin 
CommitDate: Sun Apr 21 21:19:20 2019 +0200

fix gdb helper for Color

after
commit d487d6e082bc7ce652217578ffd37397a59cc3ca
Date:   Sat Apr 20 11:06:11 2019 +0900
rework Color to have R,G,B,A public variables

Change-Id: I0ebbb071d2fad43bd49ef8421804657dfdfc446d
Reviewed-on: https://gerrit.libreoffice.org/71041
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index dec0ae2f0d53..44f3c78210cb 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -44,11 +44,10 @@ class ColorPrinter(object):
 self.val = val
 
 def to_string(self):
-color = self.val['mnColor']
-b = color & 0xff
-g = (color >> 8) & 0xff
-r = (color >> 16) & 0xff
-a = (color >> 24) & 0xff
+r = self.val['R']
+g = self.val['G']
+b = self.val['B']
+a = self.val['A']
 if a:
 return "rgba(%d, %d, %d, %d)" % (r, g, b, a)
 else:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: solenv/gdb solenv/lldb solenv/vs

2018-10-25 Thread Libreoffice Gerrit user
 solenv/gdb/libreoffice/sal.py  |8 
 solenv/gdb/libreoffice/util/uno.py |2 +-
 solenv/lldb/libreoffice/LO.py  |4 ++--
 solenv/vs/LibreOffice.natvis   |6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 8ae4e64287643b7340e6e35bd16fffeac663e809
Author: Noel Grandin 
AuthorDate: Thu Oct 25 16:10:34 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 25 16:12:29 2018 +0200

fix gdb pretty printing

revert part of
commit 6f50961e69406a17d6ec998956a6b33208b1001b
remove more rtl::OUString and OString prefixes

Change-Id: I026f8175c855a20bab54940f6235bca5c91ddbab

diff --git a/solenv/gdb/libreoffice/sal.py b/solenv/gdb/libreoffice/sal.py
index 00923a7bfdb0..8dcfaebe66e1 100644
--- a/solenv/gdb/libreoffice/sal.py
+++ b/solenv/gdb/libreoffice/sal.py
@@ -147,10 +147,10 @@ def build_pretty_printers():
 printer.add('_rtl_String', RtlStringPrinter)
 printer.add('_rtl_uString', lambda name, val: RtlStringPrinter(name,
 val, 'utf-16le'))
-printer.add('OString', StringPrinter)
-printer.add('OUString', lambda name, val: StringPrinter(name, val, 
'utf-16'))
-printer.add('OStringBuffer', StringPrinter)
-printer.add('OUStringBuffer', lambda name, val: StringPrinter(name, val, 
'utf-16'))
+printer.add('rtl::OString', StringPrinter)
+printer.add('rtl::OUString', lambda name, val: StringPrinter(name, val, 
'utf-16'))
+printer.add('rtl::OStringBuffer', StringPrinter)
+printer.add('rtl::OUStringBuffer', lambda name, val: StringPrinter(name, 
val, 'utf-16'))
 printer.add('sal_Unicode', SalUnicodePrinter, SalUnicodePrinter.query)
 
 # other stuff
diff --git a/solenv/gdb/libreoffice/util/uno.py 
b/solenv/gdb/libreoffice/util/uno.py
index 3790f075f925..648ea408a6d5 100644
--- a/solenv/gdb/libreoffice/util/uno.py
+++ b/solenv/gdb/libreoffice/util/uno.py
@@ -223,7 +223,7 @@ def make_uno_type(val):
 elif type_class == TypeClass.DOUBLE:
 uno_type = PrimitiveType(type_class, name, 'double')
 elif type_class == TypeClass.STRING:
-uno_type = PrimitiveType(type_class, name, 'OUString')
+uno_type = PrimitiveType(type_class, name, 'rtl::OUString')
 elif type_class == TypeClass.TYPE:
 uno_type = PrimitiveType(type_class, name, 'com::sun::star::uno::Type')
 elif type_class == TypeClass.ANY:
diff --git a/solenv/lldb/libreoffice/LO.py b/solenv/lldb/libreoffice/LO.py
index 31088af2aa32..3c1134ccadc4 100644
--- a/solenv/lldb/libreoffice/LO.py
+++ b/solenv/lldb/libreoffice/LO.py
@@ -99,8 +99,8 @@ def sal_unicode_string(buffer_ptr, length):
 # Automatically install the above summary functions when this is loaded
 def __lldb_init_module(debugger, dict):
 debugger.HandleCommand("type summary add --skip-references 
--python-function LO.rtl_String_summary rtl_String")
-debugger.HandleCommand("type summary add --skip-pointers --skip-references 
--python-function LO.rtl_OString_summary OString")
+debugger.HandleCommand("type summary add --skip-pointers --skip-references 
--python-function LO.rtl_OString_summary rtl::OString")
 debugger.HandleCommand("type summary add --skip-references 
--python-function LO.rtl_uString_summary rtl_uString")
-debugger.HandleCommand("type summary add --skip-pointers --skip-references 
--python-function LO.rtl_OUString_summary OUString")
+debugger.HandleCommand("type summary add --skip-pointers --skip-references 
--python-function LO.rtl_OUString_summary rtl::OUString")
 
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis
index ad16550d0504..409ccd5919c8 100644
--- a/solenv/vs/LibreOffice.natvis
+++ b/solenv/vs/LibreOffice.natvis
@@ -8,11 +8,11 @@
  *
 -->
 http://schemas.microsoft.com/vstudio/debugger/natvis/2010;>
-  
+  
 {*pData}
 *pData,su
   
-  
+  
 {*pData}
 *pData,s
   
@@ -54,7 +54,7 @@
 {*((unsigned 
__int64*)pData),d} (UNSIGNED_HYPER)
 {*((float*)pData)} 
(FLOAT)
 {*((double*)pData)} 
(DOUBLE)
-{*((OUString*)pData)} 
(STRING)
+{*((rtl::OUString*)pData)} (STRING)
 {*((com::sun::star::uno::Type*)pData)} (TYPE)
 {*((_uno_Any*)pData)} 
(ANY)
 {*((sal_Int32*)pData),d} (ENUM)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2018-04-04 Thread Katarina Behrens
 solenv/gdb/libreoffice/svl.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3615931a8faf27befa7c0df3e27b68dbd184bda6
Author: Katarina Behrens 
Date:   Fri Mar 30 15:22:54 2018 +0200

Fix SfxItemSet pretty printer after some uniqueptr conversions

just whyyy are you people doing this, why do you gratuitously
break things others rely upon for productivity?!?? I don't give
a F about uniqueptrs, all I want is to be able to print this bloody
SfxItemSet. It's frustrating AF

Change-Id: I0b6110c1806c31a3c098fb9dc73883047191c7f9
Reviewed-on: https://gerrit.libreoffice.org/52362
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/solenv/gdb/libreoffice/svl.py b/solenv/gdb/libreoffice/svl.py
index 05049652c434..99a0fad70092 100644
--- a/solenv/gdb/libreoffice/svl.py
+++ b/solenv/gdb/libreoffice/svl.py
@@ -40,7 +40,7 @@ class ItemSetPrinter(object):
 for (whichfrom, whichto) in whichranges:
 size += whichto - whichfrom + 1
 whichids += [which for which in range(whichfrom, whichto+1)]
-return self._iterator(self.value['m_pItems'], size, whichids)
+return 
self._iterator(self.value['m_pItems']['_M_t']['_M_t']['_M_head_impl'], size, 
whichids)
 
 class _iterator(six.Iterator):
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2018-03-14 Thread Stephan Bergmann
 solenv/gdb/libreoffice/tl.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7a9a3c8941d9ebcf7660e622325c8ac28610571d
Author: Stephan Bergmann 
Date:   Wed Mar 14 14:59:47 2018 +0100

Adapt FractionPrinter

...to 048a32d903c8cc81a8836c7c7209b92e0bfd6cd7 "use unique_ptr for pImpl in
tools/", exploiting intimate knowledge of libstdc++ internals as was already
done in 51bb68928933bf5d72efb9193f1be6af6e72c80f "fix BigPtrArray pretty
printer".

Due to  "ptype does 
not
find inner C++ class type without -readnow", at least for me only works 
when gdb
is invoked with -readnow.

Change-Id: I365733f3c661eea2f19a9b85015aa5d50e63e6a4

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 2e096fc8d26c..670482027b7f 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -62,7 +62,7 @@ class FractionPrinter(object):
 self.val = val
 
 def to_string(self):
-impl = self.val['mpImpl'].dereference()
+impl = 
self.val['mpImpl']['_M_t']['_M_t']['_M_head_impl'].dereference().cast(gdb.lookup_type('Fraction::Impl'))
 numerator = impl['value']['num']
 denominator = impl['value']['den']
 if impl['valid']:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2017-11-08 Thread Michael Stahl
 solenv/gdb/libreoffice/basegfx.py |   26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 020a02c3477284daa3465e48afcc8257fb5a6201
Author: Michael Stahl 
Date:   Wed Nov 8 18:20:22 2017 +0100

gdb pretty-printers: avoid segfauls in B2DPolygonPrinter

gdb 8.0.1 tends to sefault while evaluating the getB2DPoint()
calls; it passes some obviously wrong index instead of 0.

Also, add a children method to B2DPolyPolygonPrinter.

Change-Id: Ifbf52ad384d1f60b26ee95f87405eff2c6f2388a

diff --git a/solenv/gdb/libreoffice/basegfx.py 
b/solenv/gdb/libreoffice/basegfx.py
index ec564b99c903..81901fe8dae8 100644
--- a/solenv/gdb/libreoffice/basegfx.py
+++ b/solenv/gdb/libreoffice/basegfx.py
@@ -86,12 +86,12 @@ class B2DPolygonPrinter(object):
 def __next__(self):
 if self.index >= self.count:
 raise StopIteration()
-currPoint = gdb.parse_and_eval(
-'((basegfx::B2DPolygon*)%d)->getB2DPoint(%d)' % (
-  self.value.address, self.index))
-currPoint = gdb.parse_and_eval(
-'((basegfx::B2DPolygon*)%d)->getB2DPoint(%d)' % (
-  self.value.address, self.index))
+points = 
self.value['mpPolygon']['m_pimpl'].dereference()['m_value']['maPoints']['maVector']
+currPoint = (points['_M_impl']['_M_start'] + 
self.index).dereference()
+# doesn't work?
+#currPoint = gdb.parse_and_eval(
+#'((basegfx::B2DPolygon*)%d)->getB2DPoint(%d)' % (
+#  self.value.address, self.index))
 self.index += 1
 return ('point %d' % (self.index-1),
 '(%15f, %15f)' % (currPoint['mfX'], currPoint['mfY']))
@@ -108,9 +108,11 @@ class B2DPolygonPrinter(object):
 def __next__(self):
 if self.index >= self.count:
 raise StopIteration()
-currPoint = gdb.parse_and_eval(
-'((basegfx::B2DPolygon*)%d)->getB2DPoint(%d)' % (
-  self.value.address, self.index))
+points = 
self.value['mpPolygon']['m_pimpl'].dereference()['m_value']['maPoints']['maVector']
+currPoint = (points['_M_impl']['_M_start'] + 
self.index).dereference()
+#currPoint = gdb.parse_and_eval(
+#'((basegfx::B2DPolygon*)%d)->getB2DPoint(%d)' % (
+#  self.value.address, self.index))
 prevControl = gdb.parse_and_eval(
 '((basegfx::B2DPolygon*)%d)->getPrevControlPoint(%d)' % (
   self.value.address, self.index))
@@ -150,6 +152,12 @@ class B2DPolyPolygonPrinter(object):
 def _isEmpty(self):
 return self._count() == 0
 
+def children(self):
+impl = self.value['mpPolyPolygon']['m_pimpl']
+vector = 
self.value['mpPolyPolygon']['m_pimpl'].dereference()['m_value']['maPolygons']
+import libstdcxx.v6.printers as std
+return std.StdVectorPrinter("std::vector", vector).children()
+
 printer = None
 
 def build_pretty_printers():
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2017-09-15 Thread Michael Stahl
 solenv/gdb/libreoffice/sw.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8c3b410ae36d3d82e455180c6acbf23f434d6108
Author: Michael Stahl 
Date:   Fri Sep 15 11:15:38 2017 +0200

solenv: fix GDB pretty-printers for SwNodes yet again

Change-Id: I1eb1efedb98979b692874ae0ec48120cb5a38188

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 7fd401b63049..e170709fb79c 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,7 +194,7 @@ class BigPtrArrayPrinter(object):
 class _iterator(six.Iterator):
 
 def __init__(self, array):
-self.blocks = array['m_ppInf']['_M_t']['_M_head_impl']
+self.blocks = array['m_ppInf']['_M_t']['_M_t']['_M_head_impl']
 self.count = array['m_nSize']
 self.pos = 0
 self.block_count = array['m_nBlock']
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2017-07-28 Thread Pranav Kant
 solenv/gdb/libreoffice/vcl.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 64eac4e0f8f25675efe72c95df0cb17789ba3559
Author: Pranav Kant 
Date:   Sat Jul 29 02:40:21 2017 +0530

Fix no longer valid comment

This was changed in d72aad218c9737fb19d1a835b03c13b7107a96c0

Change-Id: Ie93f603c82669ca612fbf9635a62c50e63702a85

diff --git a/solenv/gdb/libreoffice/vcl.py b/solenv/gdb/libreoffice/vcl.py
index 07f95a697689..6a99c9f21f7c 100644
--- a/solenv/gdb/libreoffice/vcl.py
+++ b/solenv/gdb/libreoffice/vcl.py
@@ -15,12 +15,12 @@ class ImplSchedulerDataPrinter(object):
 '''Prints the ImplSchedulerData linked list.
 
This can be used to dump the current state of the scheduler via:
-  p *ImplGetSVData()->mpFirstSchedulerData
+  p *ImplGetSVData()->maSchedCtx.mpFirstSchedulerData
 
This doesn't include currently invoked tasks AKA the stack.
 
To dump the scheduler stack of invoked tasks use:
-  p *ImplGetSVData()->mpSchedulerStack
+  p *ImplGetSVData()->maSchedCtx.mpSchedulerStack
 '''
 
 def __init__(self, typename, value):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2017-07-13 Thread Noel Grandin
 solenv/gdb/libreoffice/sw.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 51bb68928933bf5d72efb9193f1be6af6e72c80f
Author: Noel Grandin 
Date:   Thu Jul 13 12:39:02 2017 +0200

fix BigPtrArray pretty printer

after commit 64079184cc06444e9dfdb55a5c66829e929d4a59
"improve useuniqueptr loplugin to find arrays"

Change-Id: I29841af65fcb0c1f92e52d9aeee164328bbb4663

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 6c0165e3fc6b..7fd401b63049 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,7 +194,7 @@ class BigPtrArrayPrinter(object):
 class _iterator(six.Iterator):
 
 def __init__(self, array):
-self.blocks = array['m_ppInf']
+self.blocks = array['m_ppInf']['_M_t']['_M_head_impl']
 self.count = array['m_nSize']
 self.pos = 0
 self.block_count = array['m_nBlock']
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2017-07-07 Thread Noel Grandin
 solenv/gdb/libreoffice/sw.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be2481d193d6f7a2593cf5ce767894cac8e41435
Author: Noel Grandin 
Date:   Fri Jul 7 15:39:31 2017 +0200

re-add some gdb BigPtrArray pretty printing

After commit c6902761d797253cda8b3f71f102c66108585e24
"Revert "use std::vector in BigPtrArray""

 noelgrandin: you reverted both gdb changes but only one sw
change?
 mst_, I thought your gdb change only appliled to the
std::vector?
 noelgrandin: there was another std::something or other change
there, one was mvInfo and the other mvData
 mst_, sigh, will fix that

Change-Id: I3059d29b1a559eb3077f5d713be011e15e887ee0

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index cfb3cec3eeb7..6c0165e3fc6b 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -246,7 +246,7 @@ class BigPtrArrayPrinter(object):
 raise StopIteration()
 
 name = str(self.pos)
-node = self.block['pData'][self.pos - self.block['nStart']]
+node = self.block['mvData']['_M_elems'][self.pos - 
self.block['nStart']]
 value =  self._node_value(node)
 if self.pos == self.block['nEnd']:
 self._next_block()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb sw/inc sw/source

2017-07-07 Thread Noel Grandin
 solenv/gdb/libreoffice/sw.py |6 +-
 sw/inc/bparr.hxx |7 +-
 sw/source/core/bastyp/bparr.cxx  |  113 ---
 sw/source/core/docnode/nodes.cxx |2 
 4 files changed, 80 insertions(+), 48 deletions(-)

New commits:
commit c6902761d797253cda8b3f71f102c66108585e24
Author: Noel Grandin 
Date:   Fri Jul 7 10:53:38 2017 +0200

Revert "use std::vector in BigPtrArray"

which is causing crashes in the crashtesting in
ooo119635-3.docx and ooo119568-2.docx

It is definitely some kind of use-after-free error, but the
compress and delete logic for BigPtrArray is too hairy for me
to debug right now.

This reverts commit 1eee0abd459a508a6dcf9e71cbf2c1be3725faa7.

Also revert commit 4f743419a04375160437a910254c45dea396f70d
"gdb pretty-printers: fix BigPtrArrayPrinter after recent std::isation"

Change-Id: Id870876432a060f9347aafb43bf0df692ea24464
Reviewed-on: https://gerrit.libreoffice.org/39684
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 031963f5c789..cfb3cec3eeb7 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,10 +194,10 @@ class BigPtrArrayPrinter(object):
 class _iterator(six.Iterator):
 
 def __init__(self, array):
-self.blocks = array['m_vpInf']['_M_impl']['_M_start']
+self.blocks = array['m_ppInf']
 self.count = array['m_nSize']
 self.pos = 0
-self.block_count = array['m_vpInf']['_M_impl']['_M_finish'] - 
array['m_vpInf']['_M_impl']['_M_start']
+self.block_count = array['m_nBlock']
 self.block_pos = 0
 self.block = None
 self.indent = ""
@@ -246,7 +246,7 @@ class BigPtrArrayPrinter(object):
 raise StopIteration()
 
 name = str(self.pos)
-node = self.block['mvData']['_M_elems'][self.pos - 
self.block['nStart']]
+node = self.block['pData'][self.pos - self.block['nStart']]
 value =  self._node_value(node)
 if self.pos == self.block['nEnd']:
 self._next_block()
diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx
index 04b77eb16dee..962736c49ce3 100644
--- a/sw/inc/bparr.hxx
+++ b/sw/inc/bparr.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 struct BlockInfo;
 class BigPtrArray;
@@ -64,14 +63,16 @@ struct BlockInfo final
 class SW_DLLPUBLIC BigPtrArray
 {
 protected:
-std::vector
-m_vpInf;  ///< block info
+BlockInfo** m_ppInf;  ///< block info
 sal_uLong   m_nSize;  ///< number of elements
+sal_uInt16  m_nMaxBlock;  ///< current max. number of blocks
+sal_uInt16  m_nBlock; ///< number of blocks
 mutable
 sal_uInt16  m_nCur;   ///< last used block
 
 sal_uInt16  Index2Block( sal_uLong ) const; ///< block search
 BlockInfo*  InsBlock( sal_uInt16 ); ///< insert block
+voidBlockDel( sal_uInt16 ); ///< some blocks were deleted
 voidUpdIndex( sal_uInt16 ); ///< recalculate indices
 
 // fill all blocks
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 8d7124a470ac..446d22ef154c 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include 
 
 /** Resize block management by this constant.
 As a result there are approx. 20 * MAXENTRY == 2 entries available */
@@ -48,21 +47,23 @@ void CheckIdx( BlockInfo** ppInf, sal_uInt16 nBlock, 
sal_uLong nSize, sal_uInt16
 
 BigPtrArray::BigPtrArray()
 {
-m_nCur = 0;
+m_nBlock = m_nCur = 0;
 m_nSize = 0;
-m_vpInf.reserve( nBlockGrowSize );
+m_nMaxBlock = nBlockGrowSize;
+m_ppInf = new BlockInfo* [ m_nMaxBlock ];
 }
 
 BigPtrArray::~BigPtrArray()
 {
-if( m_vpInf.size() )
+if( m_nBlock )
 {
-BlockInfo** pp = m_vpInf.data();
-for( sal_uInt16 n = 0; n < sal_uInt16(m_vpInf.size()); ++n, ++pp )
+BlockInfo** pp = m_ppInf;
+for( sal_uInt16 n = 0; n < m_nBlock; ++n, ++pp )
 {
 delete *pp;
 }
 }
+delete[] m_ppInf;
 }
 
 // Also moving is done simply here. Optimization is useless because of the
@@ -72,7 +73,7 @@ void BigPtrArray::Move( sal_uLong from, sal_uLong to )
 if (from != to)
 {
 sal_uInt16 cur = Index2Block( from );
-BlockInfo* p = m_vpInf[ cur ];
+BlockInfo* p = m_ppInf[ cur ];
 BigPtrEntry* pElem = p->mvData[ from - p->nStart ];
 Insert( pElem, to ); // insert first, then delete!
 Remove( ( to < from ) ? ( from + 1 ) : from );
@@ -83,7 +84,7 @@ BigPtrEntry* 

[Libreoffice-commits] core.git: solenv/gdb

2017-06-28 Thread Michael Stahl
 solenv/gdb/libreoffice/sw.py |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4f743419a04375160437a910254c45dea396f70d
Author: Michael Stahl 
Date:   Wed Jun 28 18:08:03 2017 +0200

gdb pretty-printers: fix BigPtrArrayPrinter after recent std::isation

Change-Id: Ie98f080fbb0efb807dcb2fb7893811f68e831a8f

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index cfb3cec3eeb7..031963f5c789 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,10 +194,10 @@ class BigPtrArrayPrinter(object):
 class _iterator(six.Iterator):
 
 def __init__(self, array):
-self.blocks = array['m_ppInf']
+self.blocks = array['m_vpInf']['_M_impl']['_M_start']
 self.count = array['m_nSize']
 self.pos = 0
-self.block_count = array['m_nBlock']
+self.block_count = array['m_vpInf']['_M_impl']['_M_finish'] - 
array['m_vpInf']['_M_impl']['_M_start']
 self.block_pos = 0
 self.block = None
 self.indent = ""
@@ -246,7 +246,7 @@ class BigPtrArrayPrinter(object):
 raise StopIteration()
 
 name = str(self.pos)
-node = self.block['pData'][self.pos - self.block['nStart']]
+node = self.block['mvData']['_M_elems'][self.pos - 
self.block['nStart']]
 value =  self._node_value(node)
 if self.pos == self.block['nEnd']:
 self._next_block()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2017-04-04 Thread Stephan Bergmann
 solenv/gdb/libreoffice/util/uno.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3e0d46249b92f3be3355364b68014ef6a4329391
Author: Stephan Bergmann 
Date:   Tue Apr 4 15:58:25 2017 +0200

Missing str(...) when an arg is itself a css::uno::Sequence<...>

Change-Id: I54529e7086014a2feba89eb73f3b368d36f758b8

diff --git a/solenv/gdb/libreoffice/util/uno.py 
b/solenv/gdb/libreoffice/util/uno.py
index a80fdd856d0d..648ea408a6d5 100644
--- a/solenv/gdb/libreoffice/util/uno.py
+++ b/solenv/gdb/libreoffice/util/uno.py
@@ -97,7 +97,7 @@ class TemplateType(object):
 self.args = args
 
 def __str__(self):
-argtypes = [str(gdb.lookup_type(arg).strip_typedefs()) for arg in 
self.args]
+argtypes = [str(gdb.lookup_type(str(arg)).strip_typedefs()) for arg in 
self.args]
 return self.template + '<' + ', '.join(argtypes) + '>'
 
 class Type(object):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2016-06-16 Thread Stephan Bergmann
 solenv/gdb/libreoffice/cppu.py |   18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 8132c691dea66f9e402161ff8fac8e31f313b72d
Author: Stephan Bergmann 
Date:   Thu Jun 16 14:53:06 2016 +0200

Improve output of UnoAnyPrinter

Change-Id: I1461264fe7f951c9ecec777c6217d0acfb7e4254

diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py
index 1ab2b6e..5114dbe 100644
--- a/solenv/gdb/libreoffice/cppu.py
+++ b/solenv/gdb/libreoffice/cppu.py
@@ -20,22 +20,16 @@ class UnoAnyPrinter(object):
 self.typename = typename.replace('com::sun::star::', '')
 
 def to_string(self):
-if self._is_set():
-return ('%s %s' % (self.typename, self._make_string()))
-else:
-return "empty %s" % self.typename
-
-def _is_set(self):
-return self.value['pType'].dereference()['eTypeClass'] != 
TypeClass.VOID
-
-def _make_string(self):
-ptr = self.value['pData']
-assert ptr
 type_desc = self.value['pType']
 assert type_desc
 type = make_uno_type(type_desc.dereference())
 assert type
-return str(uno_cast(type, ptr).dereference())
+if type_desc.dereference()['eTypeClass'] == TypeClass.VOID:
+return ('%s(%s)' % (self.typename, type.tag))
+else:
+ptr = self.value['pData']
+assert ptr
+return ('%s(%s: %s)' % (self.typename, type.tag, 
str(uno_cast(type, ptr).dereference(
 
 class UnoReferencePrinter(object):
 '''Prints reference to a UNO interface'''
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2015-05-26 Thread Miklos Vajna
 solenv/gdb/libreoffice/sw.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 390aa6277af88ef6d0f4c38a503848d01e801875
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue May 26 12:48:13 2015 +0200

gdb: SwTxtNode - SwTextNode

Fixes the unexpected ' ~DeletedNode' lines in the output.

Change-Id: I1f59c2cd986addd08e632d0bc1cc53b33048db77

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 71445d5..fa73759 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -209,7 +209,7 @@ class BigPtrArrayPrinter(object):
 
 def _node_value(self, node):
 cur_indent = self.indent
-if str(node.dynamic_type.target()) == SwTxtNode:
+if str(node.dynamic_type.target()) == SwTextNode:
 # accessing this is completely non-obvious...
 # also, node.dynamic_cast(node.dynamic_type) is null?
 value = TextNode  + \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2015-01-27 Thread Stephan Bergmann
 solenv/gdb/libreoffice/tl.py |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 61cc3f285a3d32b754435d1a1b513abeca8fb4e7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jan 27 17:34:44 2015 +0100

Adapt FractionPrinter

Change-Id: Ibc6302ea52458874f748f3ec2757bb60ad742fce

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index cc02b09..2ef02bd 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -63,9 +63,10 @@ class FractionPrinter(object):
 self.val = val
 
 def to_string(self):
-numerator = self.val['value']['num']
-denominator = self.val['value']['den']
-if self.val['valid']:
+impl = self.val['mpImpl'].dereference()
+numerator = impl['value']['num']
+denominator = impl['value']['den']
+if impl['valid']:
 return %d/%d % (numerator, denominator)
 else:
 return invalid %s %d/%d % (self.typename, numerator, denominator)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2014-11-10 Thread Stephan Bergmann
 solenv/gdb/libreoffice/tl.py |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 097926de45ac5240b96045664fa3ee32d5612c48
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Nov 10 09:10:32 2014 +0100

Adapt FractionPrinter

Change-Id: Ic297f14ea1bf5f3fa69c80a34439b5d13fc84346

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 8fb337d..cc02b09 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -63,9 +63,9 @@ class FractionPrinter(object):
 self.val = val
 
 def to_string(self):
-numerator = self.val['nNumerator']
-denominator = self.val['nDenominator']
-if denominator  0:
+numerator = self.val['value']['num']
+denominator = self.val['value']['den']
+if self.val['valid']:
 return %d/%d % (numerator, denominator)
 else:
 return invalid %s %d/%d % (self.typename, numerator, denominator)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2014-11-10 Thread Stephan Bergmann
 solenv/gdb/boost/smart_ptr.py |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit e639c4e2a43d4378af263f062b3ca06af8ed8c15
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Nov 10 15:29:11 2014 +0100

Do not deref (potentially dangling) weak_ptr

Change-Id: Ic9694aa8bd85fe0548b8f5fc5f52b4bbd6dce1cf

diff --git a/solenv/gdb/boost/smart_ptr.py b/solenv/gdb/boost/smart_ptr.py
index 6646e12..60d8827 100644
--- a/solenv/gdb/boost/smart_ptr.py
+++ b/solenv/gdb/boost/smart_ptr.py
@@ -41,6 +41,16 @@ class SmartPtrPrinter:
 else:
 return empty %s % (self.typename)
 
+class WeakPtrPrinter:
+Prints boost::weak_ptr instances
+
+def __init__(self, typename, value):
+self.typename = typename
+self.value = value
+
+def to_string(self):
+value = self.value['px']
+return %s %s % (self.typename, value)
 
 printer = None
 
@@ -54,7 +64,7 @@ def build_pretty_printers():
 
 printer.add('boost::shared_ptr', SmartPtrPrinter)
 # printer.add('boost::shared_array', SmartPtrPrinter)
-printer.add('boost::weak_ptr', SmartPtrPrinter)
+printer.add('boost::weak_ptr', WeakPtrPrinter)
 printer.add('boost::scoped_ptr', SmartPtrPrinter)
 # printer.add('boost::scoped_array', SmartPtrPrinter)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2014-10-24 Thread Stephan Bergmann
 solenv/gdb/libreoffice/tl.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5aebe7b67c02051cb4fe98219cfe056efaf975a1
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Oct 24 14:55:42 2014 +0200

More useful pretty printing of invalid fractions

Change-Id: I5e118182e146645ee8546c69edf21834117a1129

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 816de7b..8fb337d 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -68,7 +68,7 @@ class FractionPrinter(object):
 if denominator  0:
 return %d/%d % (numerator, denominator)
 else:
-return invalid %s % self.typename
+return invalid %s %d/%d % (self.typename, numerator, denominator)
 
 class DateTimeImpl(object):
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/gdb

2013-11-15 Thread Jan-Marek Glogowski
 solenv/gdb/six.py |  577 ++
 1 file changed, 577 insertions(+)

New commits:
commit 118d63cd5214c47540e9b78b8f15dabacdf7114f
Author: Jan-Marek Glogowski glo...@fbihome.de
Date:   Fri Nov 15 17:52:07 2013 +0100

Import Python six v1.4.1.

Python six just consists of a single Python file, so this includes
the file as a convenience.

Change-Id: I98ed50fba657013f5f3f12a4d13b3ba5558bfa2e
Reviewed-on: https://gerrit.libreoffice.org/6687
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/solenv/gdb/six.py b/solenv/gdb/six.py
new file mode 100644
index 000..85898ec
--- /dev/null
+++ b/solenv/gdb/six.py
@@ -0,0 +1,577 @@
+Utilities for writing code that runs on Python 2 and 3
+
+# Copyright (c) 2010-2013 Benjamin Peterson
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the Software), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in 
all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import operator
+import sys
+import types
+
+__author__ = Benjamin Peterson benja...@python.org
+__version__ = 1.4.1
+
+
+# Useful for very coarse version differentiation.
+PY2 = sys.version_info[0] == 2
+PY3 = sys.version_info[0] == 3
+
+if PY3:
+string_types = str,
+integer_types = int,
+class_types = type,
+text_type = str
+binary_type = bytes
+
+MAXSIZE = sys.maxsize
+else:
+string_types = basestring,
+integer_types = (int, long)
+class_types = (type, types.ClassType)
+text_type = unicode
+binary_type = str
+
+if sys.platform.startswith(java):
+# Jython always uses 32 bits.
+MAXSIZE = int((1  31) - 1)
+else:
+# It's possible to have sizeof(long) != sizeof(Py_ssize_t).
+class X(object):
+def __len__(self):
+return 1  31
+try:
+len(X())
+except OverflowError:
+# 32-bit
+MAXSIZE = int((1  31) - 1)
+else:
+# 64-bit
+MAXSIZE = int((1  63) - 1)
+del X
+
+
+def _add_doc(func, doc):
+Add documentation to a function.
+func.__doc__ = doc
+
+
+def _import_module(name):
+Import module, returning the module after the last dot.
+__import__(name)
+return sys.modules[name]
+
+
+class _LazyDescr(object):
+
+def __init__(self, name):
+self.name = name
+
+def __get__(self, obj, tp):
+result = self._resolve()
+setattr(obj, self.name, result)
+# This is a bit ugly, but it avoids running this again.
+delattr(tp, self.name)
+return result
+
+
+class MovedModule(_LazyDescr):
+
+def __init__(self, name, old, new=None):
+super(MovedModule, self).__init__(name)
+if PY3:
+if new is None:
+new = name
+self.mod = new
+else:
+self.mod = old
+
+def _resolve(self):
+return _import_module(self.mod)
+
+
+class MovedAttribute(_LazyDescr):
+
+def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
+super(MovedAttribute, self).__init__(name)
+if PY3:
+if new_mod is None:
+new_mod = name
+self.mod = new_mod
+if new_attr is None:
+if old_attr is None:
+new_attr = name
+else:
+new_attr = old_attr
+self.attr = new_attr
+else:
+self.mod = old_mod
+if old_attr is None:
+old_attr = name
+self.attr = old_attr
+
+def _resolve(self):
+module = _import_module(self.mod)
+return getattr(module, self.attr)
+
+
+
+class _MovedItems(types.ModuleType):
+Lazy loading of moved objects
+
+
+_moved_attributes = [
+MovedAttribute(cStringIO, cStringIO, io, StringIO),
+MovedAttribute(filter, itertools, builtins, ifilter, filter),
+MovedAttribute(filterfalse, itertools, itertools, ifilterfalse, 
filterfalse),
+

[Libreoffice-commits] core.git: solenv/gdb

2013-11-15 Thread Jan-Marek Glogowski
 solenv/gdb/boost/lib/unordered.py   |5 +++--
 solenv/gdb/boost/ptr_container.py   |   17 +
 solenv/gdb/boost/unordered.py   |9 +
 solenv/gdb/boost/util/printing.py   |3 ++-
 solenv/gdb/libreoffice/basegfx.py   |9 +
 solenv/gdb/libreoffice/cppu.py  |6 --
 solenv/gdb/libreoffice/sal.py   |3 ++-
 solenv/gdb/libreoffice/svl.py   |5 +++--
 solenv/gdb/libreoffice/sw.py|5 +++--
 solenv/gdb/libreoffice/tl.py|5 +++--
 solenv/gdb/libreoffice/util/printing.py |3 ++-
 solenv/gdb/libreoffice/util/uno.py  |   17 +
 12 files changed, 50 insertions(+), 37 deletions(-)

New commits:
commit c5b7cc9598f4a9a5c7c42c1ccd06765dc17b4c24
Author: Jan-Marek Glogowski glo...@fbihome.de
Date:   Thu Nov 14 12:14:29 2013 +0100

Add Python 3 compatibility to GDB pretty printers.

GDB on *buntu is linked against Python 3.3, which has many
incompatibilities to Python 2, resulting in broken code.

This patch uses the Python six library as a compatibility layer.

Change-Id: Icb4cc54a1d05afb119376bb5e1430c91cb794d08
Reviewed-on: https://gerrit.libreoffice.org/6688
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/solenv/gdb/boost/lib/unordered.py 
b/solenv/gdb/boost/lib/unordered.py
index eecfa79..ee58d04 100644
--- a/solenv/gdb/boost/lib/unordered.py
+++ b/solenv/gdb/boost/lib/unordered.py
@@ -19,6 +19,7 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
 import gdb
+import six
 
 class Unordered(object):
 '''Common representation of Boost.Unordered types'''
@@ -57,7 +58,7 @@ class Unordered(object):
 assert node_type != None
 return node_type
 
-class _iterator(object):
+class _iterator(six.Iterator):
 '''Iterator for Boost.Unordered types'''
 
 def __init__(self, first_bucket, last_bucket, node_type, extractor):
@@ -71,7 +72,7 @@ class Unordered(object):
 def __iter__(self):
 return self
 
-def next(self):
+def __next__(self):
 if self.node:
 self.node = self.node.dereference()['next_']
 
diff --git a/solenv/gdb/boost/ptr_container.py 
b/solenv/gdb/boost/ptr_container.py
index 9e9a66f..38f3b2f 100644
--- a/solenv/gdb/boost/ptr_container.py
+++ b/solenv/gdb/boost/ptr_container.py
@@ -20,6 +20,7 @@
 
 
 import gdb
+import six
 
 from boost.lib.unordered import Map, Set
 
@@ -59,7 +60,7 @@ class PtrStdPrinterBase(object):
 def children(self):
 return self._iterator(self.sequence, 
self.value.type.template_argument(0))
 
-class _iterator(object):
+class _iterator(six.Iterator):
 
 def __init__(self, sequence, type):
 self.impl = iter(sequence)
@@ -68,7 +69,7 @@ class PtrStdPrinterBase(object):
 def __iter__(self):
 return self
 
-def next(self):
+def __next__(self):
 (index, value) = self.impl.next()
 return (index, value.cast(self.type).dereference())
 
@@ -124,7 +125,7 @@ class PtrMapPrinter(PtrStdPrinterBase):
 type = self.value.type
 return self._iterator(self.sequence, type.template_argument(0), 
type.template_argument(1))
 
-class _iterator(object):
+class _iterator(six.Iterator):
 
 def __init__(self, sequence, key_type, value_type):
 self.impl = iter(sequence)
@@ -135,7 +136,7 @@ class PtrMapPrinter(PtrStdPrinterBase):
 def __iter__(self):
 return self
 
-def next(self):
+def __next__(self):
 (index, value) = self.impl.next()
 if self.key:
 value = value.cast(self.key_type)
@@ -176,7 +177,7 @@ class PtrUnorderedMapPrinter(PtrBoostPrinterBase):
 def display_hint(self):
 return 'map'
 
-class _iterator(object):
+class _iterator(six.Iterator):
 
 def __init__(self, impl, value_type):
 self.impl = impl
@@ -187,7 +188,7 @@ class PtrUnorderedMapPrinter(PtrBoostPrinterBase):
 def __iter__(self):
 return self
 
-def next(self):
+def __next__(self):
 if self.step:
 self.value = self.impl.next()
 value = self.value[0]
@@ -205,7 +206,7 @@ class PtrUnorderedSetPrinter(PtrBoostPrinterBase):
 def display_hint(self):
 return 'array'
 
-class _iterator(object):
+class _iterator(six.Iterator):
 
 def __init__(self, impl, value_type):
 self.impl = impl
@@ -214,7 +215,7 @@ class PtrUnorderedSetPrinter(PtrBoostPrinterBase):
 def __iter__(self):
 return self
 
-def next(self):
+def __next__(self):
 return (, 
self.impl.next()[1].cast(self.value_type).dereference())
 
 printer = None
diff --git a/solenv/gdb/boost/unordered.py 

[Libreoffice-commits] core.git: solenv/gdb

2013-04-10 Thread Miklos Vajna
 solenv/gdb/libreoffice/cppu.py |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 3a994cd0b649df5233d8a23b4672f6a88d7599f5
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Apr 10 14:38:58 2013 +0200

gdb: make uno::Reference output shorter

The original idea to dereference the implementation and show all details
sounded nice, but now printing any UNO object that is a bit more complex
results in a multi-page output, which makes getting backtraces really
hard. Better to just show the dynamic type and the pointer.

Change-Id: I340a31b27b059c3d03d9e537de519e286af2e50f

diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py
index 83c4bff..c60e125 100644
--- a/solenv/gdb/libreoffice/cppu.py
+++ b/solenv/gdb/libreoffice/cppu.py
@@ -64,8 +64,7 @@ class UnoReferencePrinter(object):
 iface = self.value['_pInterface']
 if iface:
 try:
-impl = iface.cast(iface.dynamic_type).dereference()
-return '%s to %s' % (self.typename, str(impl))
+return '%s to (%s) %s' % (self.typename, 
str(iface.dynamic_type), str(iface))
 except:
 # fallback for potential problem:
 # base class 'com::sun::star::uno::XInterface' is ambiguous
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits