Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: tweak minsyms check for GNU v3 symbols
@ 2003-03-03  3:54 Daniel Jacobowitz
  2003-03-03 14:48 ` Kris Warkentin
  2003-04-03 21:37 ` RFA: " Elena Zannoni
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-03-03  3:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Kris Warkentin

This is based on a patch that Kris Warkentin sent out last October, that's
been sitting in my inbox for a while.  It's a little more efficient but the
idea is the same.  Right now, we consider any _Z symbol to imply GNU v3; but
what we really want is for any _Z symbol _which demangled successfully_ to
imply GNU v3.  _Zero is the QNX example of a false positive for the current
check.  It's still not perfect, but it's much better.

Tested in combination with the "set cp-abi" patch, to make sure it behaved
properly; sure enough:
  - we still get GNU v3 for a v3 application
  - we no longer get GNU v3 for a v2 application containing _Zero (before
    the patch, we did).

Is this OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-03-02  Daniel Jacobowitz  <drow@mvista.com>

	* minsyms.c (install_minimal_symbols): Only switch to gnu-v3 mode
	if the linkage name demangled successfully.

Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.26
diff -u -p -r1.26 minsyms.c
--- minsyms.c	25 Feb 2003 21:36:18 -0000	1.26
+++ minsyms.c	2 Mar 2003 18:38:28 -0000
@@ -918,8 +918,14 @@ install_minimal_symbols (struct objfile 
 
 	for (i = 0; i < mcount; i++)
 	  {
-	    const char *name = DEPRECATED_SYMBOL_NAME (&objfile->msymbols[i]);
-	    if (name[0] == '_' && name[1] == 'Z')
+	    /* 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)
 	      {
 		switch_to_cp_abi ("gnu-v3");
 		break;


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

* Re: tweak minsyms check for GNU v3 symbols
  2003-03-03  3:54 RFA: tweak minsyms check for GNU v3 symbols Daniel Jacobowitz
@ 2003-03-03 14:48 ` Kris Warkentin
  2003-04-03 21:37 ` RFA: " Elena Zannoni
  1 sibling, 0 replies; 4+ messages in thread
From: Kris Warkentin @ 2003-03-03 14:48 UTC (permalink / raw)
  To: Daniel Jacobowitz, gdb-patches

> This is based on a patch that Kris Warkentin sent out last October, that's
> been sitting in my inbox for a while.  It's a little more efficient but
the
> idea is the same.  Right now, we consider any _Z symbol to imply GNU v3;
but
> what we really want is for any _Z symbol _which demangled successfully_ to
> imply GNU v3.  _Zero is the QNX example of a false positive for the
current
> check.  It's still not perfect, but it's much better.

That's a good idea Daniel.  That will help minimize the number of demangle()
calls even futher.

cheers,

Kris


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

* Re: RFA: tweak minsyms check for GNU v3 symbols
  2003-03-03  3:54 RFA: tweak minsyms check for GNU v3 symbols Daniel Jacobowitz
  2003-03-03 14:48 ` Kris Warkentin
@ 2003-04-03 21:37 ` Elena Zannoni
  2003-04-13 15:25   ` Daniel Jacobowitz
  1 sibling, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2003-04-03 21:37 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches, Kris Warkentin

Daniel Jacobowitz writes:
 > This is based on a patch that Kris Warkentin sent out last October, that's
 > been sitting in my inbox for a while.  It's a little more efficient but the
 > idea is the same.  Right now, we consider any _Z symbol to imply GNU v3; but
 > what we really want is for any _Z symbol _which demangled successfully_ to
 > imply GNU v3.  _Zero is the QNX example of a false positive for the current
 > check.  It's still not perfect, but it's much better.
 > 
 > Tested in combination with the "set cp-abi" patch, to make sure it behaved
 > properly; sure enough:
 >   - we still get GNU v3 for a v3 application
 >   - we no longer get GNU v3 for a v2 application containing _Zero (before
 >     the patch, we did).
 > 
 > Is this OK?
 > 


I am back. yey.

approved, sure.

elena


 > -- 
 > Daniel Jacobowitz
 > MontaVista Software                         Debian GNU/Linux Developer
 > 
 > 2003-03-02  Daniel Jacobowitz  <drow@mvista.com>
 > 
 > 	* minsyms.c (install_minimal_symbols): Only switch to gnu-v3 mode
 > 	if the linkage name demangled successfully.
 > 
 > Index: minsyms.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/minsyms.c,v
 > retrieving revision 1.26
 > diff -u -p -r1.26 minsyms.c
 > --- minsyms.c	25 Feb 2003 21:36:18 -0000	1.26
 > +++ minsyms.c	2 Mar 2003 18:38:28 -0000
 > @@ -918,8 +918,14 @@ install_minimal_symbols (struct objfile 
 >  
 >  	for (i = 0; i < mcount; i++)
 >  	  {
 > -	    const char *name = DEPRECATED_SYMBOL_NAME (&objfile->msymbols[i]);
 > -	    if (name[0] == '_' && name[1] == 'Z')
 > +	    /* 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)
 >  	      {
 >  		switch_to_cp_abi ("gnu-v3");
 >  		break;


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

* Re: RFA: tweak minsyms check for GNU v3 symbols
  2003-04-03 21:37 ` RFA: " Elena Zannoni
@ 2003-04-13 15:25   ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-04-13 15:25 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches, Kris Warkentin

On Thu, Apr 03, 2003 at 04:41:44PM -0500, Elena Zannoni wrote:
> Daniel Jacobowitz writes:
>  > This is based on a patch that Kris Warkentin sent out last October, that's
>  > been sitting in my inbox for a while.  It's a little more efficient but the
>  > idea is the same.  Right now, we consider any _Z symbol to imply GNU v3; but
>  > what we really want is for any _Z symbol _which demangled successfully_ to
>  > imply GNU v3.  _Zero is the QNX example of a false positive for the current
>  > check.  It's still not perfect, but it's much better.
>  > 
>  > Tested in combination with the "set cp-abi" patch, to make sure it behaved
>  > properly; sure enough:
>  >   - we still get GNU v3 for a v3 application
>  >   - we no longer get GNU v3 for a v2 application containing _Zero (before
>  >     the patch, we did).
>  > 
>  > Is this OK?
>  > 
> 
> 
> I am back. yey.

Welcome back (belatedly)!

> approved, sure.

Checked in (belatedly).  Here's the updated patch, someone had done
the SYMBOL_LINKAGE_NAME bit already.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-04-13  Daniel Jacobowitz  <drow@mvista.com>

	* minsyms.c (install_minimal_symbols): Only switch to gnu-v3 mode
	if the linkage name demangled successfully.

Index: gdb/minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.29
diff -u -p -r1.29 minsyms.c
--- gdb/minsyms.c	10 Mar 2003 20:40:45 -0000	1.29
+++ gdb/minsyms.c	13 Apr 2003 15:20:28 -0000
@@ -920,8 +920,14 @@ install_minimal_symbols (struct objfile 
 
 	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')
+	    if (name[0] == '_' && name[1] == 'Z'
+		&& SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)
 	      {
 		set_cp_abi_as_auto_default ("gnu-v3");
 		break;


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

end of thread, other threads:[~2003-04-13 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-03  3:54 RFA: tweak minsyms check for GNU v3 symbols Daniel Jacobowitz
2003-03-03 14:48 ` Kris Warkentin
2003-04-03 21:37 ` RFA: " Elena Zannoni
2003-04-13 15:25   ` Daniel Jacobowitz

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