Created
November 15, 2022 15:56
-
-
Save mortymacs/9c65c23f619de4dc7d54bca6d571283f to your computer and use it in GitHub Desktop.
Breakpoint in C/C++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void bp(){} | |
void test() { | |
int i; | |
i = 100; | |
bp(); | |
i = 200; | |
} | |
int main() { | |
std::cout << "hi" << std::endl; | |
test(); | |
std::cout << "bye" << std::endl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
g++ -o main main.cc -g | |
gdb -ex 'b bp' main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just an empty breakpoint function in order to introduce it to GDB