[Linux][Debug][T32] macro offsetof/container_of

Guillermo Austin Kim|2017년 7월 16일
Posts

[Linux][Debug][T32] macro offsetof/container_of

Guillermo Austin Kim|2017년 7월 16일

OverviewWhen debugging ramdump with stability issues, I have been spending most of time casting various data structure as belows.v.v %s (struct task_struct*)0xC1917FCCFor this matter, I made several macros to minimize the debugging time.The definition of the macro is below.sYmbol.NEW.MACRO offsetof(type,member) ((int)(&((type*)0)->member))sYmbol.NEW.MACRO container_of(ptr,type,member) ((typ