Issue #1667 Display OS Information In Bugreport (#1683)

This commit is contained in:
MinimalEffort07 2023-04-24 03:13:10 +10:00 committed by GitHub
parent e1dad2e8c7
commit 4fde3e898c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -5,8 +5,9 @@ Displays gdb, python and pwndbg versions.
import argparse import argparse
import os import os
import platform
import re
import sys import sys
from platform import platform
from subprocess import check_call from subprocess import check_call
from subprocess import check_output from subprocess import check_output
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
@ -144,8 +145,18 @@ If it is somehow unavailable, use:
gdb_config = gdb.execute("show configuration", to_string=True).split("\n") gdb_config = gdb.execute("show configuration", to_string=True).split("\n")
all_info = all_versions() all_info = all_versions()
os_info = platform.system()
current_setup = "Platform: %s\n" % platform() current_setup = "Platform: %s\n" % platform.platform()
if os_info.lower() == "linux" and os.path.isfile("/etc/os-release"):
with open("/etc/os-release", "r") as os_release:
contents = os_release.read()
match = re.search('PRETTY_NAME="?([^",\n]+)', contents)
if match:
os_info = match.group(1)
current_setup += "OS: %s\n" % os_info
current_setup += "\n".join(all_info) current_setup += "\n".join(all_info)
current_setup += "\n" + "\n".join(gdb_config) current_setup += "\n" + "\n".join(gdb_config)