Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: make GNU v3 ABI the default C++ ABI
@ 2013-01-08 16:41 Tom Tromey
  2013-01-09  1:55 ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2013-01-08 16:41 UTC (permalink / raw)
  To: gdb-patches

This patch makes the GNU v3 ABI the default ABI.

This has been the default ABI for g++ since November 2000.
I think it is long past time for gdb to assume this.
Anybody still using the v2 ABI can still set it explicitly.

This doesn't usually matter, due to the hack in minsyms.c, but it can be
seen if you happen to run gdb on a C++ object without any minsyms.

Built and regtested on x86-64 Fedora 16.

Tom

	* gnu-v2-abi.c (_initialize_gnu_v2_abi): Don't set default ABI.
	* gnu-v3-abi.c (_initialize_gnu_v3_abi): Set default ABI.
	* minsyms.c (install_minimal_symbols): Don't check for _Z symbols.
---
 gdb/gnu-v2-abi.c |    1 -
 gdb/gnu-v3-abi.c |    1 +
 gdb/minsyms.c    |   23 -----------------------
 3 files changed, 1 insertions(+), 24 deletions(-)

diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index 4a600d3..c17955a 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -423,5 +423,4 @@ _initialize_gnu_v2_abi (void)
 {
   init_gnuv2_ops ();
   register_cp_abi (&gnu_v2_abi_ops);
-  set_cp_abi_as_auto_default (gnu_v2_abi_ops.shortname);
 }
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index aef5ae0..641b2b1 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1134,4 +1134,5 @@ _initialize_gnu_v3_abi (void)
   init_gnuv3_ops ();
 
   register_cp_abi (&gnu_v3_abi_ops);
+  set_cp_abi_as_auto_default (gnu_v3_abi_ops.shortname);
 }
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 8a90668..779b9f9 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1240,29 +1240,6 @@ install_minimal_symbols (struct objfile *objfile)
       objfile->minimal_symbol_count = mcount;
       objfile->msymbols = msymbols;
 
-      /* Try to guess the appropriate C++ ABI by looking at the names 
-	 of the minimal symbols in the table.  */
-      {
-	int i;
-
-	for (i = 0; i < mcount; i++)
-	  {
-	    /* If a symbol's name starts with _Z and was successfully
-	       demangled, then we can assume we've found a GNU v3 symbol.
-	       For now we set the C++ ABI globally; if the user is
-	       mixing ABIs then the user will need to "set cp-abi"
-	       manually.  */
-	    const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);
-
-	    if (name[0] == '_' && name[1] == 'Z'
-		&& SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)
-	      {
-		set_cp_abi_as_auto_default ("gnu-v3");
-		break;
-	      }
-	  }
-      }
-
       /* Now build the hash tables; we can't do this incrementally
          at an earlier point since we weren't finished with the obstack
 	 yet.  (And if the msymbol obstack gets moved, all the internal
-- 
1.7.7.6


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

* Re: RFC: make GNU v3 ABI the default C++ ABI
  2013-01-08 16:41 RFC: make GNU v3 ABI the default C++ ABI Tom Tromey
@ 2013-01-09  1:55 ` Yao Qi
  2013-01-09 17:25   ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2013-01-09  1:55 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 01/09/2013 12:41 AM, Tom Tromey wrote:
> This patch makes the GNU v3 ABI the default ABI.

We need a NEWS entry for this change, IMO.

-- 
Yao (齐尧)


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

* Re: RFC: make GNU v3 ABI the default C++ ABI
  2013-01-09  1:55 ` Yao Qi
@ 2013-01-09 17:25   ` Tom Tromey
  2013-01-09 17:56     ` Eli Zaretskii
  2013-01-21 17:16     ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Tromey @ 2013-01-09 17:25 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

Tom> This patch makes the GNU v3 ABI the default ABI.

Yao> We need a NEWS entry for this change, IMO.

Here's an updated patch.

This one needs a doc review.

Tom

	* gnu-v2-abi.c (_initialize_gnu_v2_abi): Don't set default ABI.
	* gnu-v3-abi.c (_initialize_gnu_v3_abi): Set default ABI.
	* minsyms.c (install_minimal_symbols): Don't check for _Z symbols.
	* NEWS: Update.
---
 gdb/NEWS         |    3 +++
 gdb/gnu-v2-abi.c |    1 -
 gdb/gnu-v3-abi.c |    1 +
 gdb/minsyms.c    |   23 -----------------------
 4 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index 75a2119..191f726 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -44,6 +44,9 @@ Lynx 178 PowerPC		powerpc-*-lynx*178
 * The 'cd' command now defaults to using '~' (the home directory) if not
   given an argument.
 
+* The C++ ABI now defaults to the GNU v3 ABI.  This has been the
+  default for GCC since November 2000.
+
 * The command 'forward-search' can now be abbreviated as 'fo'.
 
 * The command 'info tracepoints' can now display 'installed on target'
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index 4a600d3..c17955a 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -423,5 +423,4 @@ _initialize_gnu_v2_abi (void)
 {
   init_gnuv2_ops ();
   register_cp_abi (&gnu_v2_abi_ops);
-  set_cp_abi_as_auto_default (gnu_v2_abi_ops.shortname);
 }
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index aef5ae0..641b2b1 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1134,4 +1134,5 @@ _initialize_gnu_v3_abi (void)
   init_gnuv3_ops ();
 
   register_cp_abi (&gnu_v3_abi_ops);
+  set_cp_abi_as_auto_default (gnu_v3_abi_ops.shortname);
 }
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 8a90668..779b9f9 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1240,29 +1240,6 @@ install_minimal_symbols (struct objfile *objfile)
       objfile->minimal_symbol_count = mcount;
       objfile->msymbols = msymbols;
 
-      /* Try to guess the appropriate C++ ABI by looking at the names 
-	 of the minimal symbols in the table.  */
-      {
-	int i;
-
-	for (i = 0; i < mcount; i++)
-	  {
-	    /* If a symbol's name starts with _Z and was successfully
-	       demangled, then we can assume we've found a GNU v3 symbol.
-	       For now we set the C++ ABI globally; if the user is
-	       mixing ABIs then the user will need to "set cp-abi"
-	       manually.  */
-	    const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);
-
-	    if (name[0] == '_' && name[1] == 'Z'
-		&& SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)
-	      {
-		set_cp_abi_as_auto_default ("gnu-v3");
-		break;
-	      }
-	  }
-      }
-
       /* Now build the hash tables; we can't do this incrementally
          at an earlier point since we weren't finished with the obstack
 	 yet.  (And if the msymbol obstack gets moved, all the internal
-- 
1.7.7.6


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

* Re: RFC: make GNU v3 ABI the default C++ ABI
  2013-01-09 17:25   ` Tom Tromey
@ 2013-01-09 17:56     ` Eli Zaretskii
  2013-01-21 17:16     ` Tom Tromey
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2013-01-09 17:56 UTC (permalink / raw)
  To: Tom Tromey; +Cc: yao, gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Cc: <gdb-patches@sourceware.org>
> Date: Wed, 09 Jan 2013 10:25:21 -0700
> 
> Tom> This patch makes the GNU v3 ABI the default ABI.
> 
> Yao> We need a NEWS entry for this change, IMO.
> 
> Here's an updated patch.
> 
> This one needs a doc review.

The NEWS entry is OK, thanks.


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

* Re: RFC: make GNU v3 ABI the default C++ ABI
  2013-01-09 17:25   ` Tom Tromey
  2013-01-09 17:56     ` Eli Zaretskii
@ 2013-01-21 17:16     ` Tom Tromey
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2013-01-21 17:16 UTC (permalink / raw)
  To: gdb-patches

Tom> 	* gnu-v2-abi.c (_initialize_gnu_v2_abi): Don't set default ABI.
Tom> 	* gnu-v3-abi.c (_initialize_gnu_v3_abi): Set default ABI.
Tom> 	* minsyms.c (install_minimal_symbols): Don't check for _Z symbols.
Tom> 	* NEWS: Update.

I'm checking this in now.

Tom


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

end of thread, other threads:[~2013-01-21 17:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-08 16:41 RFC: make GNU v3 ABI the default C++ ABI Tom Tromey
2013-01-09  1:55 ` Yao Qi
2013-01-09 17:25   ` Tom Tromey
2013-01-09 17:56     ` Eli Zaretskii
2013-01-21 17:16     ` Tom Tromey

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