cd folder
gdb --args appname [your-args-here]
- set breakpoints with
bfunction orb file:lineorb class:function - display stack with
bt - change stack frame with
f N - display threads with
tnumber - change thread with
t N
| // [ref] https://www.niksula.hut.fi/~hkankaan/Homepages/changeable%20colors.html | |
| // This is my example picture. Now I want to make that red ball to be brown, green to be yellow and blue to be white. Notice that this picture also has antialiased lines. | |
| //slide(x,y) means an array slide(from color,to color) | |
| //these three lines make channel 0 (red channel) brown | |
| //(172 red, 108 green and 48 blue equals brown) | |
| slide(0,0) = 172 | |
| slide(0,1) = 108 | |
| slide(0,2) = 48 |
| #if 0 | |
| // [src] http://nercury.github.io/c++/interesting/2016/02/22/weak_ptr-and-event-cleanup.html | |
| // optimistic event dispatcher v2 | |
| // usage: | |
| { | |
| OptimisticDispatcher<function<void (uint32_t, string)>> event; | |
| auto subscriber = event.add([] (auto number, auto text) { | |
| cout << "Number was " << number << " and text was " << text << endl; | |
| }); |
| // [src] https://github.com/ocornut/imgui/issues/123 | |
| // [src] https://github.com/ocornut/imgui/issues/55 | |
| // v1.22 - flip button; cosmetic fixes | |
| // v1.21 - oops :) | |
| // v1.20 - add iq's interpolation code | |
| // v1.10 - easing and colors | |
| // v1.00 - jari komppa's original | |
| #pragma once |
| // [src] https://github.com/ocornut/imgui/issues/351 | |
| // [src] https://github.com/ocornut/imgui/issues/123 | |
| // v1.0 | |
| #define IMGUI_DOCK_ENABLE_SERIALIZATION 0 | |
| // header | |
| // #pragma once | |
| namespace Lumix { namespace FS { class OsFile; } } |
| #pragma once | |
| #include <stdint.h> | |
| #if defined(__GNUC__) | |
| # define clz(x) __builtin_clz(x) | |
| # define ctz(x) __builtin_ctz(x) | |
| #elif defined(_MSC_VER) | |
| # include <intrin.h> | |
| uint32_t __inline ctz( uint32_t value ) { |
cd folder
gdb --args appname [your-args-here]
b function or b file:line or b class:functionbtf Nt numbert N| struct membuf: std::streambuf { | |
| membuf(char* base, std::ptrdiff_t n) { | |
| this->setg(base, base, base + n); | |
| } | |
| }; | |
| membuf sbuf(base, n); | |
| std::istream in(&sbuf); |
| :: generate git info for C++ inclusion | |
| :: - rlyeh, public domain | |
| git rev-list --count --first-parent HEAD > git.hpp | |
| set /p REVISION=<git.hpp | |
| git rev-parse --abbrev-ref HEAD > git.hpp | |
| set /p BRANCH=<git.hpp | |
| echo #pragma once > git.hpp |
| // src: http://www.gingerbill.org/article/defer-in-cpp.html | |
| // This code requires C++11 features such as move semantics | |
| #pragma once | |
| #include <functional> | |
| namespace Impl | |
| { | |
| template <typename Func> | |
| struct Defer |
| #pragma once | |
| #include <json11/json11.hpp> | |
| #include <flow/flow.hpp> | |
| // @toadd https://placeimg.com/ | |
| // @toadd http://www.pexels.com/ | |
| #include <deque> | |
| #include <string> |