首页 > 数据库技术 > 详细

GDB调试

时间:2016-12-05 02:08:23      阅读:144      评论:0      收藏:0      [点我收藏+]

#include <iostream>
#include <stdlib.h>
#include <stdio.h>

typedef struct buf{
char* datas[5];
int n;
}buf_t;

buf_t buffer;

void* thr_func(void* arg){
int j= 1;
int index;

printf("index=%d\n", index);
printf("pdata=%p\n", buffer.datas[index], index);

return (void*)0;
}

int main()
{
pthread_t pid;

pthread_create(&pid, NULL, thr_func, NULL);

if(pid !=0) {
pthread_join(pid,NULL);
}

return 0;
}

 

 

1 .SUFFIXES: .c .o
2
3 CC=g++
6 CBSJ1=test.cpp
7
8 OBJS1=$(CBSJ1:.c=.o)
11
12
13 EXXX1=forwardTest
14
15
16
17 start:$(OBJS)
18 $(CC) -o $(EXXX1) $(CBSJ1)  -O0 -g -gdwarf-2 -pg -std=c++11 -lpthread
19 .c.o:
20 $(CC) -Wall -g -o $@ -c $<
21 clean:
22 rm -f $(EXXX)

 

gdb forwardTest core.52424

f 0

i locals

 

GDB调试

原文:http://www.cnblogs.com/shenwei1234ab/p/6132327.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!