Commit 0347638ccc0fb8bc787a724ea8a421e322872d3c
- Date: Sun Apr 06 23:07:25 +0000 2008
- Committer: Thiago Jung Bauermann (bauerman@br.ibm.com)
- Author: Thiago Jung Bauermann (bauerman@br.ibm.com)
- Commit SHA1: 0347638ccc0fb8bc787a724ea8a421e322872d3c
- Tree SHA1: f8730d18543620229f280fbedfccad72dc118c5e
Enable optimized compilation when using Python 2.4.
Commit diff
| |   |
| 36 | 36 | hooks = PyObject_GetAttrString (gdb_module, "hooks"); |
| 37 | 37 | if (! hooks) |
| 38 | 38 | return NULL; |
| 39 | | if (! PyObject_HasAttrString (hooks, name)) |
| 39 | /* The cast is because the Python function doesn't declare const argument. |
| 40 | This is a problem in Python version 2.4, but not in 2.5. */ |
| 41 | if (! PyObject_HasAttrString (hooks, (char *) name)) |
| 40 | 42 | return NULL; |
| 41 | | return PyObject_GetAttrString (hooks, name); |
| 43 | /* The cast is because the Python function doesn't declare const argument. |
| 44 | This is a problem in Python version 2.4, but not in 2.5. */ |
| 45 | return PyObject_GetAttrString (hooks, (char *) name); |
| 42 | 46 | } |
| 43 | 47 | |
| 44 | 48 | static void |
| toggle raw diff |
--- a/gdb/python/hooks.c
+++ b/gdb/python/hooks.c
@@ -36,9 +36,13 @@ gdbpy_get_hook_function (const char *name)
hooks = PyObject_GetAttrString (gdb_module, "hooks");
if (! hooks)
return NULL;
- if (! PyObject_HasAttrString (hooks, name))
+ /* The cast is because the Python function doesn't declare const argument.
+ This is a problem in Python version 2.4, but not in 2.5. */
+ if (! PyObject_HasAttrString (hooks, (char *) name))
return NULL;
- return PyObject_GetAttrString (hooks, name);
+ /* The cast is because the Python function doesn't declare const argument.
+ This is a problem in Python version 2.4, but not in 2.5. */
+ return PyObject_GetAttrString (hooks, (char *) name);
}
static void |
| |   |
| 480 | 480 | PyObject * |
| 481 | 481 | gdbpy_decode_line (PyObject *self, PyObject *args) |
| 482 | 482 | { |
| 483 | | struct symtabs_and_lines sals; |
| 483 | struct symtabs_and_lines sals = { NULL, 0 }; /* Initialize to appease gcc. */ |
| 484 | 484 | struct symtab_and_line sal; |
| 485 | 485 | char *arg = NULL; |
| 486 | 486 | int free_sals = 0, i; |
| toggle raw diff |
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -480,7 +480,7 @@ gdbpy_solib_address (PyObject *self, PyObject *args)
PyObject *
gdbpy_decode_line (PyObject *self, PyObject *args)
{
- struct symtabs_and_lines sals;
+ struct symtabs_and_lines sals = { NULL, 0 }; /* Initialize to appease gcc. */
struct symtab_and_line sal;
char *arg = NULL;
int free_sals = 0, i; |