Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix py-xmethods.c when compiled with -Werror against Python 2.4
@ 2014-06-04 18:05 Siva Chandra
  2014-06-04 18:13 ` Joel Brobecker
  2014-06-04 19:57 ` Pedro Alves
  0 siblings, 2 replies; 8+ messages in thread
From: Siva Chandra @ 2014-06-04 18:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: Doug Evans, uweigand

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

Does the attached patch fix the issue pointed out by Ulrich Weigand
here: https://sourceware.org/ml/gdb-patches/2014-06/msg00169.html

ChangeLog
2014-06-04  Siva Chandra Reddy  <sivachandra@google.com>

        * python/py-xmethods.c (invoke_match_method)
        (gdbpy_get_matching_xmethod_workers, gdbpy_get_xmethod_arg_types):
        Cast the second arg to PyObject_GetAttrString and
        PyObject_GetAttrString to char *.

[-- Attachment #2: fix_xmethod_for_2_4.txt --]
[-- Type: text/plain, Size: 1936 bytes --]

diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c
index 0062b2d..5ba146f 100644
--- a/gdb/python/py-xmethods.c
+++ b/gdb/python/py-xmethods.c
@@ -106,7 +106,7 @@ invoke_match_method (PyObject *matcher, PyObject *py_obj_type,
 
   cleanups = make_cleanup (null_cleanup, NULL);
 
-  enabled_field = PyObject_GetAttrString (matcher, enabled_field_name);
+  enabled_field = PyObject_GetAttrString (matcher, (char *) enabled_field_name);
   if (enabled_field == NULL)
     {
       do_cleanups (cleanups);
@@ -127,7 +127,7 @@ invoke_match_method (PyObject *matcher, PyObject *py_obj_type,
       Py_RETURN_NONE;
     }
 
-  match_method = PyObject_GetAttrString (matcher, match_method_name);
+  match_method = PyObject_GetAttrString (matcher, (char *) match_method_name);
   if (match_method == NULL)
     {
       do_cleanups (cleanups);
@@ -252,13 +252,13 @@ gdbpy_get_matching_xmethod_workers
 
   /* Gather debug method matchers registered globally.  */
   if (gdb_python_module != NULL
-      && PyObject_HasAttrString (gdb_python_module, matchers_attr_str))
+      && PyObject_HasAttrString (gdb_python_module, (char *) matchers_attr_str))
     {
       PyObject *gdb_matchers;
       PyObject *temp = py_xmethod_matcher_list;
 
       gdb_matchers = PyObject_GetAttrString (gdb_python_module,
-					     matchers_attr_str);
+					     (char *) matchers_attr_str);
       if (gdb_matchers != NULL)
 	{
 	  py_xmethod_matcher_list = PySequence_Concat (temp, gdb_matchers);
@@ -391,8 +391,8 @@ gdbpy_get_xmethod_arg_types (const struct extension_language_defn *extlang,
 
   cleanups = ensure_python_env (get_current_arch (), current_language);
 
-  get_arg_types_method =  PyObject_GetAttrString (py_worker,
-						  get_arg_types_method_name);
+  get_arg_types_method = PyObject_GetAttrString
+    (py_worker, (char *) get_arg_types_method_name);
   if (get_arg_types_method == NULL)
     {
       gdbpy_print_stack ();

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-04 21:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04 18:05 [PATCH] Fix py-xmethods.c when compiled with -Werror against Python 2.4 Siva Chandra
2014-06-04 18:13 ` Joel Brobecker
2014-06-04 18:25   ` Siva Chandra
2014-06-04 19:24     ` Joel Brobecker
2014-06-04 19:23   ` Doug Evans
2014-06-04 19:57 ` Pedro Alves
2014-06-04 20:53   ` Siva Chandra
2014-06-04 21:06     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox