Jump to content

Heap Peek and other internal debug tools...


Recommended Posts

Chris' post here mentioned an NI internal debugging tool called Heap Peek that I hadn't known about. So of course after reading the wiki I immediately enabled it and started poking around. shifty.gif I can't find any other useful information online about it. Is there any other tribal knowledge on this tool or are there other things you have used Heap Peek for?

I also discovered Ned (Ctrl-Shift d, Ctrl-Shift n) and a combo to show buffer allocation (d, q.) One key combo (d, ,) causes some BDs to be grayed out. I don't know what purpose it serves though. Any other known gems?

post-7603-127567334075.png

  • Like 1
Link to comment

Chris' post here mentioned an NI internal debugging tool called Heap Peek that I hadn't known about. So of course after reading the wiki I immediately enabled it and started poking around. shifty.gif I can't find any other useful information online about it. Is there any other tribal knowledge on this tool or are there other things you have used Heap Peek for?

I also discovered Ned (Ctrl-Shift d, Ctrl-Shift n) and a combo to show buffer allocation (d, q.) One key combo (d, ,) causes some BDs to be grayed out. I don't know what purpose it serves though. Any other known gems?

post-7603-127567334075.png

Darren also recently posted about the Heap Peak, there may be some more info there or in his links too that you may be helpful?

Link to comment

Darren also recently posted about the Heap Peak, there may be some more info there or in his links too that you may be helpful?

Yeah, I saw that but there wasn't anything new there that wasn't already in the wiki.

Shortly after I posted the original message I opened task manager and found ~25 Excel processes running. I suspect some button I was mashing caused it, but I haven't pursued it at all yet.

Link to comment
  • 9 years later...

I do remember discovering the Window Monitor and Ned windows semi-independently.  Someone posted a way to show the Heap Peak window, with CTRL+Shift+D+H and I thought that was likely for Debug, and Heap.  So why not try D+<every letter combination>.  At the time I think only H, N, and W did anything.  Most of the time I care to find a window's HWND I use a private function which lets me do what I want.  I have never had a need for knowing the HWND of any of the other windows so that Window Monitor wasn't all that useful for me.  The Ned windows unlocked more useful information, but just for curiosity sake really.  Also I find it really interesting that Heap Peak has been in LabVIEW for such a long time and with seemly no or little updates to it.

  • Like 1
Link to comment
On 6/1/2020 at 9:38 PM, hooovahh said:

Most of the time I care to find a window's HWND I use a private function which lets me do what I want.

I used that FP.NativeWindow property for years and it never failed for me. I was using it on Windows only though. Maybe I could test it on other platforms as well, but I never needed that.

 

Oh, and here's one more way to invoke Heap Peek and Window Monitor (absolutely forgot about it).

Example_VI_BD.png

Another way to view Heap Peek window - NCGLaunchHeapPeek internal function. Doesn't need any parameters and returns nothing. But must be invoked in UI Thread only, else LV goes crash. Starting from LV 2015.

N.B.: Both methods do not work in RTE (compiled app).

Edited by dadreamer
one more way to toggle HP
Link to comment
  • 2 weeks later...
On 6/2/2020 at 8:09 AM, dadreamer said:

Oh, and here's one more way to invoke Heap Peek and Window Monitor (absolutely forgot about it).

Example_VI_BD.png

I'm curious to see if that exists in linux too. LVdebugKeys=True + Ctrl-shift-D-H don't seem to apply. Could someone attach the snippet saved as VI for LV<=2019??

Edited by ensegre
Link to comment
2 hours ago, ensegre said:

Could someone attach the snippet saved as VI for LV<=2019??

Here's the version back-saved for LV 2011: HeapPeek_WinMonitor.vi

Heap Peek and Window Monitor are both available on Linux and macOS. And if one wishes to recreate these brown nodes manually, then (s)he should put SuperSecretPrivateSpecialStuff=True into LabVIEW.ini and restart LabVIEW; when done, a number of hidden private nodes appears.

Edited by dadreamer
Link to comment
2 hours ago, Stagg54 said:

You must have missed out on the joy of insane objects.

I had my share of insane objects, but I'd just clear the compile cache, and revert with SCC.  I don't ever remember seeing insane objects in the installed LabVIEW functions, but if that happened it would be a bit more of a pain to resolve.

Link to comment

unfortunately I had inherited a giant project. The main VI had a 17 frame deep stacked sequence structure. Frame 17 was the main logic but it needed 16 frames to initialize all the global variables in the correct order. It was written in LabVIEW 5 and upgraded to 6.1 with no SCC. It was my introduction to all things LabVIEW.

It was a fun project.

Link to comment
37 minutes ago, dadreamer said:

Here's the version back-saved for LV 2011: HeapPeek_WinMonitor.vi

Heap Peek and Window Monitor are both available on Linux and macOS. And if one wishes to recreate these brown nodes manually, then (s)he should put SuperSecretPrivateSpecialStuff=True into LabVIEW.ini and restart LabVIEW; when done, a number of hidden private nodes appears.

I see, thx. Still don't think my LV19 can toggle it with Ctrl-shift-DH, nor I seem to be able to create the brown nodes (it's ~/.labviewrc), but whatever. i was just curious.... thx for the conversion.

Edited by ensegre
Link to comment
40 minutes ago, ensegre said:

Still don't think my LV19 can toggle it with Ctrl-shift-DH, nor I seem to be able to create the brown nodes (it's ~/.labviewrc)

I'm unable to invoke Heap Peek with the keys combination on VM with Ubuntu. I would check on a common installation, but don't have one ATM. But adding various tokens to the config file (/home/<username>/natinst/.config/LabVIEW-x/labview.conf) works fine for me.

Link to comment
35 minutes ago, dadreamer said:

But adding various tokens to the config file (/home/<username>/natinst/.config/LabVIEW-x/labview.conf) works fine for me.

Right, if I put it there I get all the brown and light blue bonanza. I was mislead by http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/customizing_your_work_environment/#How_LabVIEW_Stores_Options which is pointed at https://labviewwiki.org/wiki/LabVIEW_configuration_file. But uh, that is the help page for 8.2. Still, it is at odd with https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PA7rSAG&l=en-IL

Link to comment
1 hour ago, ensegre said:

But uh, that is the help page for 8.2.

It's now updated to https://zone.ni.com/reference/en-XX/help/371361R-01/lvconcepts/customizing_your_work_environment/#How_LabVIEW_Stores_Option

Don't hesitate to update the Wiki if the information is outdated.

Edited by LogMAN
Pressed Save before post was finished
Link to comment
  • 3 months later...

If you use Ctrl+Shift+D,|, it will enable logging DPrintf messages. Then you can do Ctrl+Shift+D,P to display a list with most of them:

LabVIEW internal debug keys - Ctrl + Shift + D + one of the following
 |  toggle DPrintfs.  Currently on.
 :  print global font table
 A  check app heap
 B  print TD dictionary stats
 D  PrintDSStats
 E  toggle QElement checking
 G  toggle StripChart scroll/copybits
 H  show/hide heap peek.
 I  print heap text info
 J  rebuild all malleable instance VIs in current VI's context
 L  prints linker graph viz info
 M  toggle memory checking.
 N  show Ned, the friendly debug options dialog
 O  toggle drawing on/offscreen
 P  prints out this list
 Q  toggle show nonIP terms. currently off
 R  print VI Server info
 S  print net connection table
 T  toggle print compile stats. currently off
 U  toggle sanity checking. currently on for compile/save
 V  print all OLE Variants
 W  show window monitor
 X  toggle new Preferences dialog
 Z  print execution and eventQ status
 {  compact DS now.
 }  toggle gUseNativeFontSizing currently %s
 " print HeapTextRec line table.
 ~  toggle unattended mode
 <  toggle clump display (use ctrl-shift arrow keys to cycle thru clumps)
 &  print heap text font runs
 _  wireframe 3D controls
 >  ActiveX Control Property Browser
**** NOTE **** Debug keys are preceded by Ctrl+Shift+D !!!!!
**** e.g. Ctrl+Shift+D+N shows the debug options dialog.
**** You have 3/4 of a second after hitting the D to hit the N

There's a few missing, however. Pressing Ctrl+Shift+D,C makes LabVIEW check the "HedgesSpecialCrash" INI key, and presumably if it's set to some specific value (not True) it'll crash. (Edit: the value is 1, and yes, it crashes with "Hedges Special gDAbort".) Ctrl+Shift+D,+ checks the "FakeInsanity" key; I tried setting that to True but there wasn't any visible effect there either. (Edit: I set it to 1, and Ctrl+Shift+D,+ made it crash when I right click a terminal.) For me, Ctrl+Shift+D,: didn't display the font table, but it checked "HedgesSpecialDWarn". I think the options for this key are "single", "singleLots", "multiLots", and "multi100", though I only tried the first. As expected, it triggered an internal warning. There's also Ctrl+Shift+D,!, which DPrintf's output like this:

DPrintfVIObjRefList: [VI "GSW.lvlibp:GettingStartedWindow.vi" (0x0000000006d107d0)] objRefList has 7 obj refs
....[00] (787480577) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006ce0318}, subKind=0, subIdx=-1
....[01] (882901084) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006ce0408}, subKind=0, subIdx=-1
....[02] (881852507) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006c89dc8}, subKind=0, subIdx=-1
....[03] (880803930) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006c7c598}, subKind=0, subIdx=-1
....[04] (883949661) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006cdfaf8}, subKind=0, subIdx=-1
....[05] (879755353) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006cde5e8}, subKind=0, subIdx=-1
....[06] (884998238) obroFlags=0x200c0000, viRefFlags=0x00000000, h/objID={h=0x0000000006996480,o=0x0000000006cde008}, subKind=0, subIdx=-1

 

Edited by flarn2006
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.