summaryrefslogtreecommitdiff
path: root/tools/source/debug/debug.cxx
AgeCommit message (Collapse)AuthorFilesLines
2019-12-18tools: define DbgTestSolarMutex() unconditionallyMiklos Vajna1-4/+0
See the discussion at <https://gerrit.libreoffice.org/#/c/58170/>, and this came up on IRC today again. The above change broke the invariant that you can mix product and debug (but not dbgutil) builds. Restore this, without mandating dbgutil for the solar mutex assert code, which is useful for plain debug builds as well. Change-Id: I1f8bdb114b129fc4f39f186ba917e35e346a16b5 Reviewed-on: https://gerrit.libreoffice.org/85369 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann1-0/+4
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-21tdf#128862: fix HSQLDB odb-files with apostrophe crashJulien Nabet1-0/+2
see bt: 0 0x00007ffff209866a in std::type_info::name() const (this=0x0) at /usr/include/c++/9/typeinfo:100 1 0x00007ffff20966e1 in exceptionToStringImpl(rtl::OStringBuffer&, com::sun::star::uno::Any const&) (sMessage="DBG_UNHANDLED_EXCEPTION in bool connectivity::hsqldb::OHsqlConnection::impl_isTextTable_nothrow(const rtl::OUString&) exception: com.sun.star.sdbc.SQLException message: Unexpected token: S in statemen"..., caught= uno::Any("com.sun.star.sdbc.SQLException": {<com::sun::star::uno::Exception> = {Message = "Unexpected token: S in statement [s]", Context = uno::Reference to (com::sun::star::uno::XInterface *) 0x555559269238}, SQLState = "37000", ErrorCode = -11, NextException = uno::Any(void)})) at /home/julien/lo/libreoffice/tools/source/debug/debug.cxx:113 2 0x00007ffff209855d in DbgUnhandledException(com::sun::star::uno::Any const&, char const*, char const*, char const*, char const*) (caught= uno::Any("com.sun.star.sdbc.SQLException": {<com::sun::star::uno::Exception> = {Message = "Unexpected token: S in statement [s]", Context = uno::Reference to (com::sun::star::uno::XInterface *) 0x555559269238}, SQLState = "37000", ErrorCode = -11, NextException = uno::Any(void)}), currentFunction=0x7fffdb5ca340 "bool connectivity::hsqldb::OHsqlConnection::impl_isTextTable_nothrow(const rtl::OUString&)", fileAndLineNo=0x7fffdb5ca2e8 "/home/julien/lo/libreoffice/connectivity/source/drivers/hsqldb/HConnection.cxx:301: ", area=0x7fffdb5c9f49 "connectivity.hsqldb", explanatory=0x0) at /home/julien/lo/libreoffice/tools/source/debug/debug.cxx:418 3 0x00007fffdb58a16a in connectivity::hsqldb::OHsqlConnection::impl_isTextTable_nothrow(rtl::OUString const&) (this=0x555558a43de0, _rTableName="William Kidwell's Address Book") at /home/julien/lo/libreoffice/connectivity/source/drivers/hsqldb/HConnection.cxx:301 https://bugs.documentfoundation.org/attachment.cgi?id=155952 Change-Id: I2bc744164b1470d8f09bcb126b02e48af180e886 Reviewed-on: https://gerrit.libreoffice.org/83245 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-03size some stringbuffer to prevent re-allocNoel Grandin1-1/+1
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512. Change-Id: I55fe36b31cd3d40f86e5729337a927cf920f2af6 Reviewed-on: https://gerrit.libreoffice.org/81960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-26size some stringbuffer to prevent re-allocNoel Grandin1-1/+2
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08loplugin:redundantpointerops simplify *p.get()Noel Grandin1-1/+1
Change-Id: I12517651fb3f777fd08e384992bb3e84b340ad85 Reviewed-on: https://gerrit.libreoffice.org/80382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-02loplugin:stringadd in tools..unotoolsNoel Grandin1-99/+106
Change-Id: I441a5ccef6adc8be8029178e304ff3044e812e2a Reviewed-on: https://gerrit.libreoffice.org/79986 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18loplugin:logexceptionnicely in toolkit..unoxmlNoel Grandin1-0/+9
Change-Id: I0a3126545f9ef98640f6dd166290e9b9e91b8355 Reviewed-on: https://gerrit.libreoffice.org/74244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-08AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete)Stephan Bergmann1-1/+2
__cxa_demangle uses malloc/free for memory management, see <http://itanium-cxx-abi.github.io/cxx-abi/abi.html#demangler> Change-Id: I57f8465d1c70fbef4537068fd3aefc52295e1c63 Reviewed-on: https://gerrit.libreoffice.org/71942 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-07fix leak in exceptionToStringNoel Grandin1-0/+3
need to release the pointer we get back from demangle Change-Id: I74f1065006fe0cd5da79d0ec5caa514d216be9a1 Reviewed-on: https://gerrit.libreoffice.org/71859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30tdf#42949 Fix IWYU warnings in tools/Gabor Kelemen1-14/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I47974f5c24819eb60e6724f42d51bb206dc26d21 Reviewed-on: https://gerrit.libreoffice.org/71557 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-19pretty up logging of exceptionsNoel Grandin1-38/+318
Add exceptionToString() and getCaughtExceptionAsString() methods in tools. Use the new methods in DbgUnhandledException() Add special-case case code for most of the exceptions that contain extra fields, so all of the relevant data ends up in the log Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece Reviewed-on: https://gerrit.libreoffice.org/67857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30make DBG_TESTSOLARMUTEX available in assert buildsNoel Grandin1-1/+1
where our QA people are more likely to trigger it Change-Id: I4ce7c8c72e7e21f2296c0f9cc9f019aaef32ed0b Reviewed-on: https://gerrit.libreoffice.org/58170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-26demangle context type name in DBG_UNHANDLED_EXCEPTIONNoel Grandin1-0/+9
Change-Id: I59591d0209ddf2bcf6e57a78dc7999d773b73ae3 Reviewed-on: https://gerrit.libreoffice.org/54805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-02give DBG_UNHANDLED_EXCEPTION_WHEN an area parameterNoel Grandin1-2/+5
and rename it to DBG_UNHANDLED_EXCEPTION, to make it more like the SAL_WARN-type macros. Use some macro magic to deal with different numbers of arguments. Update the sallogareas plugin to check the area parameter of DBG_UNHANDLED_EXCEPTION. Change-Id: Ie790223244c3484f41acb3679c043fb9b438e7c4 Reviewed-on: https://gerrit.libreoffice.org/52073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-11-25introduce DBG_UNHANDLED_EXCEPTION_WHEN for calls with an explanatory messageEike Rathke1-1/+7
Change-Id: Ic80f2ed2c0fdff20d1ee1968bec2840bf914fb5e
2016-06-13improve formatting of DBG_UNHANDLED_EXCEPTION messageNoel Grandin1-7/+6
put more useful info on the same line, and indent following lines, to visually separate them from new log messages. Change-Id: Ieda71aebf68420a0521ce98c621b0236d533bc53
2016-06-09reduce "no DbgTestSolarMutex function set" warningNoel Grandin1-19/+15
Change-Id: I68c67e77a2759c8542dd4a44a78a9fcf8aa7dcc0 Reviewed-on: https://gerrit.libreoffice.org/26056 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-3/+3
Change-Id: Ia5acfb564f913d52cd25b5d64d06b5280b94cb72
2015-11-09com::sun::star->css in tools/ and ucb/Noel Grandin1-3/+3
Change-Id: I695ff721efd63b8ca0dd3c61ba5a4fef2c43cde6 Reviewed-on: https://gerrit.libreoffice.org/19854 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-08Avoid pain when using selective debuginfoTor Lillqvist1-6/+3
Compile in the DbgUnhandledException function always. Change-Id: I302954598e599e8db71967974b18ade54ca2de13
2015-08-26Bin the fairly useless DbgDialog stuff and handle falloutTor Lillqvist1-245/+16
See (short) discussion on the mailing list, "How was it again, is the DbgDialog useful?". Change-Id: Ibde1eb13f16edf94f1f7aebd0befd1b0b171d5c4
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann1-1/+1
Change-Id: Iedee28da32a4333a414e06877f87851345bb4e9b
2015-01-05Some loplugin:revisibility clean-upStephan Bergmann1-1/+1
Stumbled across such redundant visibility re-specifications when looking at the odd case of cppu_unsatisfied_iquery_msg declared CPPU_DLLPUBLIC in cppu/source/cppu/cppu_opt.cxx and used in inline code in include/com/sun/star/uno/Reference.hxx with only a declaration lacking CPPU_DLLPUBLIC visible, and wondering how that actually works on Windows. However, this plugin is probably not worth it being run all the time, so committing it to compilerplugins/clang/store/. Change-Id: Ibc3c4e7499213de1b419ce7eb85455cb832e1510
2014-12-18Revert "Work around a Clang trunk (towards 3.6) -Werror,-Wunused-value"Stephan Bergmann1-13/+0
This reverts commit 146bd125a01742b2a6561a4a23735f37867d8221, Clang's r224465 does not look really useful the way it is, so work around that directly in Clang for now.
2014-12-18Work around a Clang trunk (towards 3.6) -Werror,-Wunused-valueStephan Bergmann1-0/+13
Change-Id: I3ee32c5bd379bb851f8f255faa93d96227dcff84
2014-12-10long is 32 bit on Windows x86_64 platformDavid Ostrovsky1-1/+1
So that this is always wrong (on this platform) to write: reinterpret_cast<foo>(reinterpret_cast<long>(bar)) it should be: renterpret_cast<foo>(reinterpret_cast<sal_uIntPtr>(bar)) Change-Id: Ia286246ee1616988f755c2d2054b26efacc51af0 Reviewed-on: https://gerrit.libreoffice.org/13366 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-09-23loplugin: cstylecast, update PTR_CAST macro to use static_castNoel Grandin1-1/+1
I introduce a template method into the PTR_CAST machinery to maintain constness. There is now a FIXME in sd/../docshell.cxx because I needed to use a dynamic_cast there to work around the games it appears to be playing with OLE in-place activation. Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, dropping the GCC-extension, unnecessary use of typeof from tools/rtti.hxx Change-Id: Iba5ace1aa27e02b34fcc91af1e658c43371afd03
2014-07-14loplugin:unreffunNoel Grandin1-10/+3
Change-Id: Idc0f3ef53f48b2e77e4cecbcdbbc44a115c6ec2e
2014-05-22fix-includes.pl: toolsThomas Arnhold1-1/+1
Change-Id: I66b3dc79998de018eae1c7eff8ce23f95e3c3f33
2014-03-31Remove now unused obsolete tools/debug.hxx functionalityStephan Bergmann1-502/+0
Change-Id: I1bc585af8f0189dfa219bd42a5f09871a006c6ea
2014-03-28Remove now unused DBG_CTOR etc. featureStephan Bergmann1-504/+7
Change-Id: Id5e3191ea1a505bd7d46af355edb99e184b5fcb1
2014-03-25Remove now unused tools/debug.hxx profiling functionalityStephan Bergmann1-185/+1
Change-Id: I13adca8c2f929c8a9226b26ef57b26363dfdf0b3
2014-03-25Reduce some functions to localStephan Bergmann1-30/+4
Change-Id: Ia2d7eaaa1381fe46839b0d52a91bdc3a439fa418
2014-03-25osl_setDetailedDebugMessageFunc is effectively doing nothingStephan Bergmann1-44/+0
...since the osl/diagnose.h macros got rebased onto sal/log.hxx, so remove the corresponding tools/debug.h functionality. Change-Id: Ife4b5b1a2608230d0dbfc3fa8852243c89ed292f
2014-03-25Remove unused DBG_FUNC_* slotsStephan Bergmann1-19/+1
Change-Id: Ief6661ed4bb57546014deef5b10d20fc3a4894fe
2014-03-25DBG_OUT_WARNING is unusedStephan Bergmann1-9/+0
...and thus DgbData::nWarningOut is unused, too. Change-Id: I388d2be7dafbfdc173a731dc7daf1c8b5efcd61d
2014-02-03At least warn when DBG_TESTSOLARMUTEX has not been set upStephan Bergmann1-0/+3
Change-Id: I5ae5318685ffe45bd9616d06eea21a93585715f2
2014-01-16Avoid warnings: unused parameterTor Lillqvist1-1/+5
Change-Id: I92fd33e020772eac735f133f467207da9635e9b4
2014-01-16always build an empty DbgUnhandledException, to allow debug=t builds without ↵Bjoern Michaelsen1-3/+2
--enable-dbgutils
2014-01-10Use boolStephan Bergmann1-5/+5
Change-Id: I7b48d8b9e162f9e4447bfcfcc0bbd1158bd35f5b
2013-10-22Bin comments that claim to say why some header is includedTor Lillqvist1-1/+1
They are practically always useless, often misleading or obsolete. Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-09Improve ErrorCodeIOException messagesStephan Bergmann1-0/+1
...and clean up some includes. Change-Id: Ia5843cd38f967722d7173a6c87fba26064e3ffd6
2013-08-21finish deprecation of O(U)String::valueOf()Luboš Luňák1-1/+1
Compiler plugin to replace with matching number(), boolean() or OUString ctor, ran it, few manual tweaks, mark as really deprecated. Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
2013-06-30Clean String and sal_Bool in toolsNorbert Thiebaud1-51/+51
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655 Reviewed-on: https://gerrit.libreoffice.org/4627 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-10fix file and lineno info for DBG_UNHANDLED_EXCEPTIONNoel Grandin1-2/+5
which I broke in commit 863d38fbfa4fb4861e476828c46410602100919e "move DBG_UNHANDLED_EXCEPTION out of line" Change-Id: Ic30e985cc356d81013ced1ce74ec6c78469d9882
2013-05-21fix for linkingNoel Grandin1-1/+1
caused by my commit 863d38fbfa4fb4861e476828c46410602100919e "move DBG_UNHANDLED_EXCEPTION out of line" Change-Id: Idfd84d987ba9151ba476ce0516a9e5fbdb2003ec
2013-05-21move DBG_UNHANDLED_EXCEPTION out of lineNoel Grandin1-0/+49
makes it easier to set a breakpoint on it. Plus it's getting a little big to be a macro. Change-Id: I2827aa3618ba966fbc85a4a56e0e794a55630730 Reviewed-on: https://gerrit.libreoffice.org/3988 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-03-27-Wunused-macrosStephan Bergmann1-1/+0
Change-Id: Ifaa1637122d6f9cae1e29b77ac36ca5d1f220aed