Update cheatsheets

This commit is contained in:
ivuorinen
2025-01-01 00:19:31 +00:00
parent 489c6fbf29
commit 7d5c24cb3d
4 changed files with 75 additions and 12 deletions

21
tldr/caller Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# caller
> Print function context.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-caller>.
- Print the line and filename where the current function was called:
`caller`
- Print the line, function and filename where the current function was called:
`caller 0`
- Print the line, the function name and the filename of a function call `n` frames back:
`caller {{n}}`

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- List all captured core dumps:
`coredumpctl list`
`coredumpctl`
- List captured core dumps for a program:
@@ -20,6 +20,10 @@ source: https://github.com/tldr-pages/tldr.git
`coredumpctl info {{PID}}`
- Invoke debugger using the last core dump:
`coredumpctl debug`
- Invoke debugger using the last core dump of a program:
`coredumpctl debug {{program}}`

30
tldr/llvm-mc Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# llvm-mc
> LLVM Machine Code Playground. It provides a set of tools for working with LLVM machine code.
> Part of LLVM.
> More information: <https://llvm.org/docs/CommandGuide/llvm-mc.html>.
- Assemble assembly code file into object file with machine code:
`llvm-mc --filetype=obj -o {{path/to/output.o}} {{path/to/input.s}}`
- Disassemble object file with machine code into assembly code file:
`llvm-mc --disassemble -o {{path/to/output.s}} {{path/to/input.o}}`
- Compile LLVM bit code file into assembly code:
`llvm-mc -o {{path/to/output.s}} {{path/to/input.bc}}`
- Assemble assembly code from standard input stream and show encoding to standard output stream:
`echo "{{addl %eax, %ebx}}" | llvm-mc -show-encoding -show-inst`
- Disassemble machine code from standard input stream for specified triple:
`echo "{{0xCD 0x21}}" | llvm-mc --disassemble -triple={{target_name}}`

View File

@@ -8,22 +8,30 @@ source: https://github.com/tldr-pages/tldr.git
> A time tracking tool used to measure the duration of activities.
> More information: <https://timewarrior.net/docs>.
- Start a new stopwatch, giving a tag name to the activity being tracked:
- Start tracking an activity:
`timew start`
- Tag the current activity:
`timew tag {{activity_tag}}`
- Start tracking and tag a new activity:
`timew start {{activity_tag}}`
- View running stopwatches:
`timew`
- Stop the stopwatch with a given tag name:
`timew stop {{activity_tag}}`
- Stop all running stopwatches:
- Stop the current activity:
`timew stop`
- View tracked items:
- Track an activity in the past:
`timew track {{start_time} - {{end_time}} {{activity_tag}}`
- View tracked items of the day:
`timew summary`
- View report for the last day, week, current month, etc.:
`timew summary :{{today|yesterday|week|lastweek|month|lastmonth|year|lastyear}}`