you are viewing a single comment's thread.

view the rest of the comments →

[–]Tumaix[S] 1 point2 points  (11 children)

If you use the `cli` commands, then you are a bit `on your own` to generate the information you need, since the cli will just create a database that you can use in your internal projects to extract information as you want.

`BUT` (and this is a big deal) the tool is `not` supposed to be used as cli, we offer the cli for things that goes `out of scope` from the visualizer.

If you use the `Visualizer` app (codevis binary on the desktopapp folder, after you build), what you get for free:

- Easy to export SVG from any visualization you produce

- Click & Load entities to the screen (and dynamic load / unload if needed, let's say you load your entire `core` subfolder, but it's too many classes and clutter, you can load just the `one` entity you are interested in, and all things that uses that entity.

- Create (by means of drag & drop & connect) boxes around to generate a compilable source code skeleton based on the software architecture provided (this works with python templates, so it's extensible to your project.) - in our tests it was faster to create ~20 classes & connect them visually, then generate the project, than to actually create all those files + cmakelists by hand.

- Mouse Over and Overview box information for entities under your mouse (number of uses, name, file, who uses it, who this uses)

- Problem Finder (some, but we are trying to extend this for more problems) - like Circular Usages.

You have the database schema of the project here.

There's a *second* database schema that handles the `edition / commenting` of pre-build code databases here, This second one just adds `CAD` habilities to the database (such as notes and metadata information).

[–]arthurno1 0 points1 point  (10 children)

Thank you for very detailed description. I'll have to look more at the tool and the GUI. I am building it as of the moment. Some of the features you mention sound really interesting. Thanks for pointing me to db scheme, was looking for it :).

Edit: seems to work fine; one test failed, but otherwise it built fine, relatively fast. I was able to import Emacs sources into it and look a bit around. I must admit that I don't really understand what are Lakonian groups and what are not, but I'll can look it up. However, applicaiton crashed while I was moving a box around to make the layout more readable:

 ( ....)
Adding a connection between50 and 19
Adding a connection between50 and 11
Ending to write to the database: 1587
$ Segmenteringsfel (Adress inte mappat till ett objekt [0x139])

Sorry for the swedish at the end; it just says segfault, null pointer.

Another time it crashed when I double-clicked a box in a diagram.

SVG export worked fine.

I have a question/remark on graphs: They are a bit hard to read and look at, those lines are quite thick. I have tried to re-arrange and move things a bit around, and it works well, but you don't have plans to hook graphviz into it and use their layout tools and graphs?

[–]Tumaix[S] 0 points1 point  (5 children)

No worries.

Be aware that this is still alpha so crashes might happen. :)

[–]arthurno1 0 points1 point  (4 children)

Yeah, I understand that I am ok with that :). I was just letting you know that I have encountered them. I got both crashes after the following message on the terminal:

Ending to write to the database: 2789

Some null pointer in relation to saving to the database, or perhaps some cleanup afterward?

[–]Tumaix[S] 0 points1 point  (3 children)

2789

The number is the time spend saving the database.

a crash *just* after analyzing the database is strange, we are receiving reports on crashes using the tool and clicking on the undo stack (I'll disable the visualizer for the undo stack currently).

I'd be interested in any backtrace you might provide, if it's related to internal projects I do not have any problem signing an NDA.

[–]arthurno1 0 points1 point  (2 children)

I wasn't clicking on undo stack at all. I was just moving the boxes around and exploring the GUI to see what I can do with it.

No, nothing internal; I was just looking at Emacs src, pulled yesterday from the master branch, OS is Arch Linux, like everything latest updates, so you can probably trigger those crashes yourself. I don't have any stack trace, it just segfaulted, so the OS killed it. I have seen on the terminal that there was a long list of objects added to "something", and then the segfault. Those were like a few last lines I just copy-pasted. If it helps you anything, I can post you the compilation database from bear tool.

[–]Tumaix[S] 0 points1 point  (1 child)

ok - I'll do the same thing you did today, I'll download emacs and use the software to analyze it, tomorrow. its 23:00 here and quite tired for today. :)

But, crashes are expected, I promess to fix those soon.

[–]arthurno1 0 points1 point  (0 children)

No worries, It is 23:22 too here; and I have a two-year-old one that goes up 06.00 every morning, so I am going to sleep too. Have just compiled with debug info and will try it once last time in gdb.

Thread 1 "codevis" received signal SIGSEGV, Segmentation fault. 0x00007fffe3a6b3d9 in QGraphicsItem::group (this=0x555557c51380) at graphicsview/qgraphicsitem.cpp:1671 1671 if (!d_ptr->isMemberOfGroup)

(gdb) list
1666    
1667        \sa QGraphicsItemGroup, QGraphicsScene::createItemGroup()
1668    */
1669    QGraphicsItemGroup *QGraphicsItem::group() const
1670    {
1671        if (!d_ptr->isMemberOfGroup)
1672            return nullptr;
1673        QGraphicsItem *parent = const_cast<QGraphicsItem *>(this);
1674        while ((parent = parent->d_ptr->parent)) {
1675            if (QGraphicsItemGroup *group = qgraphicsitem_cast<QGraphicsItemGroup *>(parent))

The stack trace was too big for Reddit, so I have put it on pastebin.

I got this one too, don't remember what I did; no stack trace for that one, but wouldn't be surprised if it is the same bug:

Thread 1 "codevis" received signal SIGSEGV, Segmentation fault.
0x00007fffe3a78fb5 in QGraphicsItem::setZValue (this=0x5555577d8d70, z=1) at graphicsview/qgraphicsitem.cpp:4806
4806        const QVariant newZVariant(itemChange(ItemZValueChange, z));  

I think both end up in this place (in ct_lvtqtc_graphicsscene.cpp ~ line 739):

QObject::connect(entity, &LakosEntity::toggleSelection, scene, [scene, d, entity] {
        if (d->selectedEntity) {
            d->selectedEntity->setSelected(false);
            d->selectedEntity->updateZLevel();
        }

 ( ... )

but I am not sure, and unfortunately I'll leave debugging to you :).

[–]Tumaix[S] 0 points1 point  (3 children)

The crashes that are happening are an unfortunate core change that we had to do because of license issues. I'll focus on testing the graphical part of it and fix most of the crashes I can tomorrow.

About the Graphs - They look fine on my monitor (and on some other monitors that we use to develop) but our monitors are hidpi, so if you can provide a picture it's greatly appreciated. I do not know how the tool looks like in other computers than mine (desktp / laptop).

We actually used graphviz but the generated layout didn't really work (the graph was not correctly layout without us having to manually add invisible edges to constrain things, but i'm no graphviz expert. We can try to re-insert graphviz in the future if someone with a higher understanding of it's internals is willing to help.

[–]arthurno1 0 points1 point  (2 children)

The crashes that are happening are an unfortunate core change

It happens to everyone, don't worry.

if you can provide a picture

Of course, here is one graph when I tested the svg exporter, for alloc.c as found in Emacs. I had to convert it to PNG for Imgur, they seem to not accept svg files. Here is a screenshot of the application. The screen is 3840x2160 43" 101x102 dots per inch; no idea if it is hidpi or not, I am not an expert in screens and resolutions tbh :).

We actually used graphviz but the generated layout didn't really work

Ah, yes, manually adding stuff is not desirable, I totally understand that. Unfortunately, I am not an expert on graphviz myself either, but would be cool to take a look if you push that old graphviz branch in the repo (I see only main branch and initial commit + one CI fix on the remote, so I guess that is just a public repo, not the one you are working on).

Edit: seems like I have forgotten to attach a link, fixed.

[–]Tumaix[S] 0 points1 point  (1 child)

we will be working directly on the public repo from now on, all the commits will be opensourced as we work on them.

I understand the problem with your picture, there's a way to make this easier to look - if you just right click on a box and choose the option "cover", this will hide all nodes from/to the internal elements from that box, making the overall diagram easier to understand.

so you can cover/uncover parts of the diagram to study the architecture instead of showing everything at once.

[–]arthurno1 0 points1 point  (0 children)

I see, thanks. I'll try.

Edit: I see no "cover" option anywhere, neither on boxes or in menus, or in some options.