From d1ffc3ff0fba208b29056c3c39ad78062c813114 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Thu, 12 Jan 2017 16:47:06 +0000 Subject: development revision --- dev/c/index.html | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 dev/c/index.html (limited to 'dev/c') diff --git a/dev/c/index.html b/dev/c/index.html new file mode 100644 index 0000000..09374c6 --- /dev/null +++ b/dev/c/index.html @@ -0,0 +1,103 @@ + + + + + C & GDB + + + Development Index + +

C & GDB

+ +

C program with autotools +

+ +
+        $ touch NEWS README AUTHORS ChangeLog
+        $ mkdir -p src/bin src/lib
+        
+ +

+ GDB Quick Start, + Learning C with GDB + and Memory Layout and the Stack + are great sources of introductory information. +

+ +

To use gdb you need to compile program with -g flag. To + debug a program;

+ +
+        gdb program
+        
+ +

If the program needs arguments you can set it;

+ +
+        (gdb)set args -parameter1 -parameter2
+        
+ +

To start the program you can type run, this way gdb + will try to run the program until the end. If program + crash, gdb will stop it for debuging.

+ +
+        (gdb) run
+        
+ +
+        n - execute next line
+        s - step in next line
+        b - backtrace
+        info locals
+        print
+        x
+        
+ +

SysCalls

+ +
catch syscall open
+ +

Threads

+ +

When new thread is created you receive + a notification. To get information about + threads;

+ +
+        info threads
+        
+ +

To select thread;

+ +
+        thread 1
+        
+ +

Stopping and Starting + multi-thread programs

+ +
+        break linespec thread threadno
+        
+ +

Strace

+ +
+        strace -c ./program
+        
+ + + Development Index +

+ This is part of the c9-doc Manual. + Copyright (C) 2016 + c9 team. + See the file Gnu Free Documentation License + for copying conditions.

+ + + + + + -- cgit 1.4.1-2-gfad0