Repository: pwndbg/pwndbg

Issue:
fastbins command doesn't show all default fastbins
I am currently using Kali Linux.
the `fastbins` command doesn't show any empty bins, only shown as empty on latest **pwndbg v2023.03.19**.
On **pwndbg v2022.12.19**, `fastbins` command is able to show all the fastbins 0x20 - 0x80.

This is also happening when using `bins` command.
I didn't see on change log regarding about` fastbins` command.
Hence, I reporting this as an issue.

Below is on v2022
<img width="94" alt="v2022_fastbin_empty" src="https://user-images.githubusercontent.com/37389504/230778080-6b1f6b2d-fdd2-4870-b416-22a845676c03.png">
<img width="632" alt="v2022_fastbin_after_free" src="https://user-images.githubusercontent.com/37389504/230778073-6dd1d89c-dd2d-491a-aa2a-60e9a1c4aef6.png">

Below is on v2023
<img width="105" alt="v2023_fastbin_empty" src="https://user-images.githubusercontent.com/37389504/230778079-a8367f23-7de6-4d51-8820-7a07f1ef7b95.png">
<img width="633" alt="v2023_fastbin_after_free" src="https://user-images.githubusercontent.com/37389504/230778077-9686a26a-3027-4985-adb2-a31d60baa2e4.png">





Discussion:
This is not a bug. I believe this is due to the change made in https://github.com/pwndbg/pwndbg/pull/1655 and you can now use `--verbose` flag to list the empty bins. This change is also not included in the [latest release (2023.03.19)](https://github.com/pwndbg/pwndbg/releases/tag/2023.03.19)

Should we maybe display this differently? Inform user that they can use --verbose or sth? cc: @CptGibbon 
Thanks for the fast response.

Just a suggestion, maybe can put in the change log informing the user that -v or --verbose can show more details for fastbins? (applicable for other bins)
I'll update the change log and make the help description for the `--verbose` flag more descriptive.
Yeah, we will note that in a changelog when we do the next release that will include this commit.

Resolving patch:
diff --git a/pwndbg/commands/heap.py b/pwndbg/commands/heap.py
--- a/pwndbg/commands/heap.py
+++ b/pwndbg/commands/heap.py
@@ -479,7 +479,9 @@ def bins(addr=None, tcache_addr=None) -> None:
 Default to the current thread's arena.""",
 )
 parser.add_argument("addr", nargs="?", type=int, help="Address of the arena.")
-parser.add_argument("-v", "--verbose", action="store_true", help="Show extra detail.")
+parser.add_argument(
+    "-v", "--verbose", action="store_true", help="Show all fastbins, including empty ones"
+)
 
 
 @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.HEAP)
@@ -511,7 +513,9 @@ def fastbins(addr=None, verbose=False) -> None:
 Default to the current thread's arena.""",
 )
 parser.add_argument("addr", nargs="?", type=int, help="Address of the arena.")
-parser.add_argument("-v", "--verbose", action="store_true", help="Show extra detail.")
+parser.add_argument(
+    "-v", "--verbose", action="store_true", help='Show the "all" bin even if it\'s empty'
+)
 
 
 @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.HEAP)
@@ -543,7 +547,9 @@ def unsortedbin(addr=None, verbose=False) -> None:
 Default to the current thread's arena.""",
 )
 parser.add_argument("addr", nargs="?", type=int, help="Address of the arena.")
-parser.add_argument("-v", "--verbose", action="store_true", help="Show extra detail.")
+parser.add_argument(
+    "-v", "--verbose", action="store_true", help="Show all smallbins, including empty ones"
+)
 
 
 @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.HEAP)
@@ -575,7 +581,9 @@ def smallbins(addr=None, verbose=False) -> None:
 Default to the current thread's arena.""",
 )
 parser.add_argument("addr", nargs="?", type=int, help="Address of the arena.")
-parser.add_argument("-v", "--verbose", action="store_true", help="Show extra detail.")
+parser.add_argument(
+    "-v", "--verbose", action="store_true", help="Show all largebins, including empty ones"
+)
 
 
 @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.HEAP)
@@ -607,7 +615,9 @@ def largebins(addr=None, verbose=False) -> None:
 Default to the current thread's tcache.""",
 )
 parser.add_argument("addr", nargs="?", type=int, help="The address of the tcache bins.")
-parser.add_argument("-v", "--verbose", action="store_true", help="Show extra detail.")
+parser.add_argument(
+    "-v", "--verbose", action="store_true", help="Show all tcachebins, including empty ones"
+)
 
 
 @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.HEAP)


Test patch: