Emacs gdbコマンドに引数(つまり、バイナリ名)を渡す方法は?

StackOverflow https://stackoverflow.com/questions/619979

  •  03-07-2019
  •  | 
  •  

質問

今、私はemacsでgdbを開始するようにF5を設定しています:

(global-set-key [f5] 'gdb)

これはミニバッファーに切り替わり、実行可能ファイルへのパスを入力します...このパスの入力をバイパスする方法を見つけたい...

Makefileを参照して解析し、実行可能ファイルの完全なパスを計算して標準出力に出力する実行可能ファイルを作成しました...これを.emacsから呼び出すことは可能ですか? gdbコマンドへの出力ですか?

役に立ちましたか?

解決

(defun gdb-getpath ()
  "Figures out the path to executable and launches gdb."
  (interactive)
  (let ((path (shell-command-to-string "/path/to/your/executable")))
    (gdb (concat "gdb " path))
    ))

(global-set-key [f5] 'gdb-getpath)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top