Skip to content

Commit 0337086

Browse files
committed
cleanup
1 parent f320914 commit 0337086

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

.gdbinit

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1 @@
1-
layout src
2-
python
3-
import gdb.printing
4-
5-
class RustCommandPrinter:
6-
def __init__(self, val):
7-
self.val = val
8-
9-
def to_string(self):
10-
cmd_str = self.val['program']['0']['0'].string()
11-
args = self.val['args']['0']
12-
args_len = args['1']['len']
13-
args_data = args['0']['ptr'].dereference().cast(gdb.lookup_type("const char").pointer())
14-
args_list = [str(args_data[i].string()) for i in range(args_len)]
15-
return 'Command {{ program: "{}", args: {} }}'.format(cmd_str, args_list)
16-
17-
def build_pretty_printer():
18-
pp = gdb.printing.RegexpCollectionPrettyPrinter("rust_printers")
19-
pp.add_printer('Command', '^std::process::Command$', RustCommandPrinter)
20-
return pp
21-
22-
gdb.printing.register_pretty_printer(None, build_pretty_printer())
23-
end
1+
layout src

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Cargo.lock
1313
# MSVC Windows builds of rustc generate these, which store debugging information
1414
*.pdb
1515

16+
# Jetbrains
17+
.idea/
1618

17-
#krita backups
19+
# Krita backups
1820
*.*~

.idea/workspace.xml

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)