... in conjunction with '-i' filter for protocol in state -U ......... show unix domain sockets ('@' indicates abstract sock name, see unix(7)) file flags: R/W/RW ..... read/write/read-write CR ......... create AP ......... append TR ......... truncate -s protocols TCP, UDP -s states (TCP) CLOSED, IDLE, BOUND, LISTEN, ESTABLISHED, SYN_SENT, SYN_RCDV, ESTABLISHED, CLOSE_WAIT, FIN_WAIT1, CLOSING, LAST_ACK, FIN_WAIT_2, TIME_WAIT -s states (UDP) Unbound, Idle","breadcrumbs":"Process management & inspection » lsof » lsof(8)","id":"190","title":"lsof(8)"},"191":{"body":"","breadcrumbs":"Process management & inspection » lsof » Examples","id":"191","title":"Examples"},"192":{"body":"Show open files with file flags for process: lsof +fg -p ","breadcrumbs":"Process management & inspection » lsof » File flags","id":"192","title":"File flags"},"193":{"body":"Show open tcp connections for $USER: lsof -a -u $USER -i TCP Note : -a ands the results. If -a is not given all open files matching $USER and all tcp connections are listed ( ored ).","breadcrumbs":"Process management & inspection » lsof » Open TCP connections","id":"193","title":"Open TCP connections"},"194":{"body":"Show open connections to localhost for $USER: lsof -a -u $USER -i @localhost","breadcrumbs":"Process management & inspection » lsof » Open connection to specific host","id":"194","title":"Open connection to specific host"},"195":{"body":"Show open connections to port :1234 for $USER: lsof -a -u $USER -i :1234","breadcrumbs":"Process management & inspection » lsof » Open connection to specific port","id":"195","title":"Open connection to specific port"},"196":{"body":"lsof -i 4TCP -s TCP:ESTABLISHED","breadcrumbs":"Process management & inspection » lsof » IPv4 TCP connections in ESTABLISHED state","id":"196","title":"IPv4 TCP connections in ESTABLISHED state"},"197":{"body":"This may help to find which processes keep devices busy when trying to unmount and the device is currently busy. # Assuming /proc is a mount point.\nlsof /proc","breadcrumbs":"Process management & inspection » lsof » List open files in a mounted directory.","id":"197","title":"List open files in a mounted directory."},"198":{"body":"pidstat [opt] [interval] [cont] -U [user] show username instead UID, optionally only show for user -r memory statistics -d I/O statistics -h single line per process and no lines with average","breadcrumbs":"Process management & inspection » pidstat » pidstat(1)","id":"198","title":"pidstat(1)"},"199":{"body":"pidstat -r -p [interval] [count] minor_pagefault: Happens when the page needed is already in memory but not allocated to the faulting process, in that case the kernel only has to create a new page-table entry pointing to the shared physical page (not required to load a memory page from disk). major_pagefault: Happens when the page needed is NOT in memory, the kernel has to create a new page-table entry and populate the physical page (required to load a memory page from disk).","breadcrumbs":"Process management & inspection » pidstat » Page fault and memory utilization","id":"199","title":"Page fault and memory utilization"},"2":{"body":"","breadcrumbs":"Shells » zsh » zsh(1)","id":"2","title":"zsh(1)"},"20":{"body":"","breadcrumbs":"Shells » bash » Expansion","id":"20","title":"Expansion"},"200":{"body":"pidstat -d -p [interval] [count]","breadcrumbs":"Process management & inspection » pidstat » I/O statistics","id":"200","title":"I/O statistics"},"201":{"body":"pgrep [opts] -n only list newest matching process -u only show matching for user -l additionally list command -a additionally list command + arguments -x match exactly","breadcrumbs":"Process management & inspection » pgrep » pgrep(1)","id":"201","title":"pgrep(1)"},"202":{"body":"For example attach gdb to newest zsh process from $USER. gdb -p $(pgrep -n -u $USER zsh)","breadcrumbs":"Process management & inspection » pgrep » Debug newest process","id":"202","title":"Debug newest process"},"203":{"body":"ps [opt] opt: --no-header .... do not print column header -o ....... comma separated list of output columns -p ....... only show pid -C ...... only show processes matching name -T ............. list threads --signames ..... use short signames instead bitmasks Set PS_FORMAT env variable to setup default output columns. Frequently used output columns pid process id\nppid parent process id\npgid process group id\ntid thread id comm name of process\ncmd name of process + args (full) etime elapsed time (since process started)\nuser user owning process\nthcount thread count of process\nnice nice value (-20 highest priority to 19 lowest) pcpu cpu utilization (percent)\npmem physical resident set (rss) (percent)\nrss physical memory (in kb)\nvsz virtual memory (in kb) sig mask of pending signals\nsigcatch mask of caught signals\nsigignore mask of ignored signals\nsigmask mask of blocked signals","breadcrumbs":"Process management & inspection » ps » ps(1)","id":"203","title":"ps(1)"},"204":{"body":"# Print the cpu affinity for each thread of process 31084.\nfor tid in $(ps -o tid --no-header -T -p 31084); do taskset -c -p $tid;\ndone","breadcrumbs":"Process management & inspection » ps » Example: Use output for scripting","id":"204","title":"Example: Use output for scripting"},"205":{"body":"watch -n1 ps -o pid,pcpu,pmem,rss,vsz,state,user,comm -C fish","breadcrumbs":"Process management & inspection » ps » Example: Watch processes by name","id":"205","title":"Example: Watch processes by name"},"206":{"body":"# With signal masks.\nps -o pid,user,sig,sigcatch,sigignore,sigmask,comm -p 66570 # With signal names.\nps --signames -o pid,user,sig,sigcatch,sigignore,sigmask,comm -p 66570","breadcrumbs":"Process management & inspection » ps » Example: Show signal information","id":"206","title":"Example: Show signal information"},"207":{"body":"pmap [opts] Dump virtual memory map of process. Compared to /proc//maps it shows the size of the mappings.\nopts: -p show full path in the mapping -x show details (eg RSS usage of each segment)","breadcrumbs":"Process management & inspection » pmap » pmap(1)","id":"207","title":"pmap(1)"},"208":{"body":"pstack Dump stack for all threads of process.","breadcrumbs":"Process management & inspection » pstack » pstack(1)","id":"208","title":"pstack(1)"},"209":{"body":"Set cpu affinity for new processes or already running ones. # Pin all (-a) tasks of new command on cores 0,1,2,4.\ntaskset -ac 0-2,4 CMD [ARGS] # Pin all tasks of running PID onto cores 0,2,4.\ntaskset -ac 0-5:2 -p PID","breadcrumbs":"Process management & inspection » taskset » taskset(1)","id":"209","title":"taskset(1)"},"21":{"body":"# generate sequence from n to m\n{n..m}\n# generate sequence from n to m step by s\n{n..m..s} # expand cartesian product\n{a,b}{c,d}","breadcrumbs":"Shells » bash » Generator","id":"21","title":"Generator"},"210":{"body":"Utility script to extract cpu lists grouped by the last-level-cache. import subprocess res = subprocess.run([\"lscpu\", \"-p=cpu,cache\"], capture_output=True, check=True) LLC2CPU = dict() for line in res.stdout.decode().splitlines(): if line.startswith(\"#\"): continue cpu, cache = line.split(\",\") llc = cache.split(\":\")[-1] LLC2CPU.setdefault(llc, list()).append(int(cpu)) LLC2RANGE = dict() for llc, cpus in LLC2CPU.items(): first_cpu = cpus[0] prev_cpu = cpus[0] for cpu in cpus[1:]: if cpu != prev_cpu + 1: LLC2RANGE.setdefault(llc, list()).append(f\"{first_cpu}-{prev_cpu}\") # New range begins. first_cpu = cpu prev_cpu = cpu # Trailing range. LLC2RANGE.setdefault(llc, list()).append(f\"{first_cpu}-{prev_cpu}\") print(LLC2RANGE)","breadcrumbs":"Process management & inspection » taskset » Example","id":"210","title":"Example"},"211":{"body":"Adjust niceness of a new command or running process. Niceness influences the scheduling priority and ranges between: -20 most favorable 19 least favorable # Adjust niceness +5 for the launched process.\nnice -n 5 yes # Adjust niceness of running process.\nrenice -n 5 -p PID","breadcrumbs":"Process management & inspection » nice » nice(1)","id":"211","title":"nice(1)"},"212":{"body":"time strace ltrace perf OProfile callgrind valgrind","breadcrumbs":"Trace and Profile » Trace and Profile","id":"212","title":"Trace and Profile"},"213":{"body":"# statistics of process run\n/usr/bin/time -v ","breadcrumbs":"Trace and Profile » time » /usr/bin/time(1)","id":"213","title":"/usr/bin/time(1)"},"214":{"body":"strace [opts] [prg] -f .......... follow child processes on fork(2) -ff ......... follow fork and separate output file per child -p .... attach to running process -s ... max string size, truncate of longer (default: 32) -e ... expression for trace filtering -o ... log output into -c .......... dump syscall statitics at the end -C .......... like -c but dump regular ouput as well -k .......... dump stack trace for each syscall -P ... only trace syscall accesing path -y .......... print paths for FDs -tt ......... print absolute timestamp (with us precision) -r .......... print relative timestamp -z .......... log only successful syscalls -Z .......... log only failed syscalls -n .......... print syscall numbers -y .......... translate fds (eg file path, socket) -yy ......... translate fds with all information (eg IP) -x .......... print non-ASCII chars as hex string -v .......... print all arguments (non-abbreviated) : trace=syscall[,syscall] .... trace only syscall listed trace=file ................. trace all syscall that take a filename as arg trace=process .............. trace process management related syscalls trace=signal ............... trace signal related syscalls signal ..................... trace signals delivered to the process","breadcrumbs":"Trace and Profile » strace » strace(1)","id":"214","title":"strace(1)"},"215":{"body":"Trace open(2) & socket(2) syscalls for a running process + child processes: strace -f -e trace=open,socket -p Trace signals delivered to a running process: strace -e signal -e 'trace=!all' -p Show successful calls to perf_event_open((2) without abbreviating arguments. strace -v -z -e trace=perf_event_open perf stat -e cycles ls","breadcrumbs":"Trace and Profile » strace » Examples","id":"215","title":"Examples"},"216":{"body":"ltrace [opts] [prg] -f .......... follow child processes on fork(2) -p .... attach to running process -o ... log output into -l . show who calls into lib matched by -C .......... demangle","breadcrumbs":"Trace and Profile » ltrace » ltrace(1)","id":"216","title":"ltrace(1)"},"217":{"body":"List which program/libs call into libstdc++: ltrace -l '*libstdc++*' -C -o ltrace.log ./main","breadcrumbs":"Trace and Profile » ltrace » Example","id":"217","title":"Example"},"218":{"body":"perf list show supported hw/sw events & metrics -v ........ print longer event descriptions --details . print information on the perf event names and expressions used internally by events perf stat -p ..... show stats for running process -o .... write output to file (default stderr) -I ...... show stats periodically over interval -e ...... select event(s) -M ..... print metric(s), this adds the metric events --all-user ... configure all selected events for user space --all-kernel . configure all selected events for kernel space perf top -p .. show stats for running process -F ... sampling frequency -K ........ hide kernel threads perf record -p ............... record stats for running process -o .............. write output to file (default perf.data) -F ................ sampling frequency --call-graph .. [fp, dwarf, lbr] method how to caputre backtrace fp : use frame-pointer, need to compile with -fno-omit-frame-pointer dwarf: use .cfi debug information lbr : use hardware last branch record facility -g ..................... short-hand for --call-graph fp -e ................ select event(s) --all-user ............. configure all selected events for user space --all-kernel ........... configure all selected events for kernel space -M intel ............... use intel disassembly in annotate perf report -n .................... annotate symbols with nr of samples --stdio ............... report to stdio, if not presen tui mode -g graph,0.5,callee ... show callee based call chains with value >0.5 Useful : page-faults minor-faults major-faults cpu-cycles` task-clock","breadcrumbs":"Trace and Profile » perf » perf(1)","id":"218","title":"perf(1)"},"219":{"body":"Events to sample are specified with the -e option, either pass a comma separated list or pass -e multiple times. Events are specified in the following form name[:modifier]. The list and description of the modifier can be found in the perf-list(1) manpage under EVENT MODIFIERS. # L1 i$ misses in user space\n# L2 i$ stats in user/kernel space mixed\n# Sample specified events.\nperf stat -e L1-icache-load-misses:u \\ -e l2_rqsts.all_code_rd:uk,l2_rqsts.code_rd_hit:k,l2_rqsts.code_rd_miss:k \\ -- stress -c 2 The --all-user and --all-kernel options append a :u and :k modifier to all specified events. Therefore the following two command lines are equivalent. # 1)\nperf stat -e cycles:u,instructions:u -- ls # 2)\nperf stat --all-user -e cycles,instructions -- ls","breadcrumbs":"Trace and Profile » perf » Select specific events","id":"219","title":"Select specific events"},"22":{"body":"# default value\nbar=${foo:-some_val} # if $foo set, then bar=$foo else bar=some_val # alternate value\nbar=${foo:+bla $foo} # if $foo set, then bar=\"bla $foo\" else bar=\"\" # check param set\nbar=${foo:?msg} # if $foo set, then bar=$foo else exit and print msg # indirect\nFOO=foo\nBAR=FOO\nbar=${!BAR} # deref value of BAR -> bar=$FOO # prefix\n${foo#prefix} # remove prefix when expanding $foo\n# suffix\n${foo%suffix} # remove suffix when expanding $foo # substitute\n${foo/pattern/string} # replace pattern with string when expanding foo\n# pattern starts with\n# '/' replace all occurences of pattern\n# '#' pattern match at beginning\n# '%' pattern match at end # set programmatically with priintf builtin\nprintf -v \"VAR1\" \"abc\"\nNAME=VAR2\nprintf -v \"$NAME\" \"%s\" \"def\" Note: prefix/suffix/pattern are expanded as pathnames .","breadcrumbs":"Shells » bash » Parameter","id":"22","title":"Parameter"},"220":{"body":"In case perf does not provide a symbolic name for an event, the event can be specified in a raw form as r + UMask + EventCode. The following is an example for the L2_RQSTS.CODE_RD_HIT event with EventCode=0x24 and UMask=0x10 on my laptop with a sandybridge uarch. perf stat -e l2_rqsts.code_rd_hit -e r1024 -- ls\n# Performance counter stats for 'ls':\n#\n# 33.942 l2_rqsts.code_rd_hit\n# 33.942 r1024","breadcrumbs":"Trace and Profile » perf » Raw events","id":"220","title":"Raw events"},"221":{"body":"The intel/perfmon repository provides a performance event databases for the different intel uarchs. The table in mapfile.csv can be used to lookup the corresponding uarch, just grab the family model from the procfs. cat /proc/cpuinfo | awk '/^vendor_id/ { V=$3 } /^cpu family/ { F=$4 } /^model\\s*:/ { printf \"%s-%d-%x\\n\",V,F,$3 }' The table in performance monitoring events describes how events are sorted into the different files.","breadcrumbs":"Trace and Profile » perf » Find raw performance counter events (intel)","id":"221","title":"Find raw performance counter events (intel)"},"222":{"body":"Perf also defines some own symbolic names for events. An example is the cache-references event. The perf_event_open(2) manpage gives the following description. perf_event_open(2) PERF_COUNT_HW_CACHE_REFERENCES Cache accesses. Usually this indicates Last Level Cache accesses but this may vary depending on your CPU. This may include prefetches and coherency messages; again this depends on the design of your CPU. The sysfs can be consulted to get the concrete performance counter on the given system. cat /sys/devices/cpu/events/cache-misses\n# event=0x2e,umask=0x41","breadcrumbs":"Trace and Profile » perf » Raw events for perfs own symbolic names","id":"222","title":"Raw events for perfs own symbolic names"},"223":{"body":"","breadcrumbs":"Trace and Profile » perf » Flamegraph","id":"223","title":"Flamegraph"},"224":{"body":"perf record -g -e cpu-cycles -p \nperf script | FlameGraph/stackcollapse-perf.pl | FlameGraph/flamegraph.pl > cycles-flamegraph.svg","breadcrumbs":"Trace and Profile » perf » Flamegraph with single event trace","id":"224","title":"Flamegraph with single event trace"},"225":{"body":"perf record -g -e cpu-cycles,page-faults -p \nperf script --per-event-dump\n# fold & generate as above","breadcrumbs":"Trace and Profile » perf » Flamegraph with multiple event traces","id":"225","title":"Flamegraph with multiple event traces"},"226":{"body":"","breadcrumbs":"Trace and Profile » perf » Examples","id":"226","title":"Examples"},"227":{"body":"#define NOP4 \"nop\\nnop\\nnop\\nnop\\n\"\n#define NOP32 NOP4 NOP4 NOP4 NOP4 NOP4 NOP4 NOP4 NOP4\n#define NOP256 NOP32 NOP32 NOP32 NOP32 NOP32 NOP32 NOP32 NOP32\n#define NOP2048 NOP256 NOP256 NOP256 NOP256 NOP256 NOP256 NOP256 NOP256 int main() { for (unsigned i = 0; i < 2000000; ++i) { asm volatile(NOP2048); }\n} perf stat -e cycles,instructions ./noploop\n# Performance counter stats for './noploop':\n#\n# 1.031.075.940 cycles\n# 4.103.534.341 instructions # 3,98 insn per cycle","breadcrumbs":"Trace and Profile » perf » Estimate max instructions per cycle","id":"227","title":"Estimate max instructions per cycle"},"228":{"body":"The following gives an example for a scenario where we have the following calls main -> do_foo() -> do_work() main -> do_bar() -> do_work() perf report --stdio -g graph,caller # Children Self Command Shared Object Symbols\n# ........ ........ ....... .................... .................\n#\n# 49.71% 49.66% bench bench [.] do_work\n# |\n# --49.66%--_start <- callstack bottom\n# __libc_start_main\n# 0x7ff366c62ccf\n# main\n# |\n# |--25.13%--do_bar\n# | do_work <- callstack top\n# |\n# --24.53%--do_foo\n# do_work perf report --stdio -g graph,callee # Children Self Command Shared Object Symbols\n# ........ ........ ....... .................... .................\n#\n# 49.71% 49.66% bench bench [.] do_work\n# |\n# ---do_work <- callstack top\n# |\n# |--25.15%--do_bar\n# | main\n# | 0x7ff366c62ccf\n# | __libc_start_main\n# | _start <- callstack bottom\n# |\n# --24.55%--do_foo\n# main\n# 0x7ff366c62ccf\n# __libc_start_main\n# _start <- callstack bottom","breadcrumbs":"Trace and Profile » perf » Caller vs callee callstacks","id":"228","title":"Caller vs callee callstacks"},"229":{"body":"intel/perfmon - intel PMU event database per uarch intel/perfmon-html - a html rendered version of the PMU events with search intel/perfmon/mapfile.csv - processor family to uarch mapping linux/perf/events - x86 PMU events known to perf tools linux/arch/events - x86 PMU events linux kernel wikichip - computer architecture wiki perf-list(1) - manpage perf_event_open(2) - manpage intel/sdm - intel software developer manuals (eg Optimization Reference Manual)","breadcrumbs":"Trace and Profile » perf » References","id":"229","title":"References"},"23":{"body":"* match any string\n? match any single char\n\\\\ match backslash\n[abc] match any char of 'a' 'b' 'c'\n[a-z] match any char between 'a' - 'z'\n[^ab] negate, match all not 'a' 'b'\n[:class:] match any char in class, available: alnum,alpha,ascii,blank,cntrl,digit,graph,lower, print,punct,space,upper,word,xdigit With extglob shell option enabled it is possible to have more powerful patterns. In the following pattern-list is one ore more patterns separated by | char. ?(pattern-list) matches zero or one occurrence of the given patterns\n*(pattern-list) matches zero or more occurrences of the given patterns\n+(pattern-list) matches one or more occurrences of the given patterns\n@(pattern-list) matches one of the given patterns\n!(pattern-list) matches anything except one of the given patterns Note: shopt -s extglob/shopt -u extglob to enable/disable extglob option.","breadcrumbs":"Shells » bash » Pathname","id":"23","title":"Pathname"},"230":{"body":"operf -g -p -g ...... caputre call-graph information opreport [opt] FILE show time spent per binary image -l ...... show time spent per symbol -c ...... show callgraph information (see below) -a ...... add column with time spent accumulated over child nodes ophelp show supported hw/sw events","breadcrumbs":"Trace and Profile » OProfile » OProfile","id":"230","title":"OProfile"},"231":{"body":"Callgrind is a tracing profiler to record the function call history of a target program. It is part of the valgrind tool suite. Profiling data is collected by instrumentation rather than sampling of the target program. Callgrind does not capture the actual time spent in a function but computes the cost of a function based on the instructions fetched (Ir = Instruction read). Therefore effects like slow IO are not reflected, which should be kept in mind when analyzing callgrind results. By default the profiler data is dumped when the target process is terminating, but callgrind_control allows for interactive control of callgrind. # Run a program under callgrind.\nvalgrind --tool=callgrind -- # Interactive control of callgrind.\ncallgrind_control [opts] opts: -b ............. show current backtrace -e ............. show current event counters -s ............. show current stats --dump[=file] .. dump current collection -i=on|off ...... turn instrumentation on|off Results can be analyzed by using one of the following tools callgrind_annotate (cli) kcachegrind (ui) The following is a collection of frequently used callgrind options. valgrind --tool=callgrind [opts] -- opts: --callgrind-out-file= .... output file, rather than callgrind.out. --dump-instr= .......... annotation on instrucion level, allows for asm annotations --instr-atstart= ....... control if instrumentation is enabled from beginning of the program --separate-threads= .... create separate output files per thread, appends - to the output file","breadcrumbs":"Trace and Profile » callgrind » callgrind","id":"231","title":"callgrind"},"232":{"body":"Programmatically enable/disable instrumentation using the macros defined in the callgrind header. #include int main() { // init .. CALLGRIND_START_INSTRUMENTATION; compute(); CALLGRIND_STOP_INSTRUMENTATION; // shutdown ..\n} In this case, callgrind should be launched with --instr-atstart=no. Alternatively instrumentation can be controlled with callgrind_control -i on/off. The files cg_example.cc and Makefile provide a full example.","breadcrumbs":"Trace and Profile » callgrind » Profile specific part of the target","id":"232","title":"Profile specific part of the target"},"233":{"body":"","breadcrumbs":"Trace and Profile » valgrind » valgrind(1)","id":"233","title":"valgrind(1)"},"234":{"body":"Is the default tool when invoking valgrind without explicitly specifying --tool. Memory checker used to identify: memory leaks out of bound accesses uninitialized reads valgrind [OPTIONS] PROGRAM [ARGS] --log-file=FILE Write valgrind output to FILE. --leak-check=full Enable full leak check. --track-origins=yes Show origins of undefined values. --keep-debuginfo=no|yes Keep symbols etc for unloaded code. --gen-suppressions=yes Generate suppressions file from the run. --suppressions=FILE Load suppressions file.","breadcrumbs":"Trace and Profile » valgrind » Memcheck --tool=memcheck","id":"234","title":"Memcheck --tool=memcheck"},"235":{"body":"gdb gdbserver","breadcrumbs":"Debug » Debug","id":"235","title":"Debug"},"236":{"body":"","breadcrumbs":"Debug » gdb » gdb(1)","id":"236","title":"gdb(1)"},"237":{"body":"gdb [opts] [prg [-c coredump | -p pid]] gdb [opts] --args prg opts: -p attach to pid -c use -x execute script before prompt -ex execute command before prompt --tty set I/O tty for debugee --batch run in batch mode, exit after processing options (eg used for scripting) --batch-silent link --batch, but surpress gdb stdout","breadcrumbs":"Debug » gdb » CLI","id":"237","title":"CLI"},"238":{"body":"","breadcrumbs":"Debug » gdb » Interactive usage","id":"238","title":"Interactive usage"},"239":{"body":"apropos Search commands matching regex. tty Set as tty for debugee. Make sure nobody reads from target tty, easiest is to spawn a shell and run following in target tty: > while true; do sleep 1024; done sharedlibrary [] Load symbols of shared libs loaded by debugee. Optionally use to filter libs for symbol loading. display [/FMT] Print every time debugee stops. Eg print next instr, see examples below. undisplay [] Delete display expressions either all or one referenced by . info display List display expressions. info sharedlibrary [] List shared libraries loaded. Optionally use to filter.","breadcrumbs":"Debug » gdb » Misc","id":"239","title":"Misc"},"24":{"body":"Note: The trick with bash I/O redirection is to interpret from left-to-right. # stdout & stderr to file\ncommand >file 2>&1\n# equivalent\ncommand &>file # stderr to stdout & stdout to file\ncommand 2>&1 >file The article Bash One-Liners Explained, Part III: All about redirections contains some nice visualization to explain bash redirections.","breadcrumbs":"Shells » bash » I/O redirection","id":"24","title":"I/O redirection"},"240":{"body":"break [-qualified] thread Set a breakpoint only for a specific thread. -qualified: Treat as fully qualified symbol (quiet handy to set breakpoints on C symbols in C++ contexts) break if Set conditional breakpoint (see examples below). delete [] Delete breakpoint either all or one referenced by . info break List breakpoints. cond Make existing breakpoint conditional with . cond Remove condition from breakpoint . tbreak Set temporary breakpoint, will be deleted when hit. Same syntax as `break`. rbreak Set breakpoints matching , where matching internally is done on: .*.* command [] Define commands to run after breakpoint hit. If is not specified attach command to last created breakpoint. Command block terminated with 'end' token. : Space separates list, eg 'command 2 5-8' to run command for breakpoints: 2,5,6,7,8. save break Save breakpoints to . Can be loaded with the `source` command.","breadcrumbs":"Debug » gdb » Breakpoints","id":"240","title":"Breakpoints"},"241":{"body":"watch [-location|-l] [thread ] Create a watchpoint for , will break if is written to. Watchpoints respect scope of variables, -l can be used to watch the memory location instead. rwatch ... Sets a read watchpoint, will break if is read from. awatch ... Sets an access watchpoint, will break if is written to or read from.","breadcrumbs":"Debug » gdb » Watchpoints","id":"241","title":"Watchpoints"},"242":{"body":"catch load [] Stop when shared libraries are loaded, optionally specify a to stop only on matches. catch unload [] Stop when shared libraries are unloaded, optionally specify a to stop only on matches. catch throw Stop when an exception is thrown. catch rethrow Stop when an exception is rethrown. catch catch Stop when an exception is caught. catch fork Stop at calls to fork (also stops at clones, as some systems implement fork via clone). catch syscall [ ..] Stop at syscall. If no argument is given, stop at all syscalls. Optionally give a list of syscalls to stop at.","breadcrumbs":"Debug » gdb » Catchpoints","id":"242","title":"Catchpoints"},"243":{"body":"info functions [] List functions matching . List all functions if no provided. info variables [