summaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2014-12-15 11:38:03 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2014-12-15 11:40:00 -0500
commit38bcc89d48a20af944fe0d51eff3980f7dc8a88e (patch)
tree7375d3dd9a01fad783811546cd0e17b234751ad9 /gdb/defs.h
parent89ed8ea187a460bc746a41f08fa8ee986716743b (diff)
downloadbinutils-gdb-38bcc89d48a20af944fe0d51eff3980f7dc8a88e.tar.gz
Fix build with Python 3.4 (PR python/16784)
The type of the function pointer PyOS_ReadlineFunctionPointer (part of the Python C API), which we use, slightly changed starting with Python 3.4. The signature went from PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); to PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); The parameter that changed is the prompt text. This commits adjust gdb accordingly by making the prompt_arg parameter const, as well as the fallouts of that. I needed to rework how annotations are added to the prompt, since the it is now const. If annotations are enabled, it will make a copy of the prompt overwrite the prompt variable that is used throughout the function. Otherwise, no copy is done and the original prompt_arg value is passed. I changed the signature of deprecated_readline_hook. I would've changed any user of it, but it seems like nothing is using it, Built-tested with python 2.7.x, 3.3.y and 3.4.z. gdb/ChangeLog: * defs.h (gdb_readline): Constify argument. (gdb_readline_wrapper): Same. (command_line_input): Same. (deprecated_readline_hook): Same. * top.c (deprecated_readline_hook): Same. (gdb_readline): Same. (gdb_readline_wrapper): Same. (command_line_input): Constify argument. Pass prompt to called functions instead of local_prompt, overwriting prompt if using annotations. * event-top.h (display_gdb_prompt): Constify argument. * event-top.c (display_gdb_prompt): Same. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Constify argument if building with Python 3.4 and up. Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index 7920938d18e..7b5bc0628a3 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -277,11 +277,11 @@ extern void print_transfer_performance (struct ui_file *stream,
typedef void initialize_file_ftype (void);
-extern char *gdb_readline (char *);
+extern char *gdb_readline (const char *);
-extern char *gdb_readline_wrapper (char *);
+extern char *gdb_readline_wrapper (const char *);
-extern char *command_line_input (char *, int, char *);
+extern char *command_line_input (const char *, int, char *);
extern void print_prompt (void);
@@ -664,7 +664,7 @@ extern void (*deprecated_warning_hook) (const char *, va_list)
extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_readline_begin_hook) (char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
-extern char *(*deprecated_readline_hook) (char *);
+extern char *(*deprecated_readline_hook) (const char *);
extern void (*deprecated_readline_end_hook) (void);
extern void (*deprecated_register_changed_hook) (int regno);
extern void (*deprecated_context_hook) (int);