1. Compilation for GDB

Compile with -g flag

 

2. Run GDB

 -  Run a program with gdb

$ gdb <program>

 - Attach a running program with gdb

$ gdb
(gdb)attach <pid>

 - Run a program and a core with gdb

$ gdb <program> <core_file>

 

3. GDB commands

 - quit / q: quit GDB

 - run / r: run from start

 - break / b <location>: set a break point

 - watch <variable>: set a watch point

 - step / s: run a step

 - next / n: run next

 - continue / c: continue to the next break point

 - info break / locals / args: print the information of breakpoints / local variables / arguments for stack frame function

 - print <variable / pointer / function>: print the value of variable / address of pointer / address of function

 - list: print 10 lines of current source code

* location = file_name:function_name | file_name:line_number | class::function_name

'Programming > Linux' 카테고리의 다른 글

PCI device rescan  (0) 2022.09.25
Piping ls to cp  (0) 2020.12.02
PhantomJS Installation on Ubuntu from source  (0) 2018.12.10
Linux screen  (0) 2018.09.27
Xshell + Xming  (0) 2018.09.10

인생에서 절대 잊어버리지 말아야 할 사람은 미운 사람이 아니고 좋은 사람이오. 미운 사람을 가슴에 담고 살면 담고 사는 내내 당신 마음에 생채기나고 아프고. 당신만 손해요.
드라마 사랑의 불시착 중에서

'Life > A sentense of the day' 카테고리의 다른 글

가까이에 좋은 사람을 두어야 하는 이유  (0) 2020.07.23
진짜는  (0) 2020.05.13
인정  (0) 2020.02.06
세 황금문  (0) 2018.12.03
  (0) 2018.11.22
function integer log2;
    input integer x;
    integer n, m;
begin
    n = 0;
    m = 1;
    while (m < x) begin
        n = n + 1;
        m = m * 2;
    end
    log2 = n;
end
endfunction

'Programming > Verilog' 카테고리의 다른 글

AXI Buffer  (1) 2020.04.04
AXI FIFO  (0) 2020.02.13
AXI Register Slice  (0) 2020.02.12
Verilog Generate  (2) 2018.07.05
Xilinx bootgen  (0) 2017.06.21

+ Recent posts