jimc
January 25, 2015, 4:25pm
1
There's probably some obvious reason, but why do I get a different result for the last one!?
(lldb) p t[Identifier("alpha")].isVoid()
(bool) $36 = true
(lldb) p t["alpha"].isVoid()
(bool) $37 = true
(lldb) p property
(const juce::Identifier) $38 = {
name = {
text = (data = "alpha")
}
}
(lldb) p t[property].isVoid()
(bool) $41 = false
jules
January 26, 2015, 12:17am
2
No idea! It should all be calling the same method, can't see why that'd happen.
Do all attempts use the same string pool? Perhaps the debugger is creating a new StringPool instance for the newly instantiated Identifiers, or maybe there are shared libs involved in your setup? I'm guessing a bit here but I've ran into problems with Identifiers when playing around with shared/dynamic libs.
I did a couple tests and there doesn't seem to be an issue with the debugger here..which makes sense I suppose.
If you haven't already done so you could check out the memory addresses:
p property.name.text.data
p Identifier("alpha").name.text.data
and/or just compare for equality
p property == Identifier("alpha")
jimc
January 27, 2015, 12:07pm
5
I couldn't see why it was happening either. I thought I was going mad :)
Anyway, I've fixed the underlying problem I was trying to debug (this behaviour was a side issue).
Graeme - if I get a chance I'll have a look at that. That's definitely the right avenue to explore
Thank you both!