* [rfa] Use SYMBOL_SET_NAMES in hpread
@ 2004-02-16 21:21 Daniel Jacobowitz
2004-02-16 21:27 ` Daniel Jacobowitz
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-02-16 21:21 UTC (permalink / raw)
To: gdb-patches; +Cc: mec.gnu
Make hpread use SYMBOL_SET_NAMES. It contained some fallback code to
use the debug info if demangling failed; I've disabled it, because from
the description it sounds like the right thing to do would be to fix
the demangler instead. I can't tell whether the code is currently used
or not, so I would appreciate HP/UX testing for this patch.
Michael, could you do that, please?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-16 Daniel Jacobowitz <drow@mvista.com>
* hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
and rely on the demangler.
--- hpread.c 7 Feb 2004 23:13:47 -0000 1.45
+++ hpread.c 15 Feb 2004 23:56:30 -0000
@@ -5096,6 +5093,7 @@ hpread_process_one_debug_symbol (union d
struct symbol *sym;
struct context_stack *new;
char *class_scope_name;
+ char *set_name;
/* Allocate one GDB debug symbol and fill in some default values. */
@@ -5278,37 +5277,25 @@ hpread_process_one_debug_symbol (union d
if ((dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
dn_bufp->dfunc.alias && /* has an alias */
*(char *) (VT (objfile) + dn_bufp->dfunc.alias)) /* not a null string */
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias;
+ set_name = VT (objfile) + dn_bufp->dfunc.alias;
else
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+ set_name = VT (objfile) + dn_bufp->dfunc.name;
/* Special hack to get around HP compilers' insistence on
* reporting "main" as "_MAIN_" for C/C++ */
- if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) &&
+ if ((strcmp (set_name, "_MAIN_") == 0) &&
(strcmp (VT (objfile) + dn_bufp->dfunc.name, "main") == 0))
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+ set_name = VT (objfile) + dn_bufp->dfunc.name;
- /* The SYMBOL_CPLUS_DEMANGLED_NAME field is expected to
- * be the demangled name.
- */
+ SYMBOL_SET_NAMES (sym, set_name, strlen (set_name), objfile);
+#if 0
+ /* NOTE drow/2004-02-08: The following code is terribly bogus. The
+ demangler should be fixed instead. */
if (dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS)
{
- /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
- * calling the demangler in libiberty (cplus_demangle()) to
- * do the job. This generally does the job, even though
- * it's intended for the GNU compiler and not the aCC compiler
- * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
- * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
- * Generally, we don't want params when we display
- * a demangled name, but when I took out the DMGL_PARAMS,
- * some things broke, so I'm leaving it in here, and
- * working around the issue in stack.c. - RT
- */
- SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->objfile_obstack);
- if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
- (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
+ if (set_name == VT (objfile) + dn_bufp->dfunc.alias
+ && !SYMBOL_CPLUS_DEMANGLED_NAME (sym))
{
-
/* Well, the symbol name is mangled, but the
* demangler in libiberty failed so the demangled
* field is still NULL. Try to
@@ -5334,6 +5321,7 @@ hpread_process_one_debug_symbol (union d
}
}
}
+#endif
/* Add the function symbol to the list of symbols in this blockvector */
if (dn_bufp->dfunc.global)
@@ -5396,36 +5384,25 @@ hpread_process_one_debug_symbol (union d
if ((dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
dn_bufp->ddocfunc.alias && /* has an alias */
*(char *) (VT (objfile) + dn_bufp->ddocfunc.alias)) /* not a null string */
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias;
+ set_name = VT (objfile) + dn_bufp->ddocfunc.alias;
else
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+ set_name = VT (objfile) + dn_bufp->ddocfunc.name;
/* Special hack to get around HP compilers' insistence on
* reporting "main" as "_MAIN_" for C/C++ */
if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) &&
(strcmp (VT (objfile) + dn_bufp->ddocfunc.name, "main") == 0))
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+ set_name = VT (objfile) + dn_bufp->ddocfunc.name;
+ SYMBOL_SET_NAMES (sym, set_name, strlen (set_name), objfile);
+#if 0
+ /* NOTE drow/2004-02-08: The following code is terribly bogus. The
+ demangler should be fixed instead. */
if (dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS)
{
-
- /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
- * calling the demangler in libiberty (cplus_demangle()) to
- * do the job. This generally does the job, even though
- * it's intended for the GNU compiler and not the aCC compiler
- * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
- * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
- * Generally, we don't want params when we display
- * a demangled name, but when I took out the DMGL_PARAMS,
- * some things broke, so I'm leaving it in here, and
- * working around the issue in stack.c. - RT
- */
- SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->objfile_obstack);
-
- if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
- (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
+ if (set_name == VT (objfile) + dn_bufp->ddocfunc.alias
+ && !SYMBOL_CPLUS_DEMANGLED_NAME (sym))
{
-
/* Well, the symbol name is mangled, but the
* demangler in libiberty failed so the demangled
* field is still NULL. Try to
@@ -5451,6 +5428,7 @@ hpread_process_one_debug_symbol (union d
}
}
}
+#endif
/* Add the function symbol to the list of symbols in this blockvector */
if (dn_bufp->ddocfunc.global)
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
2004-02-16 21:21 [rfa] Use SYMBOL_SET_NAMES in hpread Daniel Jacobowitz
@ 2004-02-16 21:27 ` Daniel Jacobowitz
0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-02-16 21:27 UTC (permalink / raw)
To: gdb-patches; +Cc: mec.gnu
On Mon, Feb 16, 2004 at 04:21:09PM -0500, Daniel Jacobowitz wrote:
> Make hpread use SYMBOL_SET_NAMES. It contained some fallback code to
> use the debug info if demangling failed; I've disabled it, because from
> the description it sounds like the right thing to do would be to fix
> the demangler instead. I can't tell whether the code is currently used
> or not, so I would appreciate HP/UX testing for this patch.
>
> Michael, could you do that, please?
I apologize, the diff was corrupted.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-16 Daniel Jacobowitz <drow@mvista.com>
* hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
and rely on the demangler.
--- hpread.c 7 Feb 2004 23:13:47 -0000 1.45
+++ hpread.c 15 Feb 2004 23:56:30 -0000
@@ -5096,5 +5093,6 @@ hpread_process_one_debug_symbol (union d
struct symbol *sym;
struct context_stack *new;
char *class_scope_name;
+ char *set_name;
/* Allocate one GDB debug symbol and fill in some default values. */
@@ -5278,37 +5277,25 @@ hpread_process_one_debug_symbol (union d
if ((dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
dn_bufp->dfunc.alias && /* has an alias */
*(char *) (VT (objfile) + dn_bufp->dfunc.alias)) /* not a null string */
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias;
+ set_name = VT (objfile) + dn_bufp->dfunc.alias;
else
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+ set_name = VT (objfile) + dn_bufp->dfunc.name;
/* Special hack to get around HP compilers' insistence on
* reporting "main" as "_MAIN_" for C/C++ */
- if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) &&
+ if ((strcmp (set_name, "_MAIN_") == 0) &&
(strcmp (VT (objfile) + dn_bufp->dfunc.name, "main") == 0))
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+ set_name = VT (objfile) + dn_bufp->dfunc.name;
- /* The SYMBOL_CPLUS_DEMANGLED_NAME field is expected to
- * be the demangled name.
- */
+ SYMBOL_SET_NAMES (sym, set_name, strlen (set_name), objfile);
+#if 0
+ /* NOTE drow/2004-02-08: The following code is terribly bogus. The
+ demangler should be fixed instead. */
if (dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS)
{
- /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
- * calling the demangler in libiberty (cplus_demangle()) to
- * do the job. This generally does the job, even though
- * it's intended for the GNU compiler and not the aCC compiler
- * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
- * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
- * Generally, we don't want params when we display
- * a demangled name, but when I took out the DMGL_PARAMS,
- * some things broke, so I'm leaving it in here, and
- * working around the issue in stack.c. - RT
- */
- SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->objfile_obstack);
- if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
- (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
+ if (set_name == VT (objfile) + dn_bufp->dfunc.alias
+ && !SYMBOL_CPLUS_DEMANGLED_NAME (sym))
{
-
/* Well, the symbol name is mangled, but the
* demangler in libiberty failed so the demangled
* field is still NULL. Try to
@@ -5334,6 +5321,7 @@ hpread_process_one_debug_symbol (union d
}
}
}
+#endif
/* Add the function symbol to the list of symbols in this blockvector */
if (dn_bufp->dfunc.global)
@@ -5396,36 +5384,25 @@ hpread_process_one_debug_symbol (union d
if ((dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
dn_bufp->ddocfunc.alias && /* has an alias */
*(char *) (VT (objfile) + dn_bufp->ddocfunc.alias)) /* not a null string */
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias;
+ set_name = VT (objfile) + dn_bufp->ddocfunc.alias;
else
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+ set_name = VT (objfile) + dn_bufp->ddocfunc.name;
/* Special hack to get around HP compilers' insistence on
* reporting "main" as "_MAIN_" for C/C++ */
if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) &&
(strcmp (VT (objfile) + dn_bufp->ddocfunc.name, "main") == 0))
- DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+ set_name = VT (objfile) + dn_bufp->ddocfunc.name;
+ SYMBOL_SET_NAMES (sym, set_name, strlen (set_name), objfile);
+#if 0
+ /* NOTE drow/2004-02-08: The following code is terribly bogus. The
+ demangler should be fixed instead. */
if (dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS)
{
-
- /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
- * calling the demangler in libiberty (cplus_demangle()) to
- * do the job. This generally does the job, even though
- * it's intended for the GNU compiler and not the aCC compiler
- * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
- * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
- * Generally, we don't want params when we display
- * a demangled name, but when I took out the DMGL_PARAMS,
- * some things broke, so I'm leaving it in here, and
- * working around the issue in stack.c. - RT
- */
- SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->objfile_obstack);
-
- if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
- (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
+ if (set_name == VT (objfile) + dn_bufp->ddocfunc.alias
+ && !SYMBOL_CPLUS_DEMANGLED_NAME (sym))
{
-
/* Well, the symbol name is mangled, but the
* demangler in libiberty failed so the demangled
* field is still NULL. Try to
@@ -5451,6 +5428,7 @@ hpread_process_one_debug_symbol (union d
}
}
}
+#endif
/* Add the function symbol to the list of symbols in this blockvector */
if (dn_bufp->ddocfunc.global)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
@ 2004-02-16 21:40 Michael Elizabeth Chastain
2004-02-16 21:51 ` Elena Zannoni
0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-16 21:40 UTC (permalink / raw)
To: drow, gdb-patches; +Cc: mec.gnu
> Michael, could you do that, please?
Yup. I will test this with hp ansi c and hp ac++.
Michael C
2004-02-16 Daniel Jacobowitz <drow@mvista.com>
* hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
and rely on the demangler.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
2004-02-16 21:40 Michael Elizabeth Chastain
@ 2004-02-16 21:51 ` Elena Zannoni
0 siblings, 0 replies; 8+ messages in thread
From: Elena Zannoni @ 2004-02-16 21:51 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: drow, gdb-patches
Michael Elizabeth Chastain writes:
> > Michael, could you do that, please?
>
> Yup. I will test this with hp ansi c and hp ac++.
>
you should test Daniel's other change to hpread as well.
elena
> Michael C
>
> 2004-02-16 Daniel Jacobowitz <drow@mvista.com>
>
> * hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
> and rely on the demangler.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
@ 2004-02-16 22:04 Michael Elizabeth Chastain
2004-02-16 22:11 ` Elena Zannoni
0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-16 22:04 UTC (permalink / raw)
To: ezannoni, mec.gnu; +Cc: drow, gdb-patches
> you should test Daniel's other change to hpread as well.
Err, did I skip over something? I thought this change was the
only change after Daniel broke up his composite patch.
Michael C
> 2004-02-16 Daniel Jacobowitz <drow@mvista.com>
>
> * hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
> and rely on the demangler.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
2004-02-16 22:04 Michael Elizabeth Chastain
@ 2004-02-16 22:11 ` Elena Zannoni
0 siblings, 0 replies; 8+ messages in thread
From: Elena Zannoni @ 2004-02-16 22:11 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: ezannoni, drow, gdb-patches
Michael Elizabeth Chastain writes:
> > you should test Daniel's other change to hpread as well.
>
> Err, did I skip over something? I thought this change was the
> only change after Daniel broke up his composite patch.
>
there are 2 changes to hpread.c one that removed the
EPRECATED_SYMBOL_NAME uses (this one) and the other: [rfa] Remove
add_psymbol_with_dem_name_to_list and uses, which changes/eliminates
some calls.
elena
> Michael C
>
> > 2004-02-16 Daniel Jacobowitz <drow@mvista.com>
> >
> > * hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
> > and rely on the demangler.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
@ 2004-02-17 1:35 Michael Elizabeth Chastain
2004-02-17 1:42 ` Daniel Jacobowitz
0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-17 1:35 UTC (permalink / raw)
To: drow, gdb-patches
Alas, this patch didn't work. Here are some of the regressions:
(gdb) break StringTest<wchar_t>::testFunction^M
Internal: global symbol `StringTest<wchar_t>::testFunction(void)' found
in /house/chastain/gdb/s1/gdb/testsuite/gdb.cp/bs15503.cc psymtab but
not in symtab.^M StringTest<wchar_t>::testFunction(void) may be an
inlined function, or may be a template function^M
(if a template, try specifying an instantiation:
StringTest<wchar_t>::testFunction(void)<type>).^M
(gdb) FAIL: gdb.cp/bs15503.exp: break StringTest<wchar_t>::testFunction
print &'dm_type_char_star'^M
$2 = (<text variable, no debug info> *) 0x3648
<dm_type_char_star__FPc>^M
(gdb) FAIL: gdb.cp/cplusfuncs.exp: detect dm_type_char_star
===
2004-02-16 Daniel Jacobowitz <drow@mvista.com>
* hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
and rely on the demangler.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [rfa] Use SYMBOL_SET_NAMES in hpread
2004-02-17 1:35 Michael Elizabeth Chastain
@ 2004-02-17 1:42 ` Daniel Jacobowitz
0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-02-17 1:42 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: gdb-patches
On Mon, Feb 16, 2004 at 08:35:17PM -0500, Michael Chastain wrote:
> Alas, this patch didn't work. Here are some of the regressions:
>
> (gdb) break StringTest<wchar_t>::testFunction^M
> Internal: global symbol `StringTest<wchar_t>::testFunction(void)' found
> in /house/chastain/gdb/s1/gdb/testsuite/gdb.cp/bs15503.cc psymtab but
> not in symtab.^M StringTest<wchar_t>::testFunction(void) may be an
> inlined function, or may be a template function^M
> (if a template, try specifying an instantiation:
> StringTest<wchar_t>::testFunction(void)<type>).^M
> (gdb) FAIL: gdb.cp/bs15503.exp: break StringTest<wchar_t>::testFunction
>
> print &'dm_type_char_star'^M
> $2 = (<text variable, no debug info> *) 0x3648
> <dm_type_char_star__FPc>^M
> (gdb) FAIL: gdb.cp/cplusfuncs.exp: detect dm_type_char_star
>
> ===
>
> 2004-02-16 Daniel Jacobowitz <drow@mvista.com>
>
> * hpread.c (hpread_process_one_debug_symbol): Use SYMBOL_SET_NAMES
> and rely on the demangler.
Thanks. Back to the drawing board on that one; I'll think about it...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-02-17 1:42 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-16 21:21 [rfa] Use SYMBOL_SET_NAMES in hpread Daniel Jacobowitz
2004-02-16 21:27 ` Daniel Jacobowitz
2004-02-16 21:40 Michael Elizabeth Chastain
2004-02-16 21:51 ` Elena Zannoni
2004-02-16 22:04 Michael Elizabeth Chastain
2004-02-16 22:11 ` Elena Zannoni
2004-02-17 1:35 Michael Elizabeth Chastain
2004-02-17 1:42 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox