Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Kris Warkentin" <kewarken@qnx.com>
To: "Daniel Jacobowitz" <drow@mvista.com>
Cc: <gdb@sources.redhat.com>
Subject: Re: gnu-v3-abi.c: problems w/ virtual base class
Date: Wed, 30 Oct 2002 11:59:00 -0000	[thread overview]
Message-ID: <129401c2804e$e25e9910$d8020c0a@catdog> (raw)
In-Reply-To: <20021030192736.GA24291@nevyn.them.org>

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

> The way this works is:
>   - We only care if the symbol starts with _Z.  Do it in the same
> place we check for _Z now, instead of the switch_to_cp_abi call.
>
>   - You just want to call cplus_demangle; be sure to free the result
> if it returns non-NULL.
>

Diff attached.  Seems to work quite nicely.  Thank you very much.  As
always, you are most helpful.

cheers,

Kris

[-- Attachment #2: minsym.diff --]
[-- Type: application/octet-stream, Size: 2339 bytes --]

Index: minsyms.c
===================================================================
RCS file: /product/tools/gdb/gdb/minsyms.c,v
retrieving revision 1.2
diff -c -r1.2 minsyms.c
*** minsyms.c	6 Sep 2002 20:20:43 -0000	1.2
--- minsyms.c	30 Oct 2002 19:52:08 -0000
***************
*** 952,958 ****
  
        /* 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++)
--- 952,958 ----
  
        /* Try to guess the appropriate C++ ABI by looking at the names 
  	 of the minimal symbols in the table.  */
!       if (!current_cp_abi_equals("gnu-v3")) {
  	int i;
  
  	for (i = 0; i < mcount; i++)
***************
*** 960,967 ****
  	    const char *name = SYMBOL_NAME (&objfile->msymbols[i]);
  	    if (name[0] == '_' && name[1] == 'Z')
  	      {
! 		switch_to_cp_abi ("gnu-v3");
! 		break;
  	      }
  	  }
        }
--- 960,971 ----
  	    const char *name = SYMBOL_NAME (&objfile->msymbols[i]);
  	    if (name[0] == '_' && name[1] == 'Z')
  	      {
! 	      	char *demangled;
! 		if((demangled = cplus_demangle(name, GNU_V3_DEMANGLING)) != NULL){
! 			free(demangled);
! 			switch_to_cp_abi ("gnu-v3");
! 			break;
! 		}
  	      }
  	  }
        }
Index: cp-abi.c
===================================================================
RCS file: /product/tools/gdb/gdb/cp-abi.c,v
retrieving revision 1.2
diff -c -r1.2 cp-abi.c
*** cp-abi.c	6 Sep 2002 20:20:42 -0000	1.2
--- cp-abi.c	30 Oct 2002 19:52:08 -0000
***************
*** 107,109 ****
--- 107,115 ----
    return 1;
  }
  
+ int
+ current_cp_abi_equals (const char *short_name)
+ {
+ 	return strcmp(current_cp_abi.shortname, short_name) == 0;
+ }
+ 
Index: cp-abi.h
===================================================================
RCS file: /product/tools/gdb/gdb/cp-abi.h,v
retrieving revision 1.2
diff -c -r1.2 cp-abi.h
*** cp-abi.h	6 Sep 2002 20:20:42 -0000	1.2
--- cp-abi.h	30 Oct 2002 19:52:08 -0000
***************
*** 168,173 ****
--- 168,174 ----
  extern struct cp_abi_ops current_cp_abi;
  extern int register_cp_abi (struct cp_abi_ops abi);
  extern int switch_to_cp_abi (const char *short_name);
+ extern int current_cp_abi_equals (const char *short_name);
  
  #endif
  

  reply	other threads:[~2002-10-30 19:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-30  9:10 Kris Warkentin
2002-10-30  9:20 ` Daniel Jacobowitz
2002-10-30  9:30   ` Kris Warkentin
2002-10-30  9:34     ` Daniel Jacobowitz
2002-10-30  9:46       ` Kris Warkentin
2002-10-30 10:48         ` Kris Warkentin
2002-10-30 11:00           ` Daniel Jacobowitz
2002-10-30 11:19             ` Kris Warkentin
2002-10-30 11:26               ` Daniel Jacobowitz
2002-10-30 11:59                 ` Kris Warkentin [this message]
2002-10-30 11:00           ` Kris Warkentin
2002-10-30 11:07             ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='129401c2804e$e25e9910$d8020c0a@catdog' \
    --to=kewarken@qnx.com \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox