Pelles C forum

Pelles C => Add-ins => Topic started by: John Z on July 07, 2021, 04:31:58 pm

Title: Capture Tab data
Post by: John Z on July 07, 2021, 04:31:58 pm
Here is a new add-in.  Hopefully a useful one.
The purpose is to be able to easily and quickly save the data from a selected IDE TAB such as 'Project', 'Find in files', 'Output', or 'Debug' in a text file under the current project directory. Text filename will always be output_yyyymmdd_hhmmss. 

Example: output_20210707_085753.txt
 
How to use:
Load and activate the Capture.dll utility

SHA256: FE1137C6A9E995AAB1D486194029E91BC0C4A055BA5E313DDBD78692AD0CAB03


Generate output from any tab mentioned above, or any tab under a Debug run (except the 'Memory' map).

To save the tab data:
CLICK once anywhere in the projects tab window that is to be saved
then invoke the add-in; click File, Save Tab data - that's it

The file will be in the project directory.

John Z

Completion message is provided in the 'output' window.

Updated 7/12/2021 version 1.2.0 (works with listviews also)
Title: Re: Capture Tab data
Post by: Grincheux on July 07, 2021, 06:06:34 pm
I have downloaded it and using it immediately because a bug that I can catch. I will use the addin for the "Debug Tab". Tha ;D nk You John.
Title: Re: Capture Tab data
Post by: Grincheux on July 07, 2021, 06:40:25 pm
Debug is not accessible, when debugging the Source menu does not exit. You have to put the add-in in the "Project" menu.
Title: Re: Capture Tab data
Post by: John Z on July 07, 2021, 09:44:07 pm
Thanks, I didn’t have anything that output to the debug tab.

After thinking a bit I decided it belongs on the FILE Menu.

New version is available on the initial post above.
 
Appreciate your help!

John Z

Updated 7/8/2021
Title: Re: Capture Tab data
Post by: John Z on July 08, 2021, 10:42:22 am
Updated initial post with revised dll.

John z
Title: Re: Capture Tab data
Post by: Grincheux on July 08, 2021, 01:07:12 pm
For me it is much easy. I test and give you my answer. Thank You JohnZ
Title: Re: Capture Tab data
Post by: Grincheux on July 08, 2021, 01:11:07 pm
Fine!


Code: [Select]
Building Display.res.
Building Display.exe.
POLINK: warning: Realigned section '.idata$5' in object 'SQLite3.lib(sqlite3.dll)' (from 4 to 8 byte(s)).
POLINK: warning: Realigned section '.idata$4' in object 'SQLite3.lib(sqlite3.dll)' (from 4 to 8 byte(s)).
POLINK: warning: Realigned section '.idata$2' in object 'libgfl.lib(libgfl340.dll)' (from 4 to 1 byte(s)).
POLINK: warning: Realigned section '.idata$2' in object 'libgfle.lib(libgfle340.dll)' (from 4 to 1 byte(s)).
Writing debug information
POLINK: warning: Unrecognized version (589844) of debug symbols in object 'libgfl.lib(libgfl340.dll)'; ignored.
POLINK: warning: Unrecognized version (589844) of debug symbols in object 'libgfl.lib(libgfl340.dll)'; ignored.
POLINK: warning: Unrecognized version (589845) of debug symbols in object 'libgfle.lib(libgfle340.dll)'; ignored.
POLINK: warning: Unrecognized version (589845) of debug symbols in object 'libgfle.lib(libgfle340.dll)'; ignored.
Compacting debug information
Done.



Title: Re: Capture Tab data
Post by: Grincheux on July 08, 2021, 01:14:36 pm
Does not work with debug tabs.
Sorry!
Title: Re: Capture Tab data
Post by: John Z on July 08, 2021, 01:26:39 pm
I see what you are showing - but what you are showing is not the Debug Tab I'm referring to.  See attached.

I'll need to set up something to debug to see if something can be done.  I've never actually used the debug feature to solve anything ….

The most I've gotten into the Debug Tab is the word "Done" and the add-in saved it to a file …  :) so I'll look more at actual debugging.

John Z
Title: Re: Capture Tab data
Post by: TimoVJL on July 08, 2021, 02:11:16 pm
I'll look more at actual debugging.

John Z
not for assembler code, but for symbols.
Add-Ins for debugger (https://forum.pellesc.de/index.php?topic=7367.msg27982#msg27982)
Title: Re: Capture Tab data
Post by: John Z on July 08, 2021, 02:11:55 pm
So what you are looking for is a way to save the tabular data under the tabs generated when actually running the Debugger.  I understand.  Capture.dll is not capable of that, it will need a different approach.  Since it is tabular data CSV should be usable. I think something can be worked out for some of those tab Tables except for the Memory one.  Might be fairly difficult though, I also see some entries are using a treeview too. I'm not sure how to handle that right now.


John Z
Title: Re: Capture Tab data
Post by: John Z on July 08, 2021, 02:14:21 pm
not for assembler code, but for symbols.
Add-Ins for debugger (https://forum.pellesc.de/index.php?topic=7367.msg27982#msg27982)

 :) :) :)
Title: Re: Capture Tab data
Post by: TimoVJL on July 08, 2021, 02:24:07 pm
As those tabs are Listview, here is an old ListViewUtils code.
Title: Re: Capture Tab data
Post by: John Z on July 08, 2021, 03:54:10 pm
As those tabs are Listview, here is an old ListViewUtils code.

Thanks Timo, I downloaded and will look at it.
In my vcardz_i utility on SourceForge I used a multicolumn listview too, and wrote code to export the table to CSV as well as ODF spreadsheet.  HOWEVER that listview did not contain trees  :( so it is simpler I'm sure.

Thanks,
John Z
Title: Re: Capture Tab data
Post by: John Z on July 09, 2021, 03:38:48 pm
Does not work with debug tabs.
Sorry!

Sir Grincheux, Since you are the current 'customer' for this  :) which column separator is preferred TAB or COMMA ?  In a plain text editor/viewer the columns are not always going to align because the data stored in the columns are variable lengths (see attached).  So I'm guessing the output text file will be best opened in something like Excel or LibreOffice Calc. 

I could scan each column for the longest datum and adjust others but I'm not sure that is worth the resources. I'll think about it though.

John Z
Title: Re: Capture Tab data
Post by: John Z on July 09, 2021, 05:13:01 pm
Well you snooze you lose  :) :) :)

No - just decide I'll pad it out and use a tab too.

Here is an example output from debug of Display.prj
I'll post a new dll for testing after a bit of clean-up.

John Z

Timo - I did use the base code from procedure CopyList2File, although modified to meet my needs.  I will mention you as the original author.   Thank you for the assist!!
Title: Re: Capture Tab data
Post by: Grincheux on July 09, 2021, 05:16:18 pm
You can use tab '\t' or ';' or '|' it is not a problem. They are classic separators for CSV files too.
For me the most important tabs when debugging are "Memory", "Registers", "GLOBAL" and "LOCAL"
If you need to use a dialogbox to select the tab we want, it is not a problem because when debugging me have time.
If this solutions is easy for you do not hesitate.
A problem I have found is with the dialog box that say to click on a tab. When I click on the tab the dialog box disappear and if the sound is off that is a problem. Your dialog box always [size=78%]must be VISIBLE and at the FOREGROUND.[/size]

If you had nothing to do for the week end, I have found some work... ;D ;D
Title: Re: Capture Tab data
Post by: Grincheux on July 09, 2021, 05:19:10 pm
Quote
Well you snooze you lose
I dont understand, even using Google Translate.

Your capture is perfect for the result.
That's the kind of result that is exepcted.

GOOD WORK
Title: Re: Capture Tab data
Post by: Grincheux on July 09, 2021, 05:46:53 pm
Quote
which column separator is preferred TAB or COMMA ?


Don't use COMMA
Title: Re: Capture Tab data
Post by: John Z on July 09, 2021, 05:48:19 pm
 :) First things first

"If you snooze you lose."  Loose translation of idiom - if you are sleeping (or busy with something else), events still happen, but you have no input to them,  or if not responding fast enough then decisions made before you have chance to make input. Si vous dormez, vous perdez.

No plan to use a dialog box you just click within the Tab window you want to save, then use File - Save Tab data.



John Z

OK - no comma addition.
Title: Re: Capture Tab data
Post by: John Z on July 09, 2021, 06:09:22 pm
For me the most important tabs when debugging are "Memory", "Registers", "GLOBAL" and "LOCAL"

The only tab it won't support in the next test release is "Memory"  This is a custom class "PC_Memory" and I'm not sure how or if even possible to access yet.


John Z
Title: Re: Capture Tab data
Post by: Grincheux on July 09, 2021, 06:11:15 pm
Rather than text you could build a bmp file it is easier for you. That's right for all tabs.
Title: Re: Capture Tab data
Post by: John Z on July 12, 2021, 05:08:26 pm
Capture.dll

Purpose: Save text from the selected IDE tab 'Project', 'Find in files', 'Output',
 or 'Debug' in a text file under the current project directory. Text filename
 will always be output_yyyymmdd_hhmmss.  Example: output_20210707_085753.txt
 
How to use:
Load and activate the Capture.dll utility
SHA256: FE1137C6A9E995AAB1D486194029E91BC0C4A055BA5E313DDBD78692AD0CAB03

Generate output from any tab mentioned above.

to save the tab data
CLICK once in the tab window to save
then click File, Save Tab data - that's it

The file will be in the project directory.

Note: Sadly after much work listview groups are still not automatically expanded.  To get the list group data in the output file they must be expanded manually before clicking 'Save Tab data'.  Maybe someone  else can get that but I found commctrl.h seems incomplete for listview capabilities e.g. no ListView_GetGroupInfo and others.  In addition on my system, or my lack of knowledge, I could only get _WIN32_WINNT items <  0x501 so higher version items weren't available. For example none of these became available
Code: [Select]
#if (_WIN32_WINNT >= 0x501)
    int iGroupId;
    UINT cColumns;
    PUINT puColumns;
#endif /* _WIN32_WINNT >= 0x501 */
#if (_WIN32_WINNT >= 0x0600)
    int *piColFmt;
    int iGroup;
#endif /* _WIN32_WINNT >= 0x0600 */
-------------- 
   
It does work as a useful add-in for saving tab data, but could be better. 
I've included the project source code too.

John Z
Title: Re: Capture Tab data
Post by: Grincheux on July 13, 2021, 07:43:41 pm
Quote
Name     Value                               Comments                                                                                 
RAX      00007FF6758DE98C                                                                                                             
RBX      0000000000000001                                                                                                             
RCX      E586ACAEA40F0000                                                                                                             
RDX      0000000080006010                                                                                                             
RSP      000000E91DB6EB00                                                                                                             
RBP      0000000000000000                                                                                                             
RSI      0000000000000000                                                                                                             
RDI      0000000080006010                                                                                                             
R8       000000E91DB6F0A8                                                                                                             
R9       000000E91DB6EB20                                                                                                             
R10      0000000000000000                                                                                                             
R11      0000000000000000                                                                                                             
R12      0000000000000000                                                                                                             
R13      0000000000000111                                                                                                             
R14      0000000000000000                                                                                                             
R15      0000000000000000                                                                                                             
RIP      00007FF6758C23F7                                                                                                             
EFLAGS   00010300                            CF=0, PF=0, AF=0, ZF=0, SF=0, OF=0, DF=0, IF=1                                           
XMM0     0000000000000000:0000000000000000                                                                                            
XMM1     0000000000000000:0000000000000000                                                                                            
XMM2     0000000000000000:0000000000000000                                                                                            
XMM3     0000000000000000:0000000000000000                                                                                            
XMM4     0000000000000000:0000000000000000                                                                                            
XMM5     0000000000000000:0000000000000000                                                                                            
XMM6     0000000000000000:0000000000000000                                                                                            
XMM7     0000000000000000:0000000000000000                                                                                            
XMM8     0000000000000000:0000000000000000                                                                                            
XMM9     0000000000000000:0000000000000000                                                                                            
XMM10    0000000000000000:0000000000000000                                                                                            
XMM11    0000000000000000:0000000000000000                                                                                            
XMM12    0000000000000000:0000000000000000                                                                                            
XMM13    0000000000000000:0000000000000000                                                                                            
XMM14    0000000000000000:0000000000000000                                                                                            
XMM15    0000000000000000:0000000000000000                                                                                            
MXCSR    00001F80                            IE=0, DE=0, ZE=0, OE=0, UE=0, PE=0, IM=1, DM=1, ZM=1, OM=1, UM=1, PM=1, RC=0, DAZ=0, FTZ=0


GOOD ok for me


Title: Re: Capture Tab data
Post by: John Z on July 14, 2021, 01:05:55 pm
 :) Turned out fairly useful.  Eventually I'll be able to expand those groups.  For now it may even be better to NOT auto-expand.  Looking at Debug of your Display.prj there are 155 groups under one of the debug tabs! 


John

P.S.
Artificial constraints are 20 columns of data, each data field < 260 characters.