-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a struct type with editor #181
base: master
Are you sure you want to change the base?
Conversation
…t a struct map with namespace, structDef* pairs
… the structmap to the MemWatchModel.
…apsing struct nodes.
…r collapsing a container node.
…truct for use if a struct has been updated. Implemented updateStructEntries to use update struct node for all recorded nodes which use an updated struct definition.
…s to having a nullptr in the structDef* which would indicate a remove action. If a structDef* is included, it indicates an add action
…l for all child nodes which are structs.
…th is greater than the old field length, any padding fields after the changed field that would overlap with the updated field are now removed.
…the save struct button. When struct details are saved, now disables the save struct button
…save the currently loaded struct, now uses the onSaveStruct method for consistency with the save struct button.
…r convert padding to an actual field, or it will change the details of the field.
…saving the struct to prevent unlinking of the struct length and the fields it contains.
…t should not be saved when validating a new length.
…will be populated with the appropriate child nodes.
…when an update is triggered.
…f the initial entry or edited entry was a container and will populate it appropriately.
…r type but the new one is not, should delete all children of the node.
…l if a name is taken. This is used by the widget to display the name taken warning.
…ct model now returns the new node so that the structAddedRemoved signal can be emitted.
…mits the struct name changed signal when data is edited in the select model.
…a mem watch file with struct definitions.
… structs available since this dialog should prevent any interaction with the struct editor while it is open.
… need to update the struct type label in the node in the editor as well as the detail model for any pointer references
… a node in the detail editor, need to update that node as well.
…update any pointer reference names in the node and in the struct detail model.
This feature sounds great. Ill be trying some builds of this in the interim. Review is huge so it may be a while, even after you've fully completed it. |
… type_struct, now hides the struct select combobox.
…ormatting of more details field when there is a struct with the same name already in the struct editor
… struct type, it should setup the struct
…ng over the nodes, if a nested node was a pointer to the same type but was changed to a different type, the loop could use nodes that were out of date. Now checks that the nodes are still valid nodes and are contained in the structNodes object
…ild fields should only be populated if the struct def has child fields. That way it cannot be expanded if there are no fields in the struct def
…be added to the struct node map even if the struct def has no fields, but it should have no placeholder node if there are no fields.
…odes, check if the struct def has fields and if it does, add a placeholder. If it has child nodes, collapse them. Then if it marked expanded, expand the struct node.
…iew. For now only duplicates the field that was right clicked and does not handle selections.
… that will be set by the updateFieldOffsets method.
Definitely, I'll rebase the commits into a single commit before review. |
...but notice that a single commit would be unwieldy from a code review point of view. |
Okay. I'm still pretty new to pull requests, how should I organize the commits so that they are easier to review? |
For now just focus on your feature and when its done we can rediscuss. Its already an unmanageable amount of commits, so easiest scenario is squashing post completion |
This is an attempt to introduce a new struct type. This type would allow the user to define a block of memory using a list of entries with any type. Then the struct would automatically be created when assigned to a memory watch. This includes a number of new features to accomplish this:
A struct definition class (StructDef) which holds the definition of a struct.
A struct field definition class (FieldDef) which holds the field information.
A struct editor widget as a separate window to organize and edit struct definitions.
The ability to select a struct in the DlgAddWatchEntry for memory watches.
The automatic creation and deletion of memory watches using struct definitions as a template.
Saving and loading the struct tree to/from the settings on application start and close.
Saving and loading any currently used struct definitions to/from a memory watch file.
This is a draft pull request while I do some testing, bug fixing, and refactoring, but has most of the features fully implemented, so I wanted some feedback. I am open to any feedback, but am wondering about a few design choices in particular:
In the mem watcher, structs are expandable, so if a struct type with a known struct definition is found it will be given a "placeholder" child to allow the user to expand the struct. At the moment, the fields of the struct will be created on expansion and deleted on collapsing of the struct.
I added an icon to identify structs in the mem watcher.
Struct fields are currently checked to make sure that they do not overlap. This is not strictly necessary, and there is a case to be made for fields that may overlap (Unions, bitfields, etc.).