[Linux][Kernel][Debug] T32 - container_of 매크로

Guillermo Austin Kim|2017년 11월 29일
Posts

[Linux][Kernel][Debug] T32 - container_of 매크로

Guillermo Austin Kim|2017년 11월 29일

리눅스 커널 코드를 분석하다 보면 아래 container_of 매크로를 자주 만날 수 있어요.void t21142_media_task(struct work_struct *work){ struct tulip_private *tp = container_of(work, struct tulip_private, media_work); struct net_device *dev = tp->dev; 그럼 T32으로 코어 덤프를 분석 할 때 위 매크로를 그대로 가져다 쓸 수 있는 방법이 있어요. 아주 간단히, 아래 명령어를 치면 되죠.sYmbol.NEW.MACRO offsetof(type,member) ((int)(&((type*)0)->member))sYmbol.NEW.MACRO container_o