diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-12 21:00:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-12 23:47:20 +0200 |
commit | 3672cdd35985201ea87463cf032fedd02c052f4d (patch) | |
tree | 5c010e491ce79f915469e039f201afb9860b332a /sw | |
parent | 75d78b09438dcfa045626efd9f19d4a91a031e26 (diff) |
sw: resurrect dbg_lay functionality
Example instdir/program/dbg_lay.ini:
# 0x0007ffff
[record] 524287
This logs all functions and all frames. To have it:
1) Don't mention hex values in the example, support for this was removed
in ef513fd4b049b214a03fbe6e62a5ea43680a7a9b (remove unnecessary use of
OString::getStr, 2017-05-26).
2) "all frame IDs" is represented with a nullptr, so don't clear it
unconditionally.
3) Fix two other regressions from bytestring conversion in commit
778ef20d74ce499e4e0c4b0e3e4506b44938b975 (sw now ByteString free except
for windows related ones, 2011-11-04).
(Additionally you need a dbgutil build, dbg_lay.go has to exists in the
same dir, and output goes to dbg_lay.out in the same dir.)
Change-Id: Ida0f3032f11225f1d079cdcbb05ec64c42a71e5d
Reviewed-on: https://gerrit.libreoffice.org/43347
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/dbg_lay.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index 23c3d879306a..2baa1a7bd469 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -82,8 +82,8 @@ * listed; default is 0 which means that none are logged. It's also * possible to remove functions using '!'. * An example INI file: - * #Functions: all, except PRTARE - * [record] 0xFFFFFFFE !0x200 + * #Functions: all(0x0007ffff), except PrintArea (0x200) + * [record] 524287 !512 * [frmid] * #the following FrameIds: * 1 2 12 13 14 15 @@ -282,7 +282,8 @@ SwImplProtocol::~SwImplProtocol() pStream->Close(); delete pStream; } - pFrameIds->clear(); + if (pFrameIds) + pFrameIds->clear(); delete pFrameIds; aVars.clear(); } @@ -339,7 +340,7 @@ void SwImplProtocol::CheckLine( OString& rLine ) { OString aTok = rLine.getToken( 0, ' ', nIndex ); bool bNo = false; - if( '!' == aTok[0] ) + if( !aTok.isEmpty() && '!' == aTok[0] ) { bNo = true; // remove this function/type aTok = aTok.copy(1); @@ -407,7 +408,7 @@ void SwImplProtocol::FileInit() aLine.clear(); } else - aLine = OString(c); + aLine += OString(c); } if( !aLine.isEmpty() ) CheckLine( aLine ); // evaluate last line |