安装依赖
代码语言:javascript复制yum -y install coreutils glib2 lrzsz mpstat dstat sysstat e4fsprogs xfsprogs ntp readline-devel zlib-devel openssl-devel pam-devel libxml2-devel libxslt-devel python-devel tcl-devel gcc make smartmontools flex bison perl-devel perl-ExtUtils* openldap-devel jadetex openjade bzip2
./configure --prefix=$HOME/pgsql --enable-depend --enable-cassert --enable-debug --enable-debug CFLAGS="-ggdb -O0"
修改CMakeLists.txt,内容如下
代码语言:javascript复制cmake_minimum_required(VERSION 3.6)
project(postgres)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c 11")
add_custom_target(postgres COMMAND make -C ${postgres_SOURCE_DIR})
打开debug configuration,增加一个Application,Target选postgres,Executable选择到源码目录的src/backend/postgres
,程序参数写 -D 数据目录
注意PG的新服务后台进程是不会被抓到的,要配下GDB跟踪新fork出来的进程!