-
Notifications
You must be signed in to change notification settings - Fork 8
/
tgdbinit
53 lines (43 loc) · 1.34 KB
/
tgdbinit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
python
import subprocess as sp
import os
NULLPROG = "sh -c 'while [ 1 = 1 ]; do sleep 100; done'"
def tmux(*args):
return sp.check_output(['tmux'] + list(args)).decode('utf8')
def set_title(tty, title):
with open(tty, 'ab') as t:
t.write(b'\x1b]2;' + title.encode('utf8') + b'\x1b\\')
tmux('setw', 'remain-on-exit', 'on')
gdb_pane, gdb_tty = tmux('display-message', '-p' , '-F', '#{pane_id},#{pane_tty}').strip().split(',')
set_title(gdb_tty, 'gdb')
dashboard_pane, dashboard_tty = tmux('split-window', '-d', '-h', '-P', '-F', '#{pane_id},#{pane_tty}', NULLPROG).strip().split(',')
sp.check_call(['stty', '--file', dashboard_tty, '-echo'])
set_title(dashboard_tty, 'dashboard')
gdb.execute(f'dashboard -output {dashboard_tty}')
app_pane, app_tty = tmux('split-window', '-d', '-v', '-P', '-F', '#{pane_id},#{pane_tty}', NULLPROG).strip().split(',')
set_title(app_tty, 'inferior')
gdb.execute(f'set inferior-tty {app_tty}')
end
dashboard -layout source assembly registers stack
dashboard -enabled on
dashboard -style syntax_highlighting 'monokai'
# make sure dashboard output is updated when gdb state changes
define hookpost-up
dashboard
end
define hookpost-down
dashboard
end
define hookpost-thread
dashboard
end
define hookpost-delete
dashboard
end
define hookpost-clear
dashboard
end
define hookpost-break
dashboard
end
# vim: set ft=python: