From 78b3836acf005c33ec4cdcb453f518b6e099c346 Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 10 Mar 2022 22:22:00 +0000 Subject: deploy: a7d5161041378ae600affa8955e0c67a7cb1ba65 --- print.html | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'print.html') diff --git a/print.html b/print.html index 5166ae9..9ce4124 100644 --- a/print.html +++ b/print.html @@ -83,7 +83,7 @@ @@ -168,6 +168,7 @@
  • emacs
  • gpg
  • gdb
  • +
  • gdbserver
  • radare2
  • qemu
  • pacman
  • @@ -296,6 +297,16 @@ echo $bar[2] # 2 echo ${(L)foo} # aabb echo ${(U)foo} # AABB +

    Key/values in associative arrays:

    +
    typeset -A vec; vec[a]='aa'; vec[b]='bb'
    +
    +echo ${(k)vec}        # a b
    +echo ${(v)vec}        # aa bb
    +echo ${(kv)vec}       # a aa b bb
    +
    +# Iterate over key value pairs.
    +for k v in ${(kv)vec)}; do ...; done
    +

    Argument parsing with zparseopts

    zparseopts [-D] [-E] [-A assoc] specs
     
    @@ -1658,6 +1669,24 @@ executed. To workaround that bug one can create a wrapper function which calls handler end +

    gdbserver(1)

    +

    CLI

    +
      gdbserver [opts] comm prog [args]
    +    opts:
    +      --disable-randomization
    +      --no-disable-randomization
    +
    +    comm:
    +      host:port
    +      tty
    +
    +

    Example

    +
    # Start gdbserver.
    +gdbserver localhost:1234 /bin/ls
    +
    +# Attach gdb.
    +gdb -ex 'target remote localhost:1234'
    +

    radare2(1)

    print

    
    @@ -1810,6 +1839,16 @@ connection.

    # mount -t 9p -o trans=virtio someName /mnt -virtfs local,id=someName,path=<someHostPath>,mount_tag=someName,security_model=none
    +

    Debug logging

    +
    # List debug items.
    +-d help
    +
    +# Write debug log to file instead stderr.
    +-D <file>
    +
    +# Examples
    +-d in_asm       Log executed guest instructions.
    +

    Tracing

    # List name of all trace points.
     -trace help
    @@ -2099,7 +2138,7 @@ major_pagefault: Happens when the page needed is NOT in memory, the kernel
       -l <filter> . show who calls into lib matched by <filter>
       -C .......... demangle
     
    -

    Example

    +

    Example

    List which program/libs call into libstdc++:

    ltrace -l '*libstdc++*' -C -o ltrace.log ./main
     
    @@ -2328,7 +2367,7 @@ LD_PRELOAD=./libmtrace.so <binary> 7 print simple error message + stack trace + memory mappings & abort

    gcc(1)

    -

    CLI

    +

    CLI

    Preprocessing

    While debugging can be helpful to just pre-process files.

    gcc -E [-dM] ...
    -- 
    cgit v1.2.3