mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-23 18:26:47 +08:00
Fix Windows gdb build failure with Python 2 support
GDB fails to build for Windows host with Python 2 support enabled due to PyFile_FromString's second argument being of type char * and being passed a (const) string literal. This parameter is input only so this commit fixes the issue by casting to char *. 2017-04-06 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/ * python/python.c (python_run_simple_file): Cast mode literal to non-const char pointer as expected by PyFile_FromString.
This commit is contained in:
@ -352,7 +352,7 @@ python_run_simple_file (FILE *file, const char *filename)
|
||||
/* Because we have a string for a filename, and are using Python to
|
||||
open the file, we need to expand any tilde in the path first. */
|
||||
gdb::unique_xmalloc_ptr<char> full_path (tilde_expand (filename));
|
||||
gdbpy_ref<> python_file (PyFile_FromString (full_path.get (), "r"));
|
||||
gdbpy_ref<> python_file (PyFile_FromString (full_path.get (), (char *) "r"));
|
||||
if (python_file == NULL)
|
||||
{
|
||||
gdbpy_print_stack ();
|
||||
|
Reference in New Issue
Block a user