• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
brx

Visual Studio 2012 Natvis files

0 posts in this topic

So... this is my final attempt.

I've tried stackoverflow:
[url="http://stackoverflow.com/questions/13748209/visual-studio-2012-natvis-skip-indexlistitems"]http://stackoverflow.com/questions/13748209/visual-studio-2012-natvis-skip-indexlistitems[/url]

I've tried the msdn forums:
[url="http://social.msdn.microsoft.com/Forums/en-US/Offtopic/thread/5b788606-1dfc-4bdd-a67c-451f1dba8dcb"]http://social.msdn.microsoft.com/Forums/en-US/Offtopic/thread/5b788606-1dfc-4bdd-a67c-451f1dba8dcb[/url]
but so far I've received no help...

So, with VS2012 the new concept of natvis files for visualizations inside the debugger has been introduced... So far the Qt developers have failed to update their VS-plugin to work with VS2012, so I am trying to roll my own... It seems like I've gotten most of what I need to work, but I'm having a big problem with the QHash class. This is what I have so far:

[CODE]
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

<Type Name="QString">
<DisplayString>{d->data,su}</DisplayString>
<StringView>d->data,su</StringView>
</Type>

<Type Name="QByteArray">
<DisplayString>{d->data,s}</DisplayString>
</Type>

<Type Name="QList&amp;amp;lt;*&amp;amp;gt;">
<AlternativeType Name="QQueue&amp;amp;lt;*&amp;amp;gt;" />
<DisplayString>{{size = {d->end - d->begin}}}</DisplayString>
<Expand>
<Item Name="[size]">d->end - d->begin</Item>
<IndexListItems>
<Size>d->end - d->begin</Size>
<ValueNode>($T1*)((d->array + d->begin)[$i])</ValueNode>
</IndexListItems>
</Expand>
</Type>

<Type Name="QVector&amp;amp;lt;*&amp;amp;gt;">
<DisplayString>{{size = {d->size}}}</DisplayString>
<Expand>
<Item Name="[size]">d->size</Item>
<Item Name="[capacity]">d->alloc</Item>
<IndexListItems>
<Size>d->size</Size>
<ValueNode>(p->array[$i])</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="QHashNode&amp;amp;lt;*,*&amp;amp;gt;">
<DisplayString Condition="next->next == 0">{{ key={key} value={value} h={h}}}</DisplayString>
<DisplayString>{{ key={key} value={value} h={h} withCollision }}</DisplayString>
<Expand>
<Item Name="NextNode">reinterpret_cast&amp;amp;lt;QHashNode&amp;amp;lt;$T1,$T2&amp;amp;gt; *&amp;amp;gt;(next)</Item>
</Expand>
</Type>
<Type Name="QHash&amp;amp;lt;*,*&amp;amp;gt;">
<DisplayString>{{ size={d->size} buckets={d->numBuckets} }}</DisplayString>
<Expand>
<IndexListItems>
<Size>d->numBuckets</Size>
<ValueNode Condition="reinterpret_cast&amp;amp;lt;QHashNode&amp;amp;lt;$T1,$T2&amp;amp;gt; *&amp;amp;gt;(d->buckets[$i]) != e">reinterpret_cast&amp;amp;lt;QHashNode&amp;amp;lt;$T1,$T2&amp;amp;gt; *&amp;amp;gt;(d->buckets[$i])</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="QSet&amp;amp;lt;*&amp;amp;gt;">
<DisplayString>{{ size={q_hash.d->size} buckets={q_hash.d->numBuckets} }}</DisplayString>
<Expand>
<IndexListItems>
<Size>q_hash.d->numBuckets</Size>
<ValueNode Condition="reinterpret_cast&amp;amp;lt;QHashNode&amp;amp;lt;$T1,QHashDummyValue&amp;amp;gt; *&amp;amp;gt;(q_hash.d->buckets[$i]) != q_hash.e">reinterpret_cast&amp;amp;lt;QHashNode&amp;amp;lt;$T1,QHashDummyValue&amp;amp;gt; *&amp;amp;gt;(q_hash.d->buckets[$i])</ValueNode>

</IndexListItems>
</Expand>
</Type>
<Type Name="QMapNode&amp;amp;lt;*,*&amp;amp;gt;">
<DisplayString>{{ key={key} value={value} }}</DisplayString>

</Type>
<Type Name="QMap&amp;amp;lt;*,*&amp;amp;gt;">
<DisplayString>{{size = {d->size}}}</DisplayString>
<Expand>
<LinkedListItems>
<Size>d->size</Size>
<HeadPointer>d->forward[0]</HeadPointer>
<NextPointer>forward[0]</NextPointer>
<ValueNode>reinterpret_cast&amp;amp;lt;QMapNode&amp;amp;lt;$T1,$T2&amp;amp;gt;* &amp;amp;gt;(reinterpret_cast&amp;amp;lt;char*&amp;amp;gt;(this) - (sizeof(QMapPayloadNode&amp;amp;lt;$T1,$T2&amp;amp;gt;) - sizeof(QMapData::Node*)))</ValueNode>
</LinkedListItems>
</Expand>
</Type>

</AutoVisualizer>
[/CODE]
It seems to me like all classes work as expected. But the QHash class pre-allocates some memory and only fills some if it. (The important part is the QHash and QHashNode part)

[b]Now, my question is, whether anybody know if there is a way to just skip those values in the debugger display? [/b]

With the nativs file above, I get a lot of entries that are displayed as "<unable to display value>". With the old autoexp.dat files, values that didn't match a rule, were not displayed at all (see the linked posts). Does anybody happen to know a way to achieve the same in the new natvis format?

I am pretty pissed at the Microsoft support for saying it is a Qt problem, even though it is clearly reproducable without using Qt. So if you are running into a similar problem (or you are actually using Qt), I'd appreciate if you tell the MSDN guys that this IS a problem, and that you'd like this feature to be included (if itsn't already and I just don't know how to and the MSDN guys don't wan't to share - which I doubt). Edited by brx
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0