1

sometimes I just want to add a few extra fields to the type's children view, but if I write a regular type synthetic class, it will show only my new added fields, how can it have those origin fields included automatically without just re-adding them ?

fatfatson
  • 796
  • 10
  • 24

1 Answers1

2

There isn't an option to "type synthetic" to augment the current set of children. Feel free to write a enhancement request for this with http://bugs.llvm.org.

For now, you have to add all the children by hand. Since synthetic child providers are Python classes, it shouldn't be hard to make an "echo" provider class that just reports all the children. Keep that around and then every time you want to add a few fields to some type, make a provider that derives from the "echo" provider, and add the new fields onto it.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63
  • can I make a single SBValue displayed without its synthetic? I just want add a `raw` member to it self – fatfatson Apr 06 '20 at 05:42
  • I'm not sure what you are asking. SBValue.GetNonSyntheticValue gets an SBValue that will give you access to the raw children of the value. – Jim Ingham Apr 06 '20 at 18:25
  • yeah the `SBValue.GetNonSyntheticValue` give me raw children for programmatical accessing, but when I make the `NonSyntheticValue` a child member of the `SyntheticValue`, it will also be displayed as synthetic in debugger GUI. I'm wondering if there's something for setting it should be displayed as original? – fatfatson Apr 07 '20 at 03:01
  • I think you need to get the NonSyntheticValue and add its children one by one to the SyntheticValue. Then you wouldn't get into recursive application of the synthetic child provider... – Jim Ingham Apr 07 '20 at 23:25
  • @fatfatson have you ever found (or implemented) a satisfying solution? I'm looking for the exact same here. – BeyelerStudios Jun 13 '22 at 14:23
  • @BeyelerStudios I have to define a new struct contains the origin with different name, then use the new type for [raw] member – fatfatson Jun 14 '22 at 11:45