Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 28 Jan 2011
Offline Last Active Oct 21 2014 11:42 PM

Topics I've Started

Visual Studio 2012 Natvis files

17 December 2012 - 01:26 PM

So... this is my final attempt.

I've tried stackoverflow:

I've tried the msdn forums:
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:

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

  <Type Name="QString">

  <Type Name="QByteArray">

  <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>
<Item Name="[size]">d->end - d->begin</Item>
  <Size>d->end - d->begin</Size>
  <ValueNode>($T1*)((d->array + d->begin)[$i])</ValueNode>

<Type Name="QVector&amp;amp;lt;*&amp;amp;gt;">
<DisplayString>{{size = {d->size}}}</DisplayString>
<Item Name="[size]">d->size</Item>
<Item Name="[capacity]">d->alloc</Item>
<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>
  <Item Name="NextNode">reinterpret_cast&amp;amp;lt;QHashNode&amp;amp;lt;$T1,$T2&amp;amp;gt; *&amp;amp;gt;(next)</Item>
<Type Name="QHash&amp;amp;lt;*,*&amp;amp;gt;">
    <DisplayString>{{ size={d->size} buckets={d->numBuckets} }}</DisplayString>
   <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>
<Type Name="QSet&amp;amp;lt;*&amp;amp;gt;">
    <DisplayString>{{ size={q_hash.d->size} buckets={q_hash.d->numBuckets} }}</DisplayString>
   <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>

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

<Type Name="QMap&amp;amp;lt;*,*&amp;amp;gt;">
  <DisplayString>{{size = {d->size}}}</DisplayString>
	  <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>

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)

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

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).

[java] Eclipse's JarRsrcLoader and Implementation-Version attribute in manifest files

31 May 2011 - 03:52 AM

For my project I need to use the jarinjar loader of eclipse for deployment because some of the third party jars I am using need to keep their signature (namely the bouncycastle encryption library).

Now I want to add package versioning information. But after adding the "Implementation-Version" attribute to my ant file
still returns null.

I have the feeling that since my main-class is the JarRsrcLoader instead of my actual main-class the Implementation-Version is not passed through to my actual package. Does anybody have an idea how to solve this, or what I am doing wrong?

Here's the excerpt of my ant build file (slightly changed for NDA reasons and for brevity ):

<jar destfile="mytool${rmversion}${buildtime}.jar">
	<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
	<attribute name="Rsrc-Main-Class" value="com.fs.Server"/>
	<attribute name="Class-Path" value="."/>
	<attribute name="Rsrc-Class-Path" value="./ bcprov-jdk16-145.jar"/>
	<attribute name="Implementation-Version" value="${rmversion}${buildtime}"/>
  <zipfileset src="jar-in-jar-loader.zip"/>
  <fileset dir="work" />
  <fileset dir="WEB-INF/classes" />
  <fileset dir="WEB-INF/lib" />
The properties rmversion and buildtime are set correctly. I also tried to embed the Implementation-Version attribute inside a section with the name of the package I want to add the information to.

Any help is highly appreciated.