internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pwndbg/pwndbg

Issue:
Add `vermin` to CI
This project does a pretty good job of detecting all the Python features you're using and outputting the minimum version required: https://github.com/netromdk/vermin

We should add this to CI so we don't accidentally break Python 3.7 with some new features we use.


Discussion:
Hey @gsingh93 id like to have a go at implementing this into the CI.
Could you assign it to me? Thanks.
Awesome! The steps for this include:
- Adding vermin to dev-requirements.txt
- Updating `lint.sh` to call it
- Assert that the minimum reported version is 3.6
- Test on your fork whether the lint checks pass with the current `dev` branch, but then fail if you add some newer feature (note that CI jobs will show up as failed on your fork because of code coverage issues, but the lints/tests should run fine before that).

Resolving patch:
diff --git a/pwndbg/commands/flags.py b/pwndbg/commands/flags.py
--- a/pwndbg/commands/flags.py
+++ b/pwndbg/commands/flags.py
@@ -49,6 +49,7 @@ def setflag(flag, value):
                 bit_value = 1 << flag_bit
 
                 if value == 1:
+                    # novermin
                     new_flags_reg_value = old_flags_reg_value | bit_value
                 else:
                     new_flags_reg_value = old_flags_reg_value & ~bit_value
diff --git a/pwndbg/disasm/__init__.py b/pwndbg/disasm/__init__.py
--- a/pwndbg/disasm/__init__.py
+++ b/pwndbg/disasm/__init__.py
@@ -89,6 +89,7 @@ def get_disassembler_cached(arch, ptrsize, endian, extra=None):
 
 def get_disassembler(pc):
     if pwndbg.gdblib.arch.current == "armcm":
+        # novermin
         extra = (
             (CS_MODE_MCLASS | CS_MODE_THUMB)
             if (pwndbg.gdblib.regs.xpsr & (1 << 24))
diff --git a/pwndbg/disasm/arch.py b/pwndbg/disasm/arch.py
--- a/pwndbg/disasm/arch.py
+++ b/pwndbg/disasm/arch.py
@@ -12,6 +12,7 @@
 
 for value1, name1 in dict(access).items():
     for value2, name2 in dict(access).items():
+        # novermin
         access.setdefault(value1 | value2, "%s | %s" % (name1, name2))
 
 


Test patch:
Repository: pwndbg/pwndbg

Issue:
Use the `gh` cli tool to create issues from `bugreport` if it's installed
Github has a CLI tool that can do things like create issues: https://cli.github.com/

When running pwndbg on a server, I can't do `bugreport --run-browser` because there's no X server running. I have to go through the issue creation process manually, copying and pasting the output. We could automate all of this using `gh issue create`.


Discussion:

Resolving patch:
diff --git a/pwndbg/commands/version.py b/pwndbg/commands/version.py
--- a/pwndbg/commands/version.py
+++ b/pwndbg/commands/version.py
@@ -4,9 +4,12 @@
 
 
 import argparse
+import os
 import sys
 from platform import platform
+from subprocess import check_call
 from subprocess import check_output
+from tempfile import NamedTemporaryFile
 from urllib.parse import quote
 
 import gdb
@@ -79,13 +82,17 @@ def version():
     Generate bugreport
     """
 )
-bugreport_parser.add_argument(
+bugreport_group = bugreport_parser.add_mutually_exclusive_group()
+bugreport_group.add_argument(
     "--run-browser", "-b", action="store_true", help="Open browser on github/issues/new"
 )
+bugreport_group.add_argument(
+    "--use-gh", "-g", action="store_true", help="Create issue using Github CLI"
+)
 
 
 @pwndbg.commands.ArgparsedCommand(bugreport_parser)
-def bugreport(run_browser=False):
+def bugreport(run_browser=False, use_gh=False):
     ISSUE_TEMPLATE = """
 <!--
 Before reporting a new issue, make sure that we do not have any duplicates already open.
@@ -189,7 +196,17 @@ def bugreport(run_browser=False):
     github_issue_url = "https://github.com/pwndbg/pwndbg/issues/new"
     github_issue_body = "?body=" + quote(issue_bugreport)
 
-    if run_browser:
+    if use_gh:
+        try:
+            with NamedTemporaryFile("w", delete=True) as f:
+                f.write(issue_bugreport)
+                f.flush()
+                check_call([os.environ.get("EDITOR", "vi"), f.name])
+                check_call(["gh", "issue", "create", "--body-file", f.name])
+        except Exception:
+            print(please_please_submit + github_issue_url)
+            raise
+    elif run_browser:
         try:
             check_output(["xdg-open", github_issue_url + github_issue_body])
         except Exception:


Test patch:
Repository: pwndbg/pwndbg

Issue:
Warn if page table is invalid instead of asserting
(Discussed in https://github.com/pwndbg/pwndbg/discussions/1456)

We should warn if `monitor info mem` is showing some invalid page table instead of asserting.


Discussion:

Resolving patch:
diff --git a/pwndbg/gdblib/vmmap.py b/pwndbg/gdblib/vmmap.py
--- a/pwndbg/gdblib/vmmap.py
+++ b/pwndbg/gdblib/vmmap.py
@@ -450,6 +450,9 @@ def kernel_vmmap_via_page_tables():
     return tuple(retpages)
 
 
+monitor_info_mem_not_warned = True
+
+
 def kernel_vmmap_via_monitor_info_mem():
     """
     Returns Linux memory maps information by parsing `monitor info mem` output
@@ -469,6 +472,7 @@ def kernel_vmmap_via_monitor_info_mem():
     # ffff90358009b000-ffff903582200000 0000000002165000 -rw
     # ffff903582200000-ffff903582803000 0000000000603000 -r-
     """
+    global monitor_info_mem_not_warned
     monitor_info_mem = None
     try:
         monitor_info_mem = gdb.execute("monitor info mem", to_string=True)
@@ -505,7 +509,19 @@ def kernel_vmmap_via_monitor_info_mem():
         start = int(line[:dash_idx], 16)
         end = int(line[dash_idx + 1 : space_idx], 16)
         size = int(line[space_idx + 1 : rspace_idx], 16)
-        assert end - start == size, "monitor info mem output didn't pass a sanity check"
+        if end - start != size and monitor_info_mem_not_warned:
+            print(
+                M.warn(
+                    (
+                        "The vmmap output may be incorrect as `monitor info mem` output assertion/assumption\n"
+                        "that end-start==size failed. The values are:\n"
+                        "end=%#x; start=%#x; size=%#x; end-start=%#x\n"
+                        "Note that this warning will not show up again in this Pwndbg/GDB session."
+                    )
+                    % (end, start, size, end - start)
+                )
+            )
+            monitor_info_mem_not_warned = False
         perm = line[rspace_idx + 1 :]
 
         flags = 0


Test patch:
Repository: pwndbg/pwndbg

Issue:
Print thread id that belong to arena
`arena` print that struct 
```
struct MallocState {
  int mutex;
  int flags;
  int have_fastchunks;
  pvoid_Array_10 fastbinsY;
  pvoid top;
  pvoid last_remainder;
  pvoid_Array_254 bins;
  int_Array_4 binmap;
  pvoid next;
  pvoid next_free;
  size_t attached_threads;
  size_t system_mem;
  size_t max_system_mem;
}
struct MallocState pwndbg_MallocState;
```

I offer to print the thread id that belong to that arena ( `attached_threads` print only the thread count  ) 



Discussion:
Sounds useful 👍
Perhaps printing something like "Arena for thread N:" before the struct is dumped.
I suppose it would only work when no `address` argument was passed, at least not without doing a lot more legwork to tie an arena to a thread.
`Arena for thread N:` sounds great 
Which number do we care about here? I guess the GDB's thread identifier?
```
Variable: InferiorThread.num
The per-inferior number of the thread, as assigned by GDB.

Variable: InferiorThread.global_num
The global ID of the thread, as assigned by GDB. You can use this to make Python breakpoints thread-specific, for example (see [The Breakpoint.thread attribute](https://sourceware.org/gdb/onlinedocs/gdb/Breakpoints-In-Python.html#python_005fbreakpoint_005fthread)).

Variable: InferiorThread.ptid
ID of the thread, as assigned by the operating system. This attribute is a tuple containing three integers. The first is the Process ID (PID); the second is the Lightweight Process ID (LWPID), and the third is the Thread ID (TID). Either the LWPID or TID may be 0, which indicates that the operating system does not use that identifier.
```
(via https://sourceware.org/gdb/onlinedocs/gdb/Threads-In-Python.html)
@disconnect3d GDB's thread identifier will be great.
Linux's thread identifier will be the best :)


Resolving patch:
diff --git a/pwndbg/commands/heap.py b/pwndbg/commands/heap.py
--- a/pwndbg/commands/heap.py
+++ b/pwndbg/commands/heap.py
@@ -169,6 +169,8 @@ def arena(addr=None) -> None:
     else:
         arena = allocator.thread_arena
 
+    tid = pwndbg.gdblib.proc.thread_id
+    print(message.hint(f"Arena for thread {tid}:"))
     print(arena._gdbValue)  # Breaks encapsulation, find a better way.
 
 
diff --git a/pwndbg/gdblib/proc.py b/pwndbg/gdblib/proc.py
--- a/pwndbg/gdblib/proc.py
+++ b/pwndbg/gdblib/proc.py
@@ -40,6 +40,10 @@ def tid(self):
 
         return self.pid
 
+    @property
+    def thread_id(self):
+        return gdb.selected_thread().num
+
     @property
     def alive(self) -> bool:
         """


Test patch:
Repository: pwndbg/pwndbg

Issue:
missing heap macro `largebin_index_32_big()`
The `largebin_index_32_big()` macro is used by GLIBC malloc to compute a largebin index when `MALLOC_ALIGNMENT` is 16 but `SIZE_SZ` isn't 8 (e.g. when running a 32bit program on 64bit architecture).

Without it, pwndbg incorrectly computes largebin indices in such scenarios.

Here's GLIBC's [`largebin_index_32_big()` macro](https://github.com/bminor/glibc/blob/4c721f24fc190d1dc935eb0bab283de7cf13182e/malloc/malloc.c#L1573-L1579).


Discussion:

Resolving patch:
diff --git a/pwndbg/heap/ptmalloc.py b/pwndbg/heap/ptmalloc.py
--- a/pwndbg/heap/ptmalloc.py
+++ b/pwndbg/heap/ptmalloc.py
@@ -1062,6 +1062,25 @@ def largebin_index_32(self, sz):
             else 126
         )
 
+    def largebin_index_32_big(self, sz):
+        """Modeled on the GLIBC malloc largebin_index_32_big macro.
+
+        https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/malloc.c;h=f7cd29bc2f93e1082ee77800bd64a4b2a2897055;hb=9ea3686266dca3f004ba874745a4087a89682617#l1422
+        """
+        return (
+            49 + (sz >> 6)
+            if (sz >> 6) <= 45
+            else 91 + (sz >> 9)
+            if (sz >> 9) <= 20
+            else 110 + (sz >> 12)
+            if (sz >> 12) <= 10
+            else 119 + (sz >> 15)
+            if (sz >> 15) <= 4
+            else 124 + (sz >> 18)
+            if (sz >> 18) <= 2
+            else 126
+        )
+
     def largebin_index_64(self, sz):
         """Modeled on the GLIBC malloc largebin_index_64 macro.
 
@@ -1083,11 +1102,12 @@ def largebin_index_64(self, sz):
 
     def largebin_index(self, sz):
         """Pick the appropriate largebin_index_ function for this architecture."""
-        return (
-            self.largebin_index_64(sz)
-            if pwndbg.gdblib.arch.ptrsize == 8
-            else self.largebin_index_32(sz)
-        )
+        if pwndbg.gdblib.arch.ptrsize == 8:
+            return self.largebin_index_64(sz)
+        elif self.malloc_alignment == 16:
+            return self.largebin_index_32_big(sz)
+        else:
+            return self.largebin_index_32(sz)
 
     def is_initialized(self):
         raise NotImplementedError()


Test patch:
Repository: pwndbg/pwndbg

Issue:
Disable search-memory-packet back only on broken GDB version
Tl;dr: Use the workaround from https://github.com/pwndbg/pwndbg/pull/322/files only for broken gdb versions
Disable search-memory-packet back only on broken GDB version
Tl;dr: Use the workaround from https://github.com/pwndbg/pwndbg/pull/322/files only for broken gdb versions


Discussion:
According to the referenced bug, the issue may have been fixed back in 2020. If so, I'd guess it's in GDB 10, which means 18.04 and 20.04 are still affected (with versions 8.1 and 9.2), but not 22.04 (with version 12).
We should check if this is about GDB or GDBServer version or both and if we should only use the workaround if we detect a version that needs it.
Fwiw we have removed the `set remote search-memory-packet off ` setting in 77380eb63c6cfdb721f2a2c4448f9d544fa03bd7 accidentally I think :/.
According to the referenced bug, the issue may have been fixed back in 2020. If so, I'd guess it's in GDB 10, which means 18.04 and 20.04 are still affected (with versions 8.1 and 9.2), but not 22.04 (with version 12).
We should check if this is about GDB or GDBServer version or both and if we should only use the workaround if we detect a version that needs it.
Fwiw we have removed the `set remote search-memory-packet off ` setting in 77380eb63c6cfdb721f2a2c4448f9d544fa03bd7 accidentally I think :/.

Resolving patch:
diff --git a/pwndbg/__init__.py b/pwndbg/__init__.py
--- a/pwndbg/__init__.py
+++ b/pwndbg/__init__.py
@@ -54,6 +54,10 @@
     pwndbg.ui.get_window_size()[1]
 )
 
+# See https://github.com/pwndbg/pwndbg/issues/808
+if int(getattr(gdb, "VERSION", "0.0").split(".")[0]) <= 9:
+    pre_commands += "\nset remote search-memory-packet off"
+
 for line in pre_commands.strip().splitlines():
     gdb.execute(line)
 


Test patch:
Repository: pwndbg/pwndbg

Issue:
`GlibcMemoryAllocator.smallbins()` doesn't account for `SMALLBIN_CORRECTION`
GLIBC malloc's [`SMALLBIN_CORRECTION`](https://github.com/bminor/glibc/blob/10f980d31e3d65c4c5bfafd176e7e1db92e2babe/malloc/malloc.c#L1555) constant is used to avoid wasting smallbins when the target architecture's pointer size is 4 bytes, but `MALLOC_ALIGNMENT` is 16 bytes.

The current `smallbins()` implementation doesn't account for this, and smallbins are labelled incorrectly in the above scenario (e.g. on i386 with GLIBC version >= 2.26)

Seen below, the chunk in the `0x20` smallbin is actually `0x30` sized.
The chunk in the smallbin labelled `0x28` is actually `0x40` sized.

![bad smallbins](https://user-images.githubusercontent.com/16000770/223895273-f12a2468-e77c-44cf-8246-20c2f9301243.png)


Discussion:

Resolving patch:
diff --git a/pwndbg/heap/ptmalloc.py b/pwndbg/heap/ptmalloc.py
--- a/pwndbg/heap/ptmalloc.py
+++ b/pwndbg/heap/ptmalloc.py
@@ -808,7 +808,7 @@ def _request2size(self, req):
 
     def _spaces_table(self):
         spaces_table = (
-            [pwndbg.gdblib.arch.ptrsize * 2] * 64
+            [self.malloc_alignment] * 64
             + [pow(2, 6)] * 32
             + [pow(2, 9)] * 16
             + [pow(2, 12)] * 8


Test patch:
Repository: pwndbg/pwndbg

Issue:
Heap heuristic will fail on big-endian architectures
This can be reproduced by:
```console
$ cat test.c
#include <stdlib.h>

int main(){
  free(malloc(0x20));
  return 0;
}
$ mips-linux-gnu-gcc test.c -ggdb
$ qemu-mips -g 1234 -L /usr/mips-linux-gnu ./a.out
```

The libc I used is from: http://kr.archive.ubuntu.com/ubuntu/pool/universe/c/cross-toolchain-base-mipsen/libc6-mips-cross_2.30-0ubuntu2cross2_all.deb
``` console
$ file /usr/mips-linux-gnu/lib/libc-2.30.so
/usr/mips-linux-gnu/lib/libc-2.30.so: ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, BuildID[sha1]=fff2eaa960489be0b3b109d4e52230c8fe34b2a1, for GNU/Linux 3.2.0, stripped
```

Then:
```console
$ gdb -q ./a.out -ex 'set exception-verbose on' -ex 'set solib-absolute-prefix /usr/mips-linux-gnu/lib' -ex 'set solib-search-path /usr/mips-linux-gnu/lib' -ex 'target remote :1234' -ex 'break main' -ex 'continue' -ex 'next' -ex 'heap'
```

We will get: `KeyError: <class 'pwndbg.heap.structs.c_pvoid'>`.
That’s because the keys in the dict are little-endian, but we try to access the dict with a big-endian type.
We should use the correct endian for the keys in the dict.

----

Btw, I’m not sure if we really need to support heap heuristic for this architecture in the future, but the heuristic seems will also work for the single-threaded program for this architecture after we resolve this issue, which is good news :)


Discussion:

Resolving patch:
diff --git a/pwndbg/heap/structs.py b/pwndbg/heap/structs.py
--- a/pwndbg/heap/structs.py
+++ b/pwndbg/heap/structs.py
@@ -78,6 +78,12 @@ class c_size_t(SIZE_T):
     c_size_t: pwndbg.gdblib.typeinfo.size_t,
 }
 
+# Use correct endian for the dictionary keys
+if pwndbg.gdblib.arch.endian == "little":
+    C2GDB_MAPPING = {k.__ctype_le__: v for k, v in C2GDB_MAPPING.items()}
+else:
+    C2GDB_MAPPING = {k.__ctype_be__: v for k, v in C2GDB_MAPPING.items()}
+
 
 class FakeGDBField:
     """


Test patch:
Repository: pwndbg/pwndbg

Issue:
The heuristic for `malloc_par` is wrong
That's because it defined the wrong type at:
https://github.com/pwndbg/pwndbg/blob/59e759e0363cd474e662f28503f8de726baf7d20/pwndbg/heap/structs.py#L694
and
https://github.com/pwndbg/pwndbg/blob/59e759e0363cd474e662f28503f8de726baf7d20/pwndbg/heap/structs.py#L770

----

The type should be size_t, not int32.
This might cause the heuristic for `malloc_par` incorrect on powerpc64 and other similar architectures.


Discussion:

Resolving patch:
diff --git a/pwndbg/heap/structs.py b/pwndbg/heap/structs.py
--- a/pwndbg/heap/structs.py
+++ b/pwndbg/heap/structs.py
@@ -691,7 +691,7 @@ class c_malloc_par_2_26(Structure):
         ("sbrk_base", c_pvoid),
         ("tcache_bins", c_size_t),
         ("tcache_max_bytes", c_size_t),
-        ("tcache_count", ctypes.c_int32),
+        ("tcache_count", c_size_t),
         ("tcache_unsorted_limit", c_size_t),
     ]
 
@@ -767,7 +767,7 @@ class c_malloc_par_2_35(Structure):
         ("sbrk_base", c_pvoid),
         ("tcache_bins", c_size_t),
         ("tcache_max_bytes", c_size_t),
-        ("tcache_count", ctypes.c_int32),
+        ("tcache_count", c_size_t),
         ("tcache_unsorted_limit", c_size_t),
     ]
 


Test patch:
Repository: pwndbg/pwndbg

Issue:
bugreport command: show more info
The bugreport command should display more information like:
* show osabi
* show architecture
* show endian

Depending on current arch -- note that those are only available if given arch is supported by current GDB, like `gdb-multiarch`:
* show arm
* show mips

Maybe also:
* show charset
* show width
* show height




Discussion:
Hi, how to get involved in pwndbg project as a newcomer ?  
Hi, just [send a pull request with a change that you want implemented](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).

You can also use `rip grep`/`grep`/git grep` to find files ineository, which may or may not help. See also this: https://github.com/pwndbg/pwndbg/blob/dev/DEVELOPING.md
You can also join our Discord (link in the README) and we can help you with any questions.

Resolving patch:
diff --git a/pwndbg/commands/version.py b/pwndbg/commands/version.py
--- a/pwndbg/commands/version.py
+++ b/pwndbg/commands/version.py
@@ -157,6 +157,40 @@ def bugreport(run_browser=False, use_gh=False):
                 os_info = match.group(1)
 
     current_setup += "OS: %s\n" % os_info
+
+    # 1. showing osabi
+    osabi_info = platform.uname().version
+    current_setup += "OS ABI: %s\n" % osabi_info
+
+    # 2. showing architecture
+    arch_info = platform.machine()
+    current_setup += "Architecture: %s\n" % arch_info
+
+    # 3. showing endian
+    endian_info = sys.byteorder
+    current_setup += "Endian: %s\n" % endian_info
+
+    # 4. Depending on current arch -- note that those are only available if given arch is supported by current GDB, like gdb-multiarch
+    if arch_info in ["armv7l", "aarch64"]:
+        arm_info = gdb.execute("show arm", to_string=True)
+        current_setup += "ARM: %s\n" % arm_info
+
+    elif arch_info in ["mips", "mips64"]:
+        mips_info = gdb.execute("show mips", to_string=True)
+        current_setup += "MIPS: %s\n" % mips_info
+
+    # 7. showing charset
+    charset_info = sys.getdefaultencoding()
+    current_setup += "Charset: %s\n" % charset_info
+
+    # 8. showing width
+    width_info = os.get_terminal_size().columns
+    current_setup += "Width: %s\n" % width_info
+
+    # 9. showing height
+    height_info = os.get_terminal_size().lines
+    current_setup += "Height: %s\n" % height_info
+
     current_setup += "\n".join(all_info)
     current_setup += "\n" + "\n".join(gdb_config)
 


Test patch:
Repository: pwndbg/pwndbg

Issue:
`pwndbg.gdblib.symbol.address` might return invalid address if vmmap is not working
https://github.com/pwndbg/pwndbg/blob/be306da2553596443d2bdaa378bf11cf59e3eab5/pwndbg/gdblib/symbol.py#L146-L147

Some weird results for thread-local variables might pass this check if our vmmap is not working.
For example, with qemu-user, the result of vmmap is a 0~0xfffff…ffff region, so `not pwndbg.gdblib.vmmap.find(address)` will always be `False`.


Discussion:
Oh that's... obviously unintentional :), guess we need to handle the qemu 0-fffff case differently; perhaps we should check for this case somewhere and do sth based on that.

Resolving patch:
diff --git a/pwndbg/gdblib/symbol.py b/pwndbg/gdblib/symbol.py
--- a/pwndbg/gdblib/symbol.py
+++ b/pwndbg/gdblib/symbol.py
@@ -15,7 +15,6 @@
 import pwndbg.gdblib.elf
 import pwndbg.gdblib.events
 import pwndbg.gdblib.file
-import pwndbg.gdblib.info
 import pwndbg.gdblib.memory
 import pwndbg.gdblib.qemu
 import pwndbg.gdblib.remote
@@ -141,27 +140,18 @@ def address(symbol: str) -> int:
 
     try:
         # Unfortunately, `gdb.lookup_symbol` does not seem to handle all
-        # symbols, so we need to fallback to using `info address`. See
+        # symbols, so we need to fallback to using `gdb.parse_and_eval`. See
         # https://sourceware.org/pipermail/gdb/2022-October/050362.html
-        address = pwndbg.gdblib.info.address(symbol)
-        if address is None or not pwndbg.gdblib.vmmap.find(address):
-            return None
-
-        return address
+        # (We tried parsing the output of the `info address` before, but there were some issues. See #1628 and #1666)
+        if "\\" in symbol:
+            # Is it possible that happens? Probably not, but just in case
+            raise ValueError(f"Symbol {symbol!r} contains a backslash")
+        sanitized_symbol_name = symbol.replace("'", "\\'")
+        return int(gdb.parse_and_eval(f"&'{sanitized_symbol_name}'"))
 
     except gdb.error:
         return None
 
-    try:
-        # TODO: We should properly check if we have a connection to the IDA server first
-        address = pwndbg.ida.LocByName(symbol)
-        if address:
-            return address
-    except Exception:
-        pass
-
-    return None
-
 
 @pwndbg.lib.cache.cache_until("objfile", "thread")
 def static_linkage_symbol_address(symbol: str) -> int:


Test patch:
Repository: pwndbg/pwndbg

Issue:
Wrong vmmap yama ptrace_scope command suggested
https://github.com/pwndbg/pwndbg/blob/44d75e3bd6d9741daf87c933275369fcfeaeebe7/pwndbg/gdblib/vmmap.py#L436

The command here should be:
```
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
```

(can't really make a PR with this in this exact moment)


Discussion:

Resolving patch:
diff --git a/pwndbg/gdblib/vmmap.py b/pwndbg/gdblib/vmmap.py
--- a/pwndbg/gdblib/vmmap.py
+++ b/pwndbg/gdblib/vmmap.py
@@ -433,7 +433,7 @@ def kernel_vmmap_via_page_tables():
         print(
             M.error(
                 "Permission error when attempting to parse page tables with gdb-pt-dump.\n"
-                + "Either change the kernel-vmmap setting, re-run GDB as root, or disable `ptrace_scope` (`echo 0 | sudo tee /proc/sys/kernel/yama`)"
+                + "Either change the kernel-vmmap setting, re-run GDB as root, or disable `ptrace_scope` (`echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope`)"
             )
         )
         return tuple(retpages)


Test patch: