We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
no type named uint16 in rust
### Description

So, I think I correctly installed pwndbg on my system, when I run simple rust code like this: 

```rust
use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input);
}
```

And I try to debug it using gdb with pwndbg I got this problem: 
```
Traceback (most recent call last):
  File "/usr/share/pwndbg/pwndbg/events.py", line 165, in caller
    func()
  File "/usr/share/pwndbg/pwndbg/typeinfo.py", line 51, in update
    module.ushort = lookup_types('unsigned short', 'ushort', 'u16', 'uint16')
  File "/usr/share/pwndbg/pwndbg/typeinfo.py", line 39, in lookup_types
    raise exc
  File "/usr/share/pwndbg/pwndbg/typeinfo.py", line 36, in lookup_types
    return gdb.lookup_type(type_str)
gdb.error: No type named uint16.
```

### My setup

gdb
```
Name            : gdb
Version         : 10.1-2
Description     : The GNU Debugger
Architecture    : x86_64
URL             : https://www.gnu.org/software/gdb/
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : glibc  ncurses  libncursesw.so=6-64  gcc-libs  expat  xz  mpfr  source-highlight  gdb-common=10.1  readline  libreadline.so=8-64  guile  python  libelf
Optional Deps   : None
Required By     : peda  pwndbg-git
Optional For    : rustup
Conflicts With  : None
Replaces        : None
Installed Size  : 9.72 MiB
Packager        : Anatol Pomozov <anatol.pomozov@gmail.com>
Build Date      : Wed 04 Nov 2020 08:44:41 PM CET
Install Date    : Sat 14 Nov 2020 11:15:29 PM CET
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
```
python
```
Name            : python
Version         : 3.8.6-1
Description     : Next generation of the python high-level scripting language
Architecture    : x86_64
URL             : https://www.python.org/
Licenses        : custom
Groups          : None
Provides        : python3
Depends On      : bzip2  expat  gdbm  libffi  libnsl  libxcrypt  openssl  zlib
Optional Deps   : python-setuptools [installed]
                  python-pip [installed]
                  sqlite [installed]
                  mpdecimal: for decimal
                  xz: for lzma [installed]
                  tk: for tkinter [installed]
Required By     : ...
Optional For    : ...
Conflicts With  : None
Replaces        : python3
Installed Size  : 77.85 MiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Wed 30 Sep 2020 06:00:38 AM CEST
Install Date    : Fri 09 Oct 2020 09:13:49 PM CEST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
```

pwndbg
```
Name            : pwndbg-git
Version         : 2020.07.23.879.29f962c-1
Description     : Makes debugging with GDB suck less
Architecture    : any
URL             : https://github.com/pwndbg/pwndbg
Licenses        : MIT
Groups          : None
Provides        : pwndbg
Depends On      : gdb  python-capstone  python-unicorn  python-pycparser  python-psutil  python-ptrace  python-pyelftools  python-six  python-future  python-pygments
Optional Deps   : checksec: checksec command support
                  ropper: ropper command support
                  ropgadget: ropgadget command support
                  radare2: radare2 command support
Required By     : None
Optional For    : None
Conflicts With  : pwndbg
Replaces        : None
Installed Size  : 3.89 MiB
Packager        : Unknown Packager
Build Date      : Sat 14 Nov 2020 11:51:32 PM CET
Install Date    : Mon 16 Nov 2020 11:00:32 PM CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None
```

rustup 1.22.1 (2020-07-08)
rustc 1.47.0 (18bf6b4f0 2020-10-07)

#### Small remark
I installed pwndbg using `pacman` at first, but it was not able to get correct the correct python version, so I had to install all dependencies in pip myself (I used a bits of information from `setup.sh`).
no type named uint16 in rust
### Description

So, I think I correctly installed pwndbg on my system, when I run simple rust code like this: 

```rust
use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input);
}
```

And I try to debug it using gdb with pwndbg I got this problem: 
```
Traceback (most recent call last):
  File "/usr/share/pwndbg/pwndbg/events.py", line 165, in caller
    func()
  File "/usr/share/pwndbg/pwndbg/typeinfo.py", line 51, in update
    module.ushort = lookup_types('unsigned short', 'ushort', 'u16', 'uint16')
  File "/usr/share/pwndbg/pwndbg/typeinfo.py", line 39, in lookup_types
    raise exc
  File "/usr/share/pwndbg/pwndbg/typeinfo.py", line 36, in lookup_types
    return gdb.lookup_type(type_str)
gdb.error: No type named uint16.
```

### My setup

gdb
```
Name            : gdb
Version         : 10.1-2
Description     : The GNU Debugger
Architecture    : x86_64
URL             : https://www.gnu.org/software/gdb/
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : glibc  ncurses  libncursesw.so=6-64  gcc-libs  expat  xz  mpfr  source-highlight  gdb-common=10.1  readline  libreadline.so=8-64  guile  python  libelf
Optional Deps   : None
Required By     : peda  pwndbg-git
Optional For    : rustup
Conflicts With  : None
Replaces        : None
Installed Size  : 9.72 MiB
Packager        : Anatol Pomozov <anatol.pomozov@gmail.com>
Build Date      : Wed 04 Nov 2020 08:44:41 PM CET
Install Date    : Sat 14 Nov 2020 11:15:29 PM CET
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
```
python
```
Name            : python
Version         : 3.8.6-1
Description     : Next generation of the python high-level scripting language
Architecture    : x86_64
URL             : https://www.python.org/
Licenses        : custom
Groups          : None
Provides        : python3
Depends On      : bzip2  expat  gdbm  libffi  libnsl  libxcrypt  openssl  zlib
Optional Deps   : python-setuptools [installed]
                  python-pip [installed]
                  sqlite [installed]
                  mpdecimal: for decimal
                  xz: for lzma [installed]
                  tk: for tkinter [installed]
Required By     : ...
Optional For    : ...
Conflicts With  : None
Replaces        : python3
Installed Size  : 77.85 MiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Wed 30 Sep 2020 06:00:38 AM CEST
Install Date    : Fri 09 Oct 2020 09:13:49 PM CEST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
```

pwndbg
```
Name            : pwndbg-git
Version         : 2020.07.23.879.29f962c-1
Description     : Makes debugging with GDB suck less
Architecture    : any
URL             : https://github.com/pwndbg/pwndbg
Licenses        : MIT
Groups          : None
Provides        : pwndbg
Depends On      : gdb  python-capstone  python-unicorn  python-pycparser  python-psutil  python-ptrace  python-pyelftools  python-six  python-future  python-pygments
Optional Deps   : checksec: checksec command support
                  ropper: ropper command support
                  ropgadget: ropgadget command support
                  radare2: radare2 command support
Required By     : None
Optional For    : None
Conflicts With  : pwndbg
Replaces        : None
Installed Size  : 3.89 MiB
Packager        : Unknown Packager
Build Date      : Sat 14 Nov 2020 11:51:32 PM CET
Install Date    : Mon 16 Nov 2020 11:00:32 PM CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None
```

rustup 1.22.1 (2020-07-08)
rustc 1.47.0 (18bf6b4f0 2020-10-07)

#### Small remark
I installed pwndbg using `pacman` at first, but it was not able to get correct the correct python version, so I had to install all dependencies in pip myself (I used a bits of information from `setup.sh`).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pwndbg/gdblib/typeinfo.py`
Content:
```
1 """
2 Common types, and routines for manually loading types from file
3 via GCC.
4 """
5 
6 import sys
7 
8 import gdb
9 
10 import pwndbg.lib.gcc
11 import pwndbg.lib.memoize
12 import pwndbg.lib.tempfile
13 
14 module = sys.modules[__name__]
15 ptrsize: int
16 
17 
18 def lookup_types(*types):
19     for type_str in types:
20         try:
21             return gdb.lookup_type(type_str)
22         except Exception as e:
23             exc = e
24     raise exc
25 
26 
27 def update():
28     module.char = gdb.lookup_type("char")
29     module.ulong = lookup_types("unsigned long", "uint", "u32", "uint32")
30     module.long = lookup_types("long", "int", "i32", "int32")
31     module.uchar = lookup_types("unsigned char", "ubyte", "u8", "uint8")
32     module.ushort = lookup_types("unsigned short", "ushort", "u16", "uint16")
33     module.uint = lookup_types("unsigned int", "uint", "u32", "uint32")
34     module.void = lookup_types("void", "()")
35 
36     module.uint8 = module.uchar
37     module.uint16 = module.ushort
38     module.uint32 = module.uint
39     module.uint64 = lookup_types("unsigned long long", "ulong", "u64", "uint64")
40     module.unsigned = {
41         1: module.uint8,
42         2: module.uint16,
43         4: module.uint32,
44         8: module.uint64,
45     }
46 
47     module.int8 = lookup_types("char", "i8", "int8")
48     module.int16 = lookup_types("short", "i16", "int16")
49     module.int32 = lookup_types("int", "i32", "int32")
50     module.int64 = lookup_types("long long", "long", "i64", "int64")
51     module.signed = {1: module.int8, 2: module.int16, 4: module.int32, 8: module.int64}
52 
53     module.pvoid = void.pointer()
54     module.ppvoid = pvoid.pointer()
55     module.pchar = char.pointer()
56 
57     module.ptrsize = pvoid.sizeof
58 
59     if pvoid.sizeof == 4:
60         module.ptrdiff = module.uint32
61         module.size_t = module.uint32
62         module.ssize_t = module.int32
63     elif pvoid.sizeof == 8:
64         module.ptrdiff = module.uint64
65         module.size_t = module.uint64
66         module.ssize_t = module.int64
67     else:
68         raise Exception("Pointer size not supported")
69     module.null = gdb.Value(0).cast(void)
70 
71 
72 # TODO: Remove this global initialization, or move it somewhere else
73 # Call it once so we load all of the types
74 update()
75 
76 
77 def load(name):
78     """Load a GDB symbol; note that new symbols can be added with `add-symbol-file` functionality"""
79     try:
80         return gdb.lookup_type(name)
81     except gdb.error:
82         return None
83 
84 
85 def read_gdbvalue(type_name, addr):
86     """Read the memory contents at addr and interpret them as a GDB value with the given type"""
87     gdb_type = pwndbg.gdblib.typeinfo.load(type_name)
88     return gdb.Value(addr).cast(gdb_type.pointer()).dereference()
89 
90 
91 def get_type(size):
92     return {
93         1: pwndbg.gdblib.typeinfo.uint8,
94         2: pwndbg.gdblib.typeinfo.uint16,
95         4: pwndbg.gdblib.typeinfo.uint32,
96         8: pwndbg.gdblib.typeinfo.uint64,
97     }[size]
98
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pwndbg/gdblib/typeinfo.py b/pwndbg/gdblib/typeinfo.py
--- a/pwndbg/gdblib/typeinfo.py
+++ b/pwndbg/gdblib/typeinfo.py
@@ -25,11 +25,22 @@
 
 
 def update():
+    # Workaround for Rust stuff, see https://github.com/pwndbg/pwndbg/issues/855
+    lang = gdb.execute("show language", to_string=True)
+    if "rust" not in lang:
+        restore_lang = None
+    else:
+        gdb.execute("set language c")
+        if '"auto;' in lang:
+            restore_lang = "auto"
+        else:
+            restore_lang = "rust"
+
     module.char = gdb.lookup_type("char")
     module.ulong = lookup_types("unsigned long", "uint", "u32", "uint32")
     module.long = lookup_types("long", "int", "i32", "int32")
     module.uchar = lookup_types("unsigned char", "ubyte", "u8", "uint8")
-    module.ushort = lookup_types("unsigned short", "ushort", "u16", "uint16")
+    module.ushort = lookup_types("unsigned short", "ushort", "u16", "uint16", "uint16_t")
     module.uint = lookup_types("unsigned int", "uint", "u32", "uint32")
     module.void = lookup_types("void", "()")
 
@@ -45,9 +56,9 @@
     }
 
     module.int8 = lookup_types("char", "i8", "int8")
-    module.int16 = lookup_types("short", "i16", "int16")
+    module.int16 = lookup_types("short", "short int", "i16", "int16")
     module.int32 = lookup_types("int", "i32", "int32")
-    module.int64 = lookup_types("long long", "long", "i64", "int64")
+    module.int64 = lookup_types("long long", "long long int", "long", "i64", "int64")
     module.signed = {1: module.int8, 2: module.int16, 4: module.int32, 8: module.int64}
 
     module.pvoid = void.pointer()
@@ -68,6 +79,10 @@
         raise Exception("Pointer size not supported")
     module.null = gdb.Value(0).cast(void)
 
+    # Rust workaround part 2
+    if restore_lang:
+        gdb.execute("set language %s" % restore_lang)
+
 
 # TODO: Remove this global initialization, or move it somewhere else
 # Call it once so we load all of the types

{"golden_diff": "diff --git a/pwndbg/gdblib/typeinfo.py b/pwndbg/gdblib/typeinfo.py\n--- a/pwndbg/gdblib/typeinfo.py\n+++ b/pwndbg/gdblib/typeinfo.py\n@@ -25,11 +25,22 @@\n \n \n def update():\n+    # Workaround for Rust stuff, see https://github.com/pwndbg/pwndbg/issues/855\n+    lang = gdb.execute(\"show language\", to_string=True)\n+    if \"rust\" not in lang:\n+        restore_lang = None\n+    else:\n+        gdb.execute(\"set language c\")\n+        if '\"auto;' in lang:\n+            restore_lang = \"auto\"\n+        else:\n+            restore_lang = \"rust\"\n+\n     module.char = gdb.lookup_type(\"char\")\n     module.ulong = lookup_types(\"unsigned long\", \"uint\", \"u32\", \"uint32\")\n     module.long = lookup_types(\"long\", \"int\", \"i32\", \"int32\")\n     module.uchar = lookup_types(\"unsigned char\", \"ubyte\", \"u8\", \"uint8\")\n-    module.ushort = lookup_types(\"unsigned short\", \"ushort\", \"u16\", \"uint16\")\n+    module.ushort = lookup_types(\"unsigned short\", \"ushort\", \"u16\", \"uint16\", \"uint16_t\")\n     module.uint = lookup_types(\"unsigned int\", \"uint\", \"u32\", \"uint32\")\n     module.void = lookup_types(\"void\", \"()\")\n \n@@ -45,9 +56,9 @@\n     }\n \n     module.int8 = lookup_types(\"char\", \"i8\", \"int8\")\n-    module.int16 = lookup_types(\"short\", \"i16\", \"int16\")\n+    module.int16 = lookup_types(\"short\", \"short int\", \"i16\", \"int16\")\n     module.int32 = lookup_types(\"int\", \"i32\", \"int32\")\n-    module.int64 = lookup_types(\"long long\", \"long\", \"i64\", \"int64\")\n+    module.int64 = lookup_types(\"long long\", \"long long int\", \"long\", \"i64\", \"int64\")\n     module.signed = {1: module.int8, 2: module.int16, 4: module.int32, 8: module.int64}\n \n     module.pvoid = void.pointer()\n@@ -68,6 +79,10 @@\n         raise Exception(\"Pointer size not supported\")\n     module.null = gdb.Value(0).cast(void)\n \n+    # Rust workaround part 2\n+    if restore_lang:\n+        gdb.execute(\"set language %s\" % restore_lang)\n+\n \n # TODO: Remove this global initialization, or move it somewhere else\n # Call it once so we load all of the types\n", "issue": "no type named uint16 in rust\n### Description\r\n\r\nSo, I think I correctly installed pwndbg on my system, when I run simple rust code like this: \r\n\r\n```rust\r\nuse std::io;\r\n\r\nfn main() {\r\n    let mut input = String::new();\r\n    io::stdin().read_line(&mut input);\r\n}\r\n```\r\n\r\nAnd I try to debug it using gdb with pwndbg I got this problem: \r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/share/pwndbg/pwndbg/events.py\", line 165, in caller\r\n    func()\r\n  File \"/usr/share/pwndbg/pwndbg/typeinfo.py\", line 51, in update\r\n    module.ushort = lookup_types('unsigned short', 'ushort', 'u16', 'uint16')\r\n  File \"/usr/share/pwndbg/pwndbg/typeinfo.py\", line 39, in lookup_types\r\n    raise exc\r\n  File \"/usr/share/pwndbg/pwndbg/typeinfo.py\", line 36, in lookup_types\r\n    return gdb.lookup_type(type_str)\r\ngdb.error: No type named uint16.\r\n```\r\n\r\n### My setup\r\n\r\ngdb\r\n```\r\nName            : gdb\r\nVersion         : 10.1-2\r\nDescription     : The GNU Debugger\r\nArchitecture    : x86_64\r\nURL             : https://www.gnu.org/software/gdb/\r\nLicenses        : GPL3\r\nGroups          : None\r\nProvides        : None\r\nDepends On      : glibc  ncurses  libncursesw.so=6-64  gcc-libs  expat  xz  mpfr  source-highlight  gdb-common=10.1  readline  libreadline.so=8-64  guile  python  libelf\r\nOptional Deps   : None\r\nRequired By     : peda  pwndbg-git\r\nOptional For    : rustup\r\nConflicts With  : None\r\nReplaces        : None\r\nInstalled Size  : 9.72 MiB\r\nPackager        : Anatol Pomozov <anatol.pomozov@gmail.com>\r\nBuild Date      : Wed 04 Nov 2020 08:44:41 PM CET\r\nInstall Date    : Sat 14 Nov 2020 11:15:29 PM CET\r\nInstall Reason  : Installed as a dependency for another package\r\nInstall Script  : No\r\nValidated By    : Signature\r\n```\r\npython\r\n```\r\nName            : python\r\nVersion         : 3.8.6-1\r\nDescription     : Next generation of the python high-level scripting language\r\nArchitecture    : x86_64\r\nURL             : https://www.python.org/\r\nLicenses        : custom\r\nGroups          : None\r\nProvides        : python3\r\nDepends On      : bzip2  expat  gdbm  libffi  libnsl  libxcrypt  openssl  zlib\r\nOptional Deps   : python-setuptools [installed]\r\n                  python-pip [installed]\r\n                  sqlite [installed]\r\n                  mpdecimal: for decimal\r\n                  xz: for lzma [installed]\r\n                  tk: for tkinter [installed]\r\nRequired By     : ...\r\nOptional For    : ...\r\nConflicts With  : None\r\nReplaces        : python3\r\nInstalled Size  : 77.85 MiB\r\nPackager        : Felix Yan <felixonmars@archlinux.org>\r\nBuild Date      : Wed 30 Sep 2020 06:00:38 AM CEST\r\nInstall Date    : Fri 09 Oct 2020 09:13:49 PM CEST\r\nInstall Reason  : Installed as a dependency for another package\r\nInstall Script  : No\r\nValidated By    : Signature\r\n```\r\n\r\npwndbg\r\n```\r\nName            : pwndbg-git\r\nVersion         : 2020.07.23.879.29f962c-1\r\nDescription     : Makes debugging with GDB suck less\r\nArchitecture    : any\r\nURL             : https://github.com/pwndbg/pwndbg\r\nLicenses        : MIT\r\nGroups          : None\r\nProvides        : pwndbg\r\nDepends On      : gdb  python-capstone  python-unicorn  python-pycparser  python-psutil  python-ptrace  python-pyelftools  python-six  python-future  python-pygments\r\nOptional Deps   : checksec: checksec command support\r\n                  ropper: ropper command support\r\n                  ropgadget: ropgadget command support\r\n                  radare2: radare2 command support\r\nRequired By     : None\r\nOptional For    : None\r\nConflicts With  : pwndbg\r\nReplaces        : None\r\nInstalled Size  : 3.89 MiB\r\nPackager        : Unknown Packager\r\nBuild Date      : Sat 14 Nov 2020 11:51:32 PM CET\r\nInstall Date    : Mon 16 Nov 2020 11:00:32 PM CET\r\nInstall Reason  : Explicitly installed\r\nInstall Script  : No\r\nValidated By    : None\r\n```\r\n\r\nrustup 1.22.1 (2020-07-08)\r\nrustc 1.47.0 (18bf6b4f0 2020-10-07)\r\n\r\n#### Small remark\r\nI installed pwndbg using `pacman` at first, but it was not able to get correct the correct python version, so I had to install all dependencies in pip myself (I used a bits of information from `setup.sh`).\nno type named uint16 in rust\n### Description\r\n\r\nSo, I think I correctly installed pwndbg on my system, when I run simple rust code like this: \r\n\r\n```rust\r\nuse std::io;\r\n\r\nfn main() {\r\n    let mut input = String::new();\r\n    io::stdin().read_line(&mut input);\r\n}\r\n```\r\n\r\nAnd I try to debug it using gdb with pwndbg I got this problem: \r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/share/pwndbg/pwndbg/events.py\", line 165, in caller\r\n    func()\r\n  File \"/usr/share/pwndbg/pwndbg/typeinfo.py\", line 51, in update\r\n    module.ushort = lookup_types('unsigned short', 'ushort', 'u16', 'uint16')\r\n  File \"/usr/share/pwndbg/pwndbg/typeinfo.py\", line 39, in lookup_types\r\n    raise exc\r\n  File \"/usr/share/pwndbg/pwndbg/typeinfo.py\", line 36, in lookup_types\r\n    return gdb.lookup_type(type_str)\r\ngdb.error: No type named uint16.\r\n```\r\n\r\n### My setup\r\n\r\ngdb\r\n```\r\nName            : gdb\r\nVersion         : 10.1-2\r\nDescription     : The GNU Debugger\r\nArchitecture    : x86_64\r\nURL             : https://www.gnu.org/software/gdb/\r\nLicenses        : GPL3\r\nGroups          : None\r\nProvides        : None\r\nDepends On      : glibc  ncurses  libncursesw.so=6-64  gcc-libs  expat  xz  mpfr  source-highlight  gdb-common=10.1  readline  libreadline.so=8-64  guile  python  libelf\r\nOptional Deps   : None\r\nRequired By     : peda  pwndbg-git\r\nOptional For    : rustup\r\nConflicts With  : None\r\nReplaces        : None\r\nInstalled Size  : 9.72 MiB\r\nPackager        : Anatol Pomozov <anatol.pomozov@gmail.com>\r\nBuild Date      : Wed 04 Nov 2020 08:44:41 PM CET\r\nInstall Date    : Sat 14 Nov 2020 11:15:29 PM CET\r\nInstall Reason  : Installed as a dependency for another package\r\nInstall Script  : No\r\nValidated By    : Signature\r\n```\r\npython\r\n```\r\nName            : python\r\nVersion         : 3.8.6-1\r\nDescription     : Next generation of the python high-level scripting language\r\nArchitecture    : x86_64\r\nURL             : https://www.python.org/\r\nLicenses        : custom\r\nGroups          : None\r\nProvides        : python3\r\nDepends On      : bzip2  expat  gdbm  libffi  libnsl  libxcrypt  openssl  zlib\r\nOptional Deps   : python-setuptools [installed]\r\n                  python-pip [installed]\r\n                  sqlite [installed]\r\n                  mpdecimal: for decimal\r\n                  xz: for lzma [installed]\r\n                  tk: for tkinter [installed]\r\nRequired By     : ...\r\nOptional For    : ...\r\nConflicts With  : None\r\nReplaces        : python3\r\nInstalled Size  : 77.85 MiB\r\nPackager        : Felix Yan <felixonmars@archlinux.org>\r\nBuild Date      : Wed 30 Sep 2020 06:00:38 AM CEST\r\nInstall Date    : Fri 09 Oct 2020 09:13:49 PM CEST\r\nInstall Reason  : Installed as a dependency for another package\r\nInstall Script  : No\r\nValidated By    : Signature\r\n```\r\n\r\npwndbg\r\n```\r\nName            : pwndbg-git\r\nVersion         : 2020.07.23.879.29f962c-1\r\nDescription     : Makes debugging with GDB suck less\r\nArchitecture    : any\r\nURL             : https://github.com/pwndbg/pwndbg\r\nLicenses        : MIT\r\nGroups          : None\r\nProvides        : pwndbg\r\nDepends On      : gdb  python-capstone  python-unicorn  python-pycparser  python-psutil  python-ptrace  python-pyelftools  python-six  python-future  python-pygments\r\nOptional Deps   : checksec: checksec command support\r\n                  ropper: ropper command support\r\n                  ropgadget: ropgadget command support\r\n                  radare2: radare2 command support\r\nRequired By     : None\r\nOptional For    : None\r\nConflicts With  : pwndbg\r\nReplaces        : None\r\nInstalled Size  : 3.89 MiB\r\nPackager        : Unknown Packager\r\nBuild Date      : Sat 14 Nov 2020 11:51:32 PM CET\r\nInstall Date    : Mon 16 Nov 2020 11:00:32 PM CET\r\nInstall Reason  : Explicitly installed\r\nInstall Script  : No\r\nValidated By    : None\r\n```\r\n\r\nrustup 1.22.1 (2020-07-08)\r\nrustc 1.47.0 (18bf6b4f0 2020-10-07)\r\n\r\n#### Small remark\r\nI installed pwndbg using `pacman` at first, but it was not able to get correct the correct python version, so I had to install all dependencies in pip myself (I used a bits of information from `setup.sh`).\n", "before_files": [{"content": "\"\"\"\nCommon types, and routines for manually loading types from file\nvia GCC.\n\"\"\"\n\nimport sys\n\nimport gdb\n\nimport pwndbg.lib.gcc\nimport pwndbg.lib.memoize\nimport pwndbg.lib.tempfile\n\nmodule = sys.modules[__name__]\nptrsize: int\n\n\ndef lookup_types(*types):\n    for type_str in types:\n        try:\n            return gdb.lookup_type(type_str)\n        except Exception as e:\n            exc = e\n    raise exc\n\n\ndef update():\n    module.char = gdb.lookup_type(\"char\")\n    module.ulong = lookup_types(\"unsigned long\", \"uint\", \"u32\", \"uint32\")\n    module.long = lookup_types(\"long\", \"int\", \"i32\", \"int32\")\n    module.uchar = lookup_types(\"unsigned char\", \"ubyte\", \"u8\", \"uint8\")\n    module.ushort = lookup_types(\"unsigned short\", \"ushort\", \"u16\", \"uint16\")\n    module.uint = lookup_types(\"unsigned int\", \"uint\", \"u32\", \"uint32\")\n    module.void = lookup_types(\"void\", \"()\")\n\n    module.uint8 = module.uchar\n    module.uint16 = module.ushort\n    module.uint32 = module.uint\n    module.uint64 = lookup_types(\"unsigned long long\", \"ulong\", \"u64\", \"uint64\")\n    module.unsigned = {\n        1: module.uint8,\n        2: module.uint16,\n        4: module.uint32,\n        8: module.uint64,\n    }\n\n    module.int8 = lookup_types(\"char\", \"i8\", \"int8\")\n    module.int16 = lookup_types(\"short\", \"i16\", \"int16\")\n    module.int32 = lookup_types(\"int\", \"i32\", \"int32\")\n    module.int64 = lookup_types(\"long long\", \"long\", \"i64\", \"int64\")\n    module.signed = {1: module.int8, 2: module.int16, 4: module.int32, 8: module.int64}\n\n    module.pvoid = void.pointer()\n    module.ppvoid = pvoid.pointer()\n    module.pchar = char.pointer()\n\n    module.ptrsize = pvoid.sizeof\n\n    if pvoid.sizeof == 4:\n        module.ptrdiff = module.uint32\n        module.size_t = module.uint32\n        module.ssize_t = module.int32\n    elif pvoid.sizeof == 8:\n        module.ptrdiff = module.uint64\n        module.size_t = module.uint64\n        module.ssize_t = module.int64\n    else:\n        raise Exception(\"Pointer size not supported\")\n    module.null = gdb.Value(0).cast(void)\n\n\n# TODO: Remove this global initialization, or move it somewhere else\n# Call it once so we load all of the types\nupdate()\n\n\ndef load(name):\n    \"\"\"Load a GDB symbol; note that new symbols can be added with `add-symbol-file` functionality\"\"\"\n    try:\n        return gdb.lookup_type(name)\n    except gdb.error:\n        return None\n\n\ndef read_gdbvalue(type_name, addr):\n    \"\"\"Read the memory contents at addr and interpret them as a GDB value with the given type\"\"\"\n    gdb_type = pwndbg.gdblib.typeinfo.load(type_name)\n    return gdb.Value(addr).cast(gdb_type.pointer()).dereference()\n\n\ndef get_type(size):\n    return {\n        1: pwndbg.gdblib.typeinfo.uint8,\n        2: pwndbg.gdblib.typeinfo.uint16,\n        4: pwndbg.gdblib.typeinfo.uint32,\n        8: pwndbg.gdblib.typeinfo.uint64,\n    }[size]\n", "path": "pwndbg/gdblib/typeinfo.py"}], "after_files": [{"content": "\"\"\"\nCommon types, and routines for manually loading types from file\nvia GCC.\n\"\"\"\n\nimport sys\n\nimport gdb\n\nimport pwndbg.lib.gcc\nimport pwndbg.lib.memoize\nimport pwndbg.lib.tempfile\n\nmodule = sys.modules[__name__]\nptrsize: int\n\n\ndef lookup_types(*types):\n    for type_str in types:\n        try:\n            return gdb.lookup_type(type_str)\n        except Exception as e:\n            exc = e\n    raise exc\n\n\ndef update():\n    # Workaround for Rust stuff, see https://github.com/pwndbg/pwndbg/issues/855\n    lang = gdb.execute(\"show language\", to_string=True)\n    if \"rust\" not in lang:\n        restore_lang = None\n    else:\n        gdb.execute(\"set language c\")\n        if '\"auto;' in lang:\n            restore_lang = \"auto\"\n        else:\n            restore_lang = \"rust\"\n\n    module.char = gdb.lookup_type(\"char\")\n    module.ulong = lookup_types(\"unsigned long\", \"uint\", \"u32\", \"uint32\")\n    module.long = lookup_types(\"long\", \"int\", \"i32\", \"int32\")\n    module.uchar = lookup_types(\"unsigned char\", \"ubyte\", \"u8\", \"uint8\")\n    module.ushort = lookup_types(\"unsigned short\", \"ushort\", \"u16\", \"uint16\", \"uint16_t\")\n    module.uint = lookup_types(\"unsigned int\", \"uint\", \"u32\", \"uint32\")\n    module.void = lookup_types(\"void\", \"()\")\n\n    module.uint8 = module.uchar\n    module.uint16 = module.ushort\n    module.uint32 = module.uint\n    module.uint64 = lookup_types(\"unsigned long long\", \"ulong\", \"u64\", \"uint64\")\n    module.unsigned = {\n        1: module.uint8,\n        2: module.uint16,\n        4: module.uint32,\n        8: module.uint64,\n    }\n\n    module.int8 = lookup_types(\"char\", \"i8\", \"int8\")\n    module.int16 = lookup_types(\"short\", \"short int\", \"i16\", \"int16\")\n    module.int32 = lookup_types(\"int\", \"i32\", \"int32\")\n    module.int64 = lookup_types(\"long long\", \"long long int\", \"long\", \"i64\", \"int64\")\n    module.signed = {1: module.int8, 2: module.int16, 4: module.int32, 8: module.int64}\n\n    module.pvoid = void.pointer()\n    module.ppvoid = pvoid.pointer()\n    module.pchar = char.pointer()\n\n    module.ptrsize = pvoid.sizeof\n\n    if pvoid.sizeof == 4:\n        module.ptrdiff = module.uint32\n        module.size_t = module.uint32\n        module.ssize_t = module.int32\n    elif pvoid.sizeof == 8:\n        module.ptrdiff = module.uint64\n        module.size_t = module.uint64\n        module.ssize_t = module.int64\n    else:\n        raise Exception(\"Pointer size not supported\")\n    module.null = gdb.Value(0).cast(void)\n\n    # Rust workaround part 2\n    if restore_lang:\n        gdb.execute(\"set language %s\" % restore_lang)\n\n\n# TODO: Remove this global initialization, or move it somewhere else\n# Call it once so we load all of the types\nupdate()\n\n\ndef load(name):\n    \"\"\"Load a GDB symbol; note that new symbols can be added with `add-symbol-file` functionality\"\"\"\n    try:\n        return gdb.lookup_type(name)\n    except gdb.error:\n        return None\n\n\ndef read_gdbvalue(type_name, addr):\n    \"\"\"Read the memory contents at addr and interpret them as a GDB value with the given type\"\"\"\n    gdb_type = pwndbg.gdblib.typeinfo.load(type_name)\n    return gdb.Value(addr).cast(gdb_type.pointer()).dereference()\n\n\ndef get_type(size):\n    return {\n        1: pwndbg.gdblib.typeinfo.uint8,\n        2: pwndbg.gdblib.typeinfo.uint16,\n        4: pwndbg.gdblib.typeinfo.uint32,\n        8: pwndbg.gdblib.typeinfo.uint64,\n    }[size]\n", "path": "pwndbg/gdblib/typeinfo.py"}]}