Bug 1227348

Summary: windows:mingw:win{32|64}/mingw{32|64}-gdb: TypeError: a bytes-like object is required, not 'str'
Product: [openSUSE] openSUSE.org Reporter: Ralf Habacker <ralf.habacker>
Component: 3rd party softwareAssignee: Ralf Habacker <ralf.habacker>
Status: RESOLVED FIXED QA Contact: E-mail List <screening-team-bugs>
Severity: Normal    
Priority: P5 - None CC: mkbosmans
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ralf Habacker 2024-07-03 14:29:35 UTC
When running cross compiled gdb with a test program linked against libstdc++ and installed pretty printers the following error message appears:

Traceback (most recent call last):
  File "Z:\usr/i686-w64-mingw32/sys-root/mingw/share/gdb/python\gdb\__init__.py", line 148, in _execute_file
    compiled = compile(file.read().replace('\r\n','\n'), filepath, 'exec')
TypeError: a bytes-like object is required, not 'str'


How to reproduce:

1. on an openSUSE Leap host run 
  sudo zypper install mingw32-gdb mingw32-libstdc++-gdb-printer wine <your-test-program>

2.  run 
  wine /usr/i686-w64-mingw32/sys-root/mingw/bin/gdb.exe -ex "set auto-load safe-path /" <test-program>
(gdb) b main
(gdb) r