mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 04:11:18 +00:00
Compare commits
4 commits
21e392eb31
...
8c448d4348
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c448d4348 | ||
|
|
db66ca381a | ||
|
|
e08f2460a5 | ||
|
|
b854eb3489 |
4 changed files with 65 additions and 42 deletions
|
|
@ -75,18 +75,21 @@
|
|||
(let ((compiler-action (aml/get-map-prop ll/c-file-action-map action :compiler-action))
|
||||
(compiler (lls/prompt-tool "clang$")))
|
||||
(string-join
|
||||
(list (lls/get-clang-command-fun
|
||||
:compiler compiler
|
||||
:file file
|
||||
:action compiler-action
|
||||
:output output
|
||||
:flags
|
||||
(list
|
||||
(pcase action
|
||||
('debug (format "-mllvm -debug-only=%s" (ll/read-pass-name "Which pass? ")))
|
||||
('before-after (let ((pass (ll/read-pass-name "Which pass? ")))
|
||||
(format "-mllvm -print-before=%s -mllvm -print-after=%s" pass pass)))
|
||||
('changed "-mllvm -print-before-all"))))
|
||||
(list
|
||||
(when (y-or-n-p "Would you like to `rr record`? ")
|
||||
"rr record ")
|
||||
(lls/get-clang-command-fun
|
||||
:compiler compiler
|
||||
:file file
|
||||
:action compiler-action
|
||||
:output output
|
||||
:flags
|
||||
(list
|
||||
(pcase action
|
||||
('debug (format "-mllvm -debug-only=%s" (ll/read-pass-name "Which pass? ")))
|
||||
('before-after (let ((pass (ll/read-pass-name "Which pass? ")))
|
||||
(format "-mllvm -print-before=%s -mllvm -print-after=%s" pass pass)))
|
||||
('changed "-mllvm -print-before-all"))))
|
||||
" ")
|
||||
" "))))
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,29 @@
|
|||
;;; Code:
|
||||
(require 'org)
|
||||
|
||||
(defclass debugger-stacktrace-data ()
|
||||
((file-name :initarg :file-name :type string)
|
||||
(line-number :initarg :line-number :type number)
|
||||
(func-name :initarg :func-name :type string)
|
||||
(stack-number :initarg :stack-number :type number)))
|
||||
|
||||
(defun stacktrace-to-org-table (stacktrace)
|
||||
(save-excursion
|
||||
(beginning-of-buffer)
|
||||
(insert "|-\n|#|Function Name|Link|\n|-\n")
|
||||
(dolist (stack-entry stacktrace)
|
||||
(insert (format "|%s|%s|%s|\n"
|
||||
(slot-value stack-entry 'stack-number)
|
||||
(slot-value stack-entry 'func-name)
|
||||
(let ((fname (slot-value stack-entry 'file-name)))
|
||||
(format "[[%s:%d][%s]]"
|
||||
fname
|
||||
(slot-value stack-entry 'line-number)
|
||||
(file-name-nondirectory fname))))))
|
||||
(insert "|-")
|
||||
(org-table-align)
|
||||
(org-table-sort-lines nil ?N)))
|
||||
|
||||
(defun gdb-stacktrace-to-org-table ()
|
||||
(interactive)
|
||||
(let ((regexp (rx (and line-start
|
||||
|
|
@ -52,35 +75,20 @@
|
|||
(group
|
||||
(+ digit))
|
||||
line-end
|
||||
))))
|
||||
(beginning-of-buffer)
|
||||
)))
|
||||
stacktrace)
|
||||
(save-excursion
|
||||
(beginning-of-buffer)
|
||||
(while (re-search-forward regexp nil 'noerror)
|
||||
(replace-match
|
||||
(let ((path (match-string 3)))
|
||||
(save-match-data
|
||||
(format "|\\1|\\2|%s:\\4|[[\\3::\\4][Link]]|"
|
||||
(cond ((string-match (rx (and "/scratch/benson/_repos-work/tools"
|
||||
(* digit)
|
||||
"/llvm_cgt/llvm-project/"
|
||||
(group
|
||||
(+ nonl))))
|
||||
path)
|
||||
(format "$LLVM_PROJECT/%s" (match-string 1 path)))
|
||||
((string-match (rx (and "/scratch/benson/_repos-work/tools"
|
||||
(* digit)
|
||||
"/"
|
||||
(group
|
||||
(+ nonl))))
|
||||
path)
|
||||
(format "$SANDBOX/%s" (match-string 1 path)))
|
||||
(t path))))))))
|
||||
(org-table-sort-lines nil ?N)
|
||||
(save-excursion
|
||||
(insert "|-\n|#|Function Name|File & Line Number|Link|\n|-\n")
|
||||
(end-of-buffer)
|
||||
(insert "\n|-"))
|
||||
(org-table-align)))
|
||||
(push
|
||||
(make-instance 'debugger-stacktrace-data
|
||||
:stack-number (string-to-number (match-string 1))
|
||||
:func-name (match-string 2)
|
||||
:file-name (match-string 3)
|
||||
:line-number (string-to-number (match-string 4)))
|
||||
stacktrace))
|
||||
(erase-buffer))
|
||||
(stacktrace-to-org-table stacktrace)))
|
||||
|
||||
(defun lldb-filename-to-org-link (filename)
|
||||
(setq filename
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@
|
|||
(setf old-beg (point-min) old-end (point-max)
|
||||
narrow-p t)
|
||||
(narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end)))))))
|
||||
(let* ((org-todo-keywords-1 '("EMPTY" "ONE" "META" "META1" "TODO"))
|
||||
(let* ((org-todo-keywords-1 '("EMPTY" "ONE" "META" "META1" "TODO" "TASK"))
|
||||
(items (mapcan #'my/get-project-stuck-displayables
|
||||
(org-ql-select from
|
||||
`(and ,@(when (and tag
|
||||
(not (zerop (length tag))))
|
||||
`((tags ,tag)))
|
||||
(todo "TODO" "ONE" "META" "META1" "EMPTY" "SEQ")
|
||||
(todo "TODO" "TASK" "ONE" "META" "META1" "EMPTY" "SEQ")
|
||||
(my/top-level)
|
||||
(not (property "DELAYED"))
|
||||
(or (eq 'stuck (opr/type-of-task))
|
||||
|
|
|
|||
|
|
@ -259,9 +259,21 @@
|
|||
|
||||
(setq org-agenda-span 'day)
|
||||
|
||||
(defun days-since (date)
|
||||
(let ((target-date (date-to-time date))
|
||||
(current-date (current-time)))
|
||||
(ceiling
|
||||
(time-to-number-of-days
|
||||
(time-subtract current-date target-date)))))
|
||||
|
||||
(setq org-agenda-custom-commands
|
||||
`(("p" . "\tprod")
|
||||
,@(agenda-suite "all" "pa" "prod")))
|
||||
,@(agenda-suite "all" "pa" "prod")
|
||||
("w" "\tWindows Diary"
|
||||
((agenda ""
|
||||
((org-agenda-start-day "2025-10-29")
|
||||
(org-agenda-start-on-weekday 3)
|
||||
(org-agenda-span (days-since "2025-10-29"))))))))
|
||||
|
||||
(setq org-outline-path-complete-in-steps nil)
|
||||
(setq org-refile-use-outline-path t)
|
||||
|
|
|
|||
Loading…
Reference in a new issue