public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/python] Fix cpychecker error in pspy_solib_name
@ 2018-10-04 18:08 Tom de Vries
  2018-10-04 22:13 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2018-10-04 18:08 UTC (permalink / raw)
  To: gdb-patches

Hi,

When using cpychecker, we run into:
...
gdb/python/py-progspace.c: \
  In function ‘PyObject* pspy_solib_name(PyObject*, PyObject*)’:
gdb/python/py-progspace.c:370:25: error: Mismatching type in call to \
  PyArg_ParseTuple with format code "K" [-Werror]
   if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc))
  argument 3 ("&pc") had type
    "gdb_py_longest *" (pointing to 64 bits)
  but was expecting
    "long long unsigned int *" (pointing to 64 bits)
  for format code "K"
...

Fix this fixing the type of the variable.

Build and reg-tested on x86_64-linux.

OK for trunk?

Thanks,
- Tom

[gdb/python] Fix cpychecker error in pspy_solib_name

2018-10-04  Tom de Vries  <tdevries@suse.de>

	* python/py-progspace.c (pspy_solib_name): Fix type mismatch in
	PyArg_ParseTuple call.

---
 gdb/python/py-progspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index 1e16b845e0..6395d5bb15 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -362,7 +362,7 @@ static PyObject *
 pspy_solib_name (PyObject *o, PyObject *args)
 {
   char *soname;
-  gdb_py_longest pc;
+  gdb_py_ulongest pc;
   pspace_object *self = (pspace_object *) o;
 
   PSPY_REQUIRE_VALID (self);

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

* Re: [PATCH][gdb/python] Fix cpychecker error in pspy_solib_name
  2018-10-04 18:08 [PATCH][gdb/python] Fix cpychecker error in pspy_solib_name Tom de Vries
@ 2018-10-04 22:13 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2018-10-04 22:13 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> [gdb/python] Fix cpychecker error in pspy_solib_name

Tom> 2018-10-04  Tom de Vries  <tdevries@suse.de>

Tom> 	* python/py-progspace.c (pspy_solib_name): Fix type mismatch in
Tom> 	PyArg_ParseTuple call.

This is ok.  Thanks for doing this.

Tom

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

end of thread, other threads:[~2018-10-04 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 18:08 [PATCH][gdb/python] Fix cpychecker error in pspy_solib_name Tom de Vries
2018-10-04 22:13 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).