API Object GetDebugName

Returns the object's debug name.
 debugName = Object:GetDebugName([preferParentKey])
==Arguments==
:;preferParentKey:
==Returns==
:;debugName:
==Example==
Returns the global name if applicable.
/dump CharacterFrame.TitleText:GetDebugName() -- "CharacterFrameTitleText" ($parentTitleText)
/dump CharacterFrame.TitleBg:GetDebugName() -- "CharacterFrame.TitleBg"
Anonymous children are shown as memory addresses.
local f = CreateFrame("Frame", "SomeFrame")
local named = f:CreateTexture("SomeTexture")
local anon = f:CreateTexture()
print(named:GetDebugName()) -- "SomeTexture"
print(anon:GetDebugName()) -- "SomeFrame.156f1390860"
Anonymous frames without a parent cannot return a debug name.
local a = CreateFrame("Frame")
print(a:GetDebugName() == "") -- true
a:SetParent(CharacterFrame)
print(a:GetDebugName()) -- "CharacterFrame.161f8793330"
CharacterFrame.b = CreateFrame("Frame")
print(CharacterFrame.b:GetDebugName() == "") -- true
CharacterFrame.b:SetParent(CharacterFrame)
print(CharacterFrame.b:GetDebugName()) -- "CharacterFrame.b"