From 3839b5e390c53b74f58003cf082030df02391f9a Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 9 Sep 2023 08:32:23 +0000 Subject: deploy: 30bc89f36a0310eb5c9c710f0544577b3688fd77 --- print.html | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'print.html') diff --git a/print.html b/print.html index c0dea2b..dbf6311 100644 --- a/print.html +++ b/print.html @@ -1904,10 +1904,16 @@ which its expression is valid. main () at test.c:10 10 set(&s, 2); +# Define the watchpoint on the location of the object to watch. + +(gdb) watch -l s->v + +# This is equivalent to the following. + (gdb) p &s->v $1 = (int *) 0x7fffffffe594 -# Define a watchpoint o the address of the member variable of the s instance. +# Define a watchpoint to the address of the member variable of the s instance. # This of course only makes sense as long as the s instance is not moved in memory. (gdb) watch *0x7fffffffe594 @@ -1948,18 +1954,24 @@ executed. To workaround that bug one can create a wrapper function which calls opts: --disable-randomization --no-disable-randomization + --wrapper W -- comm: host:port tty -

Example

+

Example

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

Wrapper example: Set environment variables just for the debugee

+

Set env as execution wrapper with some variables. +The wrapper will be executed before the debugee.

+
gdbserver --wrapper env FOO=123 BAR=321 -- :12345 /bin/ls
+

radare2(1)

print


@@ -2396,6 +2408,12 @@ digraph {
 

IPv4 TCP connections in ESTABLISHED state

lsof -i 4TCP -s TCP:ESTABLISHED
 
+

List open files in a mounted directory.

+

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.
+lsof /proc
+

ss(8)

ss [option] [filter]
 
@@ -4978,6 +4996,8 @@ zpool status active host and imported on the new host.

# Export a pool called MOOSE.
 zpool export moose
+# If datasets are busy, use lsof to check which processes keep it busy.
+#   lsof <mntpoint>
 
 # List pools that can be imported using BY-ID deivce names (for example).
 zpool import -d /dev/disk/by-id
@@ -5014,11 +5034,12 @@ zfs unmount moose/foo
 

Encrypted datasets

Encryption is a readonly property, can only be set when creating a dataset.

-
# Create encrypted dataset ENC on pool MOOSE.
+
# Create encrypted dataset FOO on pool MOOSE.
 zfs create -o encryption=on -o keyformat=passphrase moose/foo
 
-# Mount encrypte dataset (if key is not loaded).
+# Mount encrypte dataset and load encryption key (if not loaded).
 zfs mount -l moose/foo
+# -l is equivalent to first loading the key via zfs load-key moose/foo.
 
 # Unmount dataset and unload encryption key (unload is optional).
 zfs umount -u moose/foo
-- 
cgit v1.2.3