binutils-gdb/gdb/python
Simon Marchi 38bcc89d48 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>
2014-12-15 11:40:00 -05:00
..
lib/gdb python extended prompt: Use os.getcwd() instead of os.getcwdu() 2014-12-15 11:40:00 -05:00
py-arch.c
py-auto-load.c
py-block.c Split struct symtab into two: struct symtab and compunit_symtab. 2014-11-20 07:47:44 -08:00
py-bpevent.c
py-breakpoint.c
py-cmd.c
py-continueevent.c
py-event.c
py-event.h New python events: inferior call, register/memory changed. 2014-12-02 11:15:29 -08:00
py-events.h New python events: inferior call, register/memory changed. 2014-12-02 11:15:29 -08:00
py-evtregistry.c
py-evts.c New python events: inferior call, register/memory changed. 2014-12-02 11:15:29 -08:00
py-exitedevent.c
py-finishbreakpoint.c
py-frame.c SYMTAB_OBJFILE: New macro. 2014-11-18 09:19:11 -08:00
py-framefilter.c
py-function.c
py-gdb-readline.c Fix build with Python 3.4 (PR python/16784) 2014-12-15 11:40:00 -05:00
py-inferior.c New python events: inferior call, register/memory changed. 2014-12-02 11:15:29 -08:00
py-infevents.c New python events: inferior call, register/memory changed. 2014-12-02 11:15:29 -08:00
py-infthread.c New python events: inferior call, register/memory changed. 2014-12-02 11:15:29 -08:00
py-lazy-string.c
py-linetable.c symtab.h (SYMTAB_LINETABLE): Renamed from LINETABLE. All uses updated. 2014-11-18 09:32:10 -08:00
py-newobjfileevent.c New python event "clear_objfiles". 2014-10-17 11:12:17 -07:00
py-objfile.c New python function gdb.lookup_objfile. 2014-12-12 09:48:13 -08:00
py-param.c
py-prettyprint.c
py-progspace.c Add ability to add attributes to gdb.Objfile and gdb.Progspace objects. 2014-10-30 17:05:17 -07:00
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c Use SYMBOL_OBJFILE more. 2014-11-18 08:54:06 -08:00
py-symtab.c Split struct symtab into two: struct symtab and compunit_symtab. 2014-11-20 07:47:44 -08:00
py-threadevent.c
py-type.c Delete TYPE_CODE_CLASS, it's just an alias of TYPE_CODE_STRUCT. 2014-11-06 17:19:06 -08:00
py-utils.c
py-value.c Delete TYPE_CODE_CLASS, it's just an alias of TYPE_CODE_STRUCT. 2014-11-06 17:19:06 -08:00
py-varobj.c
py-xmethods.c
python-config.py
python-internal.h New python function gdb.lookup_objfile. 2014-12-12 09:48:13 -08:00
python.c New python function gdb.lookup_objfile. 2014-12-12 09:48:13 -08:00
python.h