Debug Fastdfs-storage in Eclipse

Source: Internet
Author: User

Fdfs version is 5.03

1. First create a C + + project in Eclipse named fastdfs_v5.03

2, the Fastdfs source extracted after the copy to the newly created project directory, and then in the Ecipse refresh under the project can see the new copy of the file as follows:

3. Modify the make.sh in the project directory, add the location to the absolute directory, and remove the compilation optimization (so that the program executes in sequence)

1) Add two lines at the beginning of the make.sh

cd/users/bigfish/documents/workspace/c++/fastdfs_v5.03  (modified to absolute path) pwd

2) Removal of compilation optimizations

cflags= '-wall-d_file_offset_bits=64-d_gnu_source ' if ["$DEBUG _flag" = "1"];   then cflags= "$CFLAGS-G-o0-ddebug_flag"       else   cflags= "$CFLAGS-o3" fi---Add a 0 after the third row-O

  4, modify the code in the debug mode of operation do not enter the daemon mode

1) Modify the Storage/fdfs_storaged.c file as follows:

#ifndef Debug_flagdaemon_init (False), #endif-The red part is added, and if it is DEBUG, do not enter daemon mode to run

5. Configuring Eclipse

1) Select the project Properties C + + Build page, remove the option to use the Default Build command, enter the compile command in the build command text box

sh/users/bigfish/documents/workspace/c++/fastdfs_v5.03/make.sh--path according to its own settings

2) Select the project properties C + + general-> Paths and Symbols---> includes and GNU C add the paths included at compile time

/users/bigfish/documents/workspace/c++/fastdfs_v5.03/storage/fdht_client/users/bigfish/documents/workspace/c++ /fastdfs_v5.03/tracker/users/bigfish/documents/workspace/c++/fastdfs_v5.03/client/users/bigfish/documents/ workspace/c++/fastdfs_v5.03/storage/users/bigfish/documents/workspace/c++/fastdfs_v5.03/common--according to its own path setting

3) Select Project Properties Run/debug Settings Create a new Run command

Enter executed programs in main---C + + Applications text box

/users/bigfish/documents/workspace/c++/fastdfs_v5.03/storage/fdfs_storaged

Enter startup parameters in Arguments---Program Arguments text box

/users/bigfish/documents/workspace/c++/fastdfs_v5.03/conf/storage.conf

All right, finish it.

    

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.