topics:gdb
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
topics:gdb [2014/11/09 09:37] – [Weiterfahren nach Breakpoint] ninux | topics:gdb [2014/11/15 20:13] (aktuell) – [Makefile] ninux | ||
---|---|---|---|
Zeile 42: | Zeile 42: | ||
</ | </ | ||
+ | ==== Makefile ==== | ||
+ | <code make |Makefile> | ||
+ | CFLAGS = -I. -lm -std=gnu11 | ||
+ | SOURCES = main.c | ||
+ | |||
+ | .PHONY: all clean | ||
+ | |||
+ | main: | ||
+ | gcc $(CFLAGS) -o main.o $(SOURCES) | ||
+ | | ||
+ | debug: | ||
+ | gcc $(CFLAGS) -g -o debug.o $(SOURCES) -DDEBUG | ||
+ | | ||
+ | all: | ||
+ | gcc $(CFLAGS) -o main.o $(SOURCES) | ||
+ | gcc $(CFLAGS) -g -o debug.o $(SOURCES) -DDEBUG | ||
+ | |||
+ | clean: | ||
+ | rm main.o | ||
+ | rm debug.o | ||
+ | </ | ||
==== Compiler-Option ==== | ==== Compiler-Option ==== | ||
Um das obige '' | Um das obige '' | ||
Zeile 51: | Zeile 72: | ||
Um das kompilierte Programm ('' | Um das kompilierte Programm ('' | ||
<code shell> | <code shell> | ||
- | [user@machine ]$ gdb | + | $ gdb |
</ | </ | ||
Zeile 107: | Zeile 128: | ||
==== Variableninhalt anzeigen ==== | ==== Variableninhalt anzeigen ==== | ||
- | Um bei einem Breakpoint Variableninhalte anzeigen zu lassen, kann das Kommando '' | + | Um bei einem Breakpoint Variableninhalte anzeigen zu lassen, kann das Kommando '' |
<code shell> | <code shell> | ||
(gdb) print c | (gdb) print c | ||
Zeile 120: | Zeile 141: | ||
==== Info zu Breakpoints anzeigen ==== | ==== Info zu Breakpoints anzeigen ==== | ||
- | Um eine Übersicht der aktuellen Breakpoints zu bewahren gibt es das Kommando '' | + | Um eine Übersicht der aktuellen Breakpoints zu erhalten kann das Kommando '' |
<code shell> | <code shell> | ||
(gdb) info breakpoints | (gdb) info breakpoints | ||
Zeile 135: | Zeile 156: | ||
===== Weblinks ===== | ===== Weblinks ===== | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
---- dataentry topic ---- | ---- dataentry topic ---- | ||
Zeile 141: | Zeile 164: | ||
beginner_users : ninux | beginner_users : ninux | ||
wannabe_users | wannabe_users | ||
- | category_topictags : # | + | category_topictags : software, programming |
---- | ---- |
topics/gdb.txt · Zuletzt geändert: 2014/11/15 20:13 von ninux