Skip to content
Christian Schwarzgruber edited this page Feb 25, 2019 · 3 revisions

Debugging RTags

If you find that rp is crashing (leading to output like this: “job crashed 191 9698036154370 0x331e7e30”). You should be able to do the following:

rdm --suspend-rp-on-crash

When rp crashes the rp process will stay alive, enabling you to debug it with something like this:

gdb -p `pidof rp`

Coding style

We are always excited to accept bug fixes, improvements and features through code contributions. Feel free to send a pull request for anything you think could be improved upon.

We’d like contributions to adhere to our coding style.

The coding style can kinda be deduced from this:

if (foo) {
    while (!done) {
        switch (value) {
        case 1:
            break;
        case 2: {
            int variable = 12;
            break; }
        case 3:
            break;
        }
    }
    for (auto foo : vars) {

    }
}

void test(const std::string &bar);

class Foo
{
private:
    int mPrivateMember;
};

struct Bar
{
    int publicMember;
};

class A
{
public:
    A(int val);
private:
    int mValue;
};

A::A(int val)
    : mValue(val)
{
}

conn->setErrorHandler([](const SocketClient::SharedPtr &, Message::MessageError &&error) {
        if (error.type == Message::Message_VersionError) {
            ::error("Wrong version marker. You're probably using mismatched versions of rc and rdm");
        } else {
            logDirect(LogLevel::Error, error.text);
        }
    });

Tests

There are some tests available in the tests directory, and in src/rct/tests (Unit Tests). The test target will be generated by default. You can disable the generation of the test target by calling cmake like this:

cmake -DBUILD_TESTING=0

To run the tests, call make with the target test, or ctest.

make all                       # Build the binaries first
make test
ctest                          # Call ctest directly

The tests directory contains further directories, each contains different test types.

Directory Type Requires
tests/automated functional tests using nose (python) python 2/3, nose, PyHamcrest
tests/manual manual tests
tests/sbroot sbroot test (perl) perl
src/rct/tests rct Unit Tests (cppunit) cppunit

Creating an archive of the source code

An archive of the source code can be created by passing the option RTAGS_ENABLE_DEV_OPTIONS=1 to cmake. This flag is mutual exclusive, which means, no build files will be generated, only the CMake package CPack will be loaded to create Makefiles for the archive generation. By default a ‘TGZ’ archive will be created when calling make package_source. This can be changed with the option CPACK_GENERATOR, see CPACK Archive Generators for possible values.

mkdir build
cd build
cmake .. -DRTAGS_ENABLE_DEV_OPTIONS=1
make package_source

Updating the manual pages

To update the manual pages for the executables rc and rdm execute the target man. The target man will execute the script scripts/gen-man-pages.sh with the RTags binary directory as argument.

mkdir build
cd build
cmake .. 

make man

cd ..
git add man
git commit -m'[DOC] Update manual pages'
git push