Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 3/3] bitpos: Minor python changes for bitpos expansion
@ 2012-08-04 19:24 Siddhesh Poyarekar
  2012-08-10 16:59 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Siddhesh Poyarekar @ 2012-08-04 19:24 UTC (permalink / raw)
  To: gdb-patches

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

Hi,

This is the final (and the smallest) patch in the bitpos expansion
changes. This patch changes python-types code to use
PyLong_FromLongLong for bitpos and type.length.

I have verified that there are not regressions in the testsuite as a
result of this patch.

Regards,
Siddhesh

gdb/ChangeLog

2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>

	* python/py-type.c (convert_field): Use PyLong_FromLongLong for
	TYPE_FIELD_BITPOS.
	(typy_get_sizeof): Likewise for TYPE_LENGTH.

[-- Attachment #2: bitpos-expand-python.patch --]
[-- Type: text/x-patch, Size: 618 bytes --]

diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 98030a6..afb8b72 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -176,7 +176,7 @@ convert_field (struct type *type, int field)
 	}
       else
 	{
-	  arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field));
+	  arg = PyLong_FromLongLong (TYPE_FIELD_BITPOS (type, field));
 	  attrstring = "bitpos";
 	}
 
@@ -683,7 +683,7 @@ typy_get_sizeof (PyObject *self, void *closure)
     }
   /* Ignore exceptions.  */
 
-  return PyLong_FromLong (TYPE_LENGTH (type));
+  return PyLong_FromLongLong (TYPE_LENGTH (type));
 }
 
 static struct type *

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

* Re: [PATCH 3/3] bitpos: Minor python changes for bitpos expansion
  2012-08-04 19:24 [PATCH 3/3] bitpos: Minor python changes for bitpos expansion Siddhesh Poyarekar
@ 2012-08-10 16:59 ` Tom Tromey
  2012-08-10 18:58   ` Siddhesh Poyarekar
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2012-08-10 16:59 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: gdb-patches

>>>>> "Siddhesh" == Siddhesh Poyarekar <siddhesh@redhat.com> writes:

Siddhesh> This is the final (and the smallest) patch in the bitpos expansion
Siddhesh> changes. This patch changes python-types code to use
Siddhesh> PyLong_FromLongLong for bitpos and type.length.

Siddhesh> -	  arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field));
Siddhesh> +	  arg = PyLong_FromLongLong (TYPE_FIELD_BITPOS (type, field));

I think this patch should use gdb_py_long_from_longest in both spots.
See python-internal.h.

Other than that, this is fine.
I think it could go in any time, it doesn't seem dependent on the main
patch.

Tom


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

* Re: [PATCH 3/3] bitpos: Minor python changes for bitpos expansion
  2012-08-10 16:59 ` Tom Tromey
@ 2012-08-10 18:58   ` Siddhesh Poyarekar
  2012-08-10 20:42     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Siddhesh Poyarekar @ 2012-08-10 18:58 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Fri, 10 Aug 2012 10:58:56 -0600, Tom wrote:
> I think this patch should use gdb_py_long_from_longest in both spots.
> See python-internal.h.
> 
> Other than that, this is fine.
> I think it could go in any time, it doesn't seem dependent on the main
> patch.
> 

Thanks, I've pushed the patch with the change you've asked for - sorry
about it too, since you had told me about that function in an earlier
change and I had managed to forget about it.

Regards,
Siddhesh


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

* Re: [PATCH 3/3] bitpos: Minor python changes for bitpos expansion
  2012-08-10 18:58   ` Siddhesh Poyarekar
@ 2012-08-10 20:42     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2012-08-10 20:42 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: gdb-patches

>>>>> "Siddhesh" == Siddhesh Poyarekar <siddhesh@redhat.com> writes:

Siddhesh> Thanks, I've pushed the patch with the change you've asked for - sorry
Siddhesh> about it too, since you had told me about that function in an earlier
Siddhesh> change and I had managed to forget about it.

No worries.
In case it helps, I don't even remember that happening :-)

Tom


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

end of thread, other threads:[~2012-08-10 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-04 19:24 [PATCH 3/3] bitpos: Minor python changes for bitpos expansion Siddhesh Poyarekar
2012-08-10 16:59 ` Tom Tromey
2012-08-10 18:58   ` Siddhesh Poyarekar
2012-08-10 20:42     ` Tom Tromey

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