public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gmp's c++ interface / mpz_class
@ 2022-10-14 18:11 Pedro Alves
  2022-10-14 20:42 ` Pedro Alves
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pedro Alves @ 2022-10-14 18:11 UTC (permalink / raw)
  To: gdb; +Cc: Zaric, Zoran (Zare)

Hi!

Zoran and I found a potential need for an integer type with precision of 64-bit + 8-bit, in order to
store bit offsets that can span a whole 64-bits address space.  Instead of rolling our own,
I guess it makes sense to use libgmp, since, well, we already depend on it.  I see that we have:

 /* A class to make it easier to use GMP's mpz_t values within GDB.  */

 struct gdb_mpz
 {

In gdb/gmp-utils.h.  However, we need do to arithmetic on the type, and this wrapper
type doesn't implement operator+, operator-, etc, etc.  I guess we could add those,
as wrappers around mpz_add, etc.  Or use raw mpz_add, etc. directly.  However, I just found
out that GMP already has its own C++ interface:

 https://gmplib.org/manual/C_002b_002b-Interface-General

Before we explore this further, is there an already known reason we shouldn't be using
that interface?

Pedro Alves

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

end of thread, other threads:[~2022-10-24 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 18:11 gmp's c++ interface / mpz_class Pedro Alves
2022-10-14 20:42 ` Pedro Alves
2022-10-19 10:28   ` Florian Weimer
2022-10-17 10:44 ` Luis Machado
2022-10-17 11:29   ` Pedro Alves
2022-10-17 17:21 ` Tom Tromey
2022-10-24 13:34   ` Joel Brobecker

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).