From 63d71256f83e5da6479d90d1bbdaf17ad6d31f02 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 5 Apr 2024 23:16:19 +0000 Subject: deploy: c660b71b9689af89bc09671e6a6de7f9943e2709 --- print.html | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) (limited to 'print.html') diff --git a/print.html b/print.html index 25fec70..9e5e1f6 100644 --- a/print.html +++ b/print.html @@ -541,6 +541,11 @@ ${foo/pattern/string} # replace pattern with string when expanding foo # '/' replace all occurences of pattern # '#' pattern match at beginning # '%' pattern match at end + +# set programmatically with priintf builtin +printf -v "VAR1" "abc" +NAME=VAR2 +printf -v "$NAME" "%s" "def"

Note: prefix/suffix/pattern are expanded as pathnames.

@@ -1180,6 +1185,7 @@ the same repository (shared .git folder).

  git diff <commit>..<commit> [<file>] .... show changes between two arbitrary
                                             commits. If one <commit> is omitted
                                             it is if HEAD is specified.
+  git diff --name-only <commit>..<commit> . show names of files changed
   git diff -U$(wc -l <file>) <file> ....... shows complete file with diffs
                                             instead of usual diff snippets
   git diff --staged ....................... show diffs of staged files
@@ -1770,10 +1776,14 @@ gpg> save
       --tty <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
 

Interactive usage

Misc

-
  tty <tty>
+
  apropos <regex>
+          Search commands matching regex.
+
+  tty <tty>
           Set <tty> as tty for debugee.
           Make sure nobody reads from target tty, easiest is to spawn a shell
           and run following in target tty:
@@ -1792,6 +1802,9 @@ gpg> save
 
   info display
           List display expressions.
+
+  info sharedlibrary [<regex>]
+          List shared libraries loaded. Optionally use <regex> to filter.
 

Breakpoints

  break [-qualified] <sym> thread <tnum>
@@ -1923,6 +1936,12 @@ thread name <name>
   inferior <id>
           Switch to inferior with <id>.
 
+

Scheduling

+
  set schedule-multiple <on | off>
+          on: Resume all threads of all processes (inferiors) when continuing
+              or stepping.
+          off: (default) Resume only threads of current process (inferior).
+

Shell commands

  shell <shell_cmd>
           Run the shell_cmd and print the output, can also contain a pipeline.
@@ -1968,13 +1987,19 @@ thread name <name>
   set logging file <fname>
           Change output log file to <fname>
 
-  set logging redirect <on/off>
+  set logging redirect <on | off>
           on: only log to file.
           off: log to file and tty.
 
-  set logging overwrite <on/off>
+  set logging overwrite <on | off>
           on: Truncate log file on each run.
           off: Append to logfile (default).
+
+  set history filename <fname>
+          Change file where to save and restore command history to and from.
+
+  set history <on | off>
+          Enable or disable saving of command history.
 

Logging options should be configured before logging is turned on.

@@ -4443,6 +4468,19 @@ run1:
  • C++ ABI - C++ Itanium ABI
  • cmake(1)

    +

    Frequently used variables

    +
    # Install location.
    +CMAKE_INSTALL_PREFIX=<path>
    +
    +# Generate compile_commands.json?
    +CMAKE_EXPORT_COMPILE_COMMANDS={0,1}
    +
    +# Project build type.
    +CMAKE_BUILD_TYPE={Debug, Release, RelWithDebInfo, MinSizeRel}
    +
    +# C++ standard.
    +CMAKE_CXX_STANDARD={14,17,..}
    +

    PRIVATE / PUBLIC / INTERFACE

    These modifier control where properties for a given target are visible.

      @@ -4477,6 +4515,15 @@ target_link_libraries(main liba) [3/4] /usr/bin/c++ -DDEF_INTERFACE -DDEF_PUBLIC [..] .../main.cc [4/4] [..]
    +

    find_package [ref]

    +

    A small example to play with can be found in cmake/module.

    +
    find_package(Name MODULE)
    +
    +

    Looks for FindName.cmake in paths given by CMAKE_MODULE_PATH and then builtin paths.

    +
    find_package(Name CONFIG)
    +
    +

    Looks for name-config.cmake or NameConfig.cmake in paths given by +CMAKE_PREFIX_PATH, or path given by Name_DIR and then builtin paths.

    make(1)

    Anatomy of make rules

    target .. : prerequisite ..
    -- 
    cgit v1.2.3