trace log build option

Bug #959495 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Wishlist
Unassigned

Bug Description

Working in mingw I am finding it almost impossible to trace the execution within Inkscape. For instance, if it is run in GDB
and an exception occurs a backtrace will typically show a few steps, but no module names, not even mangled ones. (Yes, gdb
was run with: file inkscape.exe inkscape.dbg).

Working this way in Mingw is pretty much the worst development environment I have ever had to deal with. It would be immensely helpful if there was a build option that implemented the following:

1. TRACELOG=""
(This is the default, no trace logging. However, if it is set to something, like "C:\TEMP\inktrace.log" then wherever main/initialization that file is opened.)

2. In every method/function:

void Objectname::Methodname
...
#ifdef TRACELOG tlog << "TRACE: Objectname::Methodname" << std::endl

With that I could keep one copy with trace enabled, for development, and another copy with it disabled, for testing/normal use. That would save having to recompile everything when a trace is needed, and it would skip the overhead of doing this via something like:

  if(global_trace){ tlog << "TRACE: Objectname::Methodname" << std::endl; }

The way I have been dealing with this issue so far has been find a problem, search all of the source code for locations that might call the method/function, put print statements in all of them, rinse and repeat. There have been cases where I could not figure out the path to an execution point, probably because it passed through some external library. (Most recently, Layout::print in layout-TNG-Output.cpp seems only to be called on EMF output, not ps, pdf, or cairo-png, but I could not determine why, since I did not find the caller.) This would at least show me the path above and below such "outside the debuggable arena" paths.

Tags: build win32
su_v (suv-lp)
Changed in inkscape:
importance: Undecided → Wishlist
tags: added: build win32
summary: - trace log build option (windows, Wishlist)
+ trace log build option
Revision history for this message
Kris (kris-degussem) wrote :

Is this a windows/win32 specific issue?
I would consider it a more general, that is a multi-platform request to be able to log function calls ...

As a side note: when debugging some functionality I'm working on, I use temporary g_message calls to see which step is failing as an alternative to the wishlist item described here.

Revision history for this message
David Mathog (mathog) wrote :

I think the development environments on Mac or Linux nay already have a satisfactory trace function like this. If not, then it is not Win32 specific.

I also use (the equivalent of) g_message calls for debugging, but those are not of much help if you don't already know where to put them in.

Revision history for this message
movgp0@gmail.com (movgp0) wrote :

I think there should be no trace build option. instead, tracing and logging should be enabled and disabled via a config file.

also, the output should be put onto the console and into a log file. ideally it would be configurable what to log where in an XML file.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.