вторник, 21 апреля 2020 г.

gdb, glibc, makefile

1. Просмотр стэка:

bt

2. Просмотр регистров:

info registers

3. Брикпоинт с условием:

b <название функции или номер строки в файле> if <название переменной (операнда)> <бинарный булевый оператор> <константа>

Например, b pack_values if number > 240

4. Удалить все брикпоинты:

delete

Для дополнительной отладочной информации:

1) glibc (прога на си):

sudo dnf debuginfo-install glibc-2.30-11.fc31.x86_64

2) для проги на с++:

sudo dnf debuginfo-install libgcc-9.3.1-1.fc31.x86_64 libstdc++-9.3.1-1.fc31.x86_64

gdb stack:
1) http://kirste.userpage.fu-berlin.de/chemnet/use/info/gdb/gdb_7.html
2) https://stackoverflow.com/questions/7848771/how-can-one-see-content-of-stack-with-gdb
3) https://darkdust.net/files/GDB%20Cheat%20Sheet.pdf

gdb breakpoint condition:
1) https://www.sourceware.org/gdb/onlinedocs/gdb/Conditions.html

bool, ulong, ushort in c:
1) https://www.educative.io/edpresso/what-is-boolean-in-c
2) https://www.dreamincode.net/forums/topic/275692-what-does-%23define-ushort-unsigned-short-mean-in-c/

Wall, defines in Makefile for gcc:
1) https://www.rapidtables.com/code/linux/gcc/gcc-d.html
2) https://www.rapidtables.com/code/linux/gcc/gcc-wall.html

Default c language standart mode (setting -std=c99):
1) https://stackoverflow.com/questions/14737104/what-is-the-default-c-mode-for-the-current-gcc-especially-on-ubuntu
2) https://stackoverflow.com/questions/2193634/setting-std-c99-flag-in-gcc

gcc docs:
1) https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/

Управление оптимизацией кода GCC:
1) https://tproger.ru/translations/will-it-optimize-gcc/
2) http://blog.kislenko.net/show.php?id=1991
3) https://www.cyberforum.ru/qt/thread1739828.html
4) https://issue.life/questions/5765899
5) https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Возвращаемое программой значение:
1) https://www.tutorialspoint.com/cprogramming/c_error_handling.htm
2) https://www.geeksforgeeks.org/error-handling-c-programs/

Комментариев нет:

Отправить комментарий