Skip to content

Add support for user linked lists without size specifier#67

Closed
ariaci wants to merge 0 commit intoawulkiew:masterfrom
ariaci:master
Closed

Add support for user linked lists without size specifier#67
ariaci wants to merge 0 commit intoawulkiew:masterfrom
ariaci:master

Conversation

@ariaci
Copy link

@ariaci ariaci commented Jan 20, 2025

In some legacy C++-code linked lists are implemented without having a size-member or -field. That's why it's very difficult to display these polygons - sometimes impossible because graphical debugger doesn't know something about the number of nodes or polygons.

This commit adds support for linked lists without specifiying the Size-trait in LinkedList-node.
With this modification Graphical Debugger stops iterating at last element. The last node is determined by a null-node or the initial head-element. In this way you are also able to iterate through circular linked lists.

<Ring Id="MyRing">
  <Points>
    <LinkedList>
      <Size>???????</Size>
      <HeadPointer>&amp;head</HeadPointer>
      <NextPointer>next</NextPointer>
      <Value>*this</Value>
    </LinkedList>
  </Points>
</Ring>

The above shown example using MyRing without a size member could be displayed in graphical debugger by the following code:

<Ring Id="MyRing">
  <Points>
    <LinkedList>
      <HeadPointer>&amp;head</HeadPointer>
      <NextPointer>next</NextPointer>
      <Value>*this</Value>
    </LinkedList>
  </Points>
</Ring>

@awulkiew
Copy link
Owner

Thanks for the PR. That's a good idea but you mixed parsing and memory-access. ForEachElement shouldn't use mreader, it should simply go through the elements by name.

@ariaci
Copy link
Author

ariaci commented Jan 21, 2025

Ah! Ok - that's a good hint - thank you ... I will try to implement the existing behaviour without accessing mreader in ForEachElement ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants