Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Miguel Gimenez on September 20, 2018, 07:44:20 pm

Title: RFC: collect system information so users can attach it when looking for help
Post by: Miguel Gimenez on September 20, 2018, 07:44:20 pm
The attached code returns extended system information (including active plugins and their versions) that can complement the build log when somebody looks for help in the forum.

This information could be added to (for example):
  - the build log (always or only when rebuilding)
  - a new tab in the About dialog
  - under the Help menu, like Firefox does (I don't know english wording, Information for solving problems?)
  - when saving the build log to HTML
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: BlueHazzard on September 20, 2018, 11:44:56 pm
i would expand this even future:

I would output this all in the build log, or the output html. This would help finding problems a lot. I don't think that there is a large performance impact. If it is we could add a option to disable this "verbose" logging. I had many situations where the information from the list would have saved me a lot time finding errors..

We could create a minimal plugin, that collects all this information and creates a zip file, ready to upload to the forum...
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: Miguel Gimenez on September 25, 2018, 01:54:45 pm
I have added the comp├Čler location, executables' names and user variable expansions (not the macros, because the MacroManager does not collaborate). This is done at project level, not for each target,

The information is shown in tab called System inside the About dialog. The data adquisition function is in dlgAbout.cpp declared as static, so it can be called from everywhere without instantiating dlgAbout.

Due to the generated enthusiasm I put the patch here instead of creating a ticket; If it were accepted then I would create a ticket.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: BlueHazzard on September 25, 2018, 11:10:41 pm
I would also add the Backtick map found in

globals.cpp:859
Code
typedef std::map<wxString, wxString> BackticksMap;
BackticksMap m_Backticks; // all calls share the same cache
wxString ExpandBackticks(wxString& str) // backticks are written in-place to str
This is also something that is cached, never cleaned until restart and can mess up things quite hard and obfuscated.

Some nice formatting with html or markdown would be nice...

I don't know what i think about the place in the about dialog...

Quote
(not the macros, because the MacroManager does not collaborate)
What is the problem? I think at least the macros of the activated project should be added...

[edit:] Also detailed wxWidgets library information would be nice. I think this sys info should be splitted up in two: "Codeblocks system info" with plugins end wxWidgets ecc.. and "Build system info" with macros backticks ecc..
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: Miguel Gimenez on September 26, 2018, 12:21:51 pm
Quote
I would also add the Backtick map

I will check, didn't know how to access them

Quote
Some nice formatting with html or markdown would be nice...

The text format is better for the tab and for copy/paste. If this information is ever added to the HTML build log I will add HTML formatting.

Quote
I don't know what i think about the place in the about dialog...

This is the least intrusive place I saw, anyway it can be moved to another place.

The macros manager has no public method to retrieve the macro information, of course this can be changed but possibly devs will be reluctant.

Quote
Also detailed wxWidgets library information would be nice

What detailed information? Are you talking about the library used to compile CB or the one (possibly) used in the project?
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: oBFusCATed on September 26, 2018, 06:01:55 pm
The macros manager has no public method to retrieve the macro information, of course this can be changed but possibly devs will be reluctant.
If it is for read only purposes, I don't see a problem. Also there should be a comment saying that this is supposed to be used by the logger and could be removed without notice at any time.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: Miguel Gimenez on October 01, 2018, 01:04:12 pm
I have moved the info collection routines into a class and added HTML generation capability (sample attached).
Where should this class be? It should be called from the About dialog and the compilergcc plugin.

Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: ollydbg on October 06, 2018, 04:32:38 am
Where should this class be? It should be called from the About dialog and the compilergcc plugin.
Still in the src/src/dlgabout.cpp?

Anyway, you did a very nice job! Thanks.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: BlueHazzard on October 06, 2018, 05:45:42 pm
i was talking about the wxWidgets used by the codeblocks executable.

My final imaginary goal is a button "Collect data to report to forum" and we get all information needed to help people without asking for every part slowly..
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: Miguel Gimenez on October 09, 2018, 04:51:43 pm
Patch posted in ticket 748:

https://sourceforge.net/p/codeblocks/tickets/748/ (https://sourceforge.net/p/codeblocks/tickets/748/)
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: AndrewCot on June 25, 2021, 01:55:19 pm
WHY, WHY, WHY was the patch in the ticket not looked at?????

It would have improved the ticket info quality 10,000%....

Sorry for my whining, but like other people there is a % of tickets that do not even include the CB version and OS etc and then expect the bug to be fixed with no config details.....
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: oBFusCATed on June 29, 2021, 12:10:17 am
WHY, WHY, WHY was the patch in the ticket not looked at?????
Because this is the real world and as it seems even the patch author has forgotten about it :)
The ticket info quality wouldn't be improved much by this patch, because most people posting these never comeback after any additional info is requested.
Also looking at the patch I think it is questionable. The macro stuff is pretty context dependant to be useful.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: AndrewCot on August 05, 2021, 06:07:23 am
I have been working on the data displayed in the Help->About->Information tab to expand the data even more to include useful info I have stumbled across when trying to get CB "things" working or correctly or to fix bugs.

I have not moved the info into a separate Help sub menu as indicated in ticket 748 and enhance the new dialog to to make it easier for end users to include the info in bug reports.  The current code changes are in my following Github branch:
    https://github.com/acotty/codeblocks_sf/tree/AC-Help-AdditionalInfo

In my changes I removed the HTML feature as I could not see any real benefit of this over the existing plain text. Once I did this then the new class became redundant and as such it no longer exists. The current changes are only in two files as per the following commit:
   https://github.com/acotty/codeblocks_sf/commit/19ef5d467606098cd64f2146613aa732f1779a85

A sample of the output is attached.

If you can think of anything else to add to the output please let me know long as it is feasible.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: BlueHazzard on August 05, 2021, 10:06:47 am
Looks quite nice!

Maybe we should add some warning that personal (but not critical) information can be found in the file?
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: AndrewCot on August 05, 2021, 02:26:39 pm
Which bits of info in the files would you classify as personal with the exception of the following:
a) Windows username? In my case "andrew".
b) Computer name. In my case "AC-DESKTOP"

I have the help menu changes done and the button to copy the data to the clipboard. In the copy to clipboard I could programmatically dot eh following:
a) Get the username and change all references to "<UserName>". 
b) Get the computer name and change it "<ComputerName>". 

It's probably a better idea to anonymize the data collected than have the user agree to something.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: AndrewCot on August 06, 2021, 08:53:39 am
@BlueHazzard

I have updated my unofficial x64 installers on source forge to include the changes in my posts above, see https://forums.codeblocks.org/index.php/topic,24592.0.html for details.

If you do get a chance to look at them can you also see if the changes I have made "resolve" ticket 808 w.r.t. fixing the issue in a different way than as per the ticket, but such that the end user can hopefully not end up with an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] (okay they can if they are too smart for their own good by doing worse things than I have tried) is okay or not. If not can you please let me know what you think could be done next to resolve ticket 808 on the https://forums.codeblocks.org/index.php/topic,24592.0.html  thread or in the ticket.

If you do not want to install them then you can unzip the NSIS installer exe with 7ZIP to get to the files that are installed in the program files directory.
Title: Re: RFC: collect system information so users can attach it when looking for help
Post by: AndrewCot on September 08, 2021, 11:45:14 am
Attached is the system information collected from Xubuntu 20.04 virtualbox guest using my latest C::B source code that I just successfully compiled under Linux.

If anyone thinks that I should add extra output for Linux that will help in trouble shooting C::B issue please let me know and I will try to add it.