samedi 31 juillet 2021

Unable to print a pointer in gdb. Am i facing a stack corruption

(gdb) p dst
$9 = (ad_opg__State *) 0x2995cef0
(gdb) p *dst
$10 = <incomplete type>
(gdb) p dst->state
There is no member named state.
(gdb)
(gdb) n
ad_trf::Serialize::serializeRecording (this=this@entry=0x859e00 <<ad_trf::RecordingFactory>::GetInstance()::instance+64>, src=0x2995f110) at Serialize.cpp:379
379                     dst->status = src->m_Status;
(gdb) p dst
$21 = (ad_opg__Recording *) 0x2995cef0
(gdb) p *dst
$22 = <incomplete type>
(gdb) p dst->state
There is no member named state.
(gdb) p *(0x2995cef0)
$23 = -2109491384
(gdb) 
(gdb) p/s  *(ad_opg__Recording *) 0x2995cef0
No symbol "ad_opg__Recording" in current context.
(gdb)

I feel the incomplete type is because these classes are in a separate module which hasn't got debug symbols enabled ( and i can't do it either because of lack of space in the filesystem. This is an embedded system with aarch64)

But i am interested to know if i am facing a stack corruption. Because i can atleast explore valgrind options instead.

In the snippet above, where I get this -

(gdb) p *(0x2995cef0)
$23 = -2109491384

Is this indicating stack corruption ? I am not getting into details of ad_opg__State or ad_opg__Recording and what the relationship between them are. It would help to know if i am facing a stack corruption from this gdb trace. Any help appreciated.

Aucun commentaire:

Enregistrer un commentaire