SystemsGenetics / ACE

Accelerated Computational Engine (ACE) is a GPU-enabled framework to simplify creation of GPU-capable applications
http://SystemsGenetics.github.io/ACE
GNU General Public License v2.0
1 stars 1 forks source link

Improvements for EDebug #66

Closed bentsherman closed 5 years ago

bentsherman commented 5 years ago

Using this issue to document ideas for future improvements of EDebug.

4ctrl-alt-del commented 5 years ago

As discussed I have added the ability to whitelist specific source files to actually report from the EDEBUG_FUNC macro. Added in commit 36e537f166e2388b4abc1c75e0366d7cbff2df47 of develop branch. Please let me know if this works.

bentsherman commented 5 years ago

I think it works, but it's still printing lala instead of the actual line.

4ctrl-alt-del commented 5 years ago

Oops! I forgot to remove the test line I used to make sure it worked for me. Fixed in 3de8b6479f194113834249f52ab987fc1dbdd560. Sorry about that! Let me know if it works properly now.

bentsherman commented 5 years ago

It works! Wow this is so much better.

This pretty much takes care of the third item from my OP. I still think the compact output would be very helpful. Here's an example function call currently:

int Similarity::Serial::fetchPair(const Pairwise::Index&, QVector<signed char>&)
{
   this = 0x7fd953200ab0(Similarity::Serial)
   &index = 0x7ffd1cb99600
   &labels = 0x7ffd1cb995f0
}

My idea of a "compact" output would be something like this:

int Similarity::Serial::fetchPair(const Pairwise::Index&, QVector<signed char>&): this = 0x7fd953200ab0(Similarity::Serial), &index = 0x7ffd1cb99600, &labels = 0x7ffd1cb995f0

So everything is on one line, and you don't need the brackets because the indentation already informs the scope (like Python lol). This format is much more compact, which might be easier to scroll through and search quickly. This could be enabled by either the logging setting or a new setting.

kinc settings set logging compact # or on (full), off
4ctrl-alt-del commented 5 years ago

Why don't we just go full python?

Similarity::Serial::fetchPair(this = 0x7fd953200ab0(Similarity::Serial), &index = 0x7ffd1cb99600, &labels = 0x7ffd1cb995f0)

This would be the most compact and referencing the return and arguments types would be easy since you would be tracing the debug info through the source code anyway.

bentsherman commented 5 years ago

Lol. Yeah that's even better, in fact I think that's what gdb does as well now that I think about it.

4ctrl-alt-del commented 5 years ago

So there are two points of contention I still have:

  1. I want one single uniform output format for debugging.
  2. We cannot lose any actual debugging information using a shorter output version. So how about we just make the regular output the short version with one addition I just realized today: We still need an ending } output that informs when execution has left a function. That cannot be achieved with a single line of output. (EDEBUG protocol works on a per line basis, it is impossible to flush output without a new line character) Example:
    Similarity::Serial::fetchPair(this = 0x7fd953200ab0(Similarity::Serial), &index = 0x7ffd1cb99600, &labels = 0x7ffd1cb995f0) {
    }

Would this resolve the remaining issues you have with EDEBUG @bentsherman ?

bentsherman commented 5 years ago

Yep, that all sounds good to me.

4ctrl-alt-del commented 5 years ago

Reworked in commit 21bf42de7e29eb9916356d9f4c6d2d1719ebf730. I will let you review the changes and close this if it is satisfactory.

p.s. I also changed the indent width to 4 because that is a commonly accepted standard.

bentsherman commented 5 years ago

Looks good to me!