sise@marelli:~/lab$ cat -n lab.c
1 /*
2 file name:lab.c
3 date : Mon 28 Feb 2022 08:14:05 PM EST
4 */
5 #include <stdio.h>
6
7 struct s
8 {
9 int a;
10 struct s *b;
11 };
12
13
14 int main(int argc, char *argv[])
15 {
16 struct s t = {0};
17 return 0;
18 }
19
sise@marelli:~/lab$ gcc -g lab.c
sise@marelli:~/lab$ gdb a.out
GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
T
利用gdb打印结构体的成员的偏移量
最新推荐文章于 2024-05-02 19:07:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)