* Re: RFA: [dwarf2read.c] Avoid using section index if not yet set
[not found] <3AFB90A7.D8F37C43@redhat.com>
2001-05-11 1:10 ` RFA: [dwarf2read.c] Avoid using section index if not yet set Kevin Buettner
@ 2001-05-11 13:38 ` Jim Blandy
2001-05-11 13:58 ` Fernando Nasser
1 sibling, 1 reply; 3+ messages in thread
From: Jim Blandy @ 2001-05-11 13:38 UTC (permalink / raw)
To: Fernando Nasser; +Cc: gdb-patches
This patch is not approved.
At the moment, GDB isn't really designed to read debug info from .o
files. I have no objection to enhancing GDB to provide this support,
but it's ridiculous to try to do it by running GDB, looking to see
where it crashes, and adding `if' statements to keep that code from
being executed.
The author of the patch needs to provide a complete story explaining
how loading .o files will work. In particular, I want to know how
they will provide values for undefined symbols referenced in the .o
file. The absence of a coherent answer to that question is the
underlying cause of the crash this patch attempts to plaster over.
> * dwarf2read.c (new_symbol): Do not attempt to use the section
> index of a symbol if it is not yet set.
>
> Index: dwarf2read.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/dwarf2read.c,v
> retrieving revision 1.24
> diff -c -p -r1.24 dwarf2read.c
> *** dwarf2read.c 2001/04/30 10:30:27 1.24
> --- dwarf2read.c 2001/05/10 23:06:28
> *************** new_symbol (struct die_info *die, struct
> *** 4195,4203 ****
> if (SYMBOL_VALUE_ADDRESS (sym))
> {
> fixup_symbol_section (sym, objfile);
> ! SYMBOL_VALUE_ADDRESS (sym) +=
> ! ANOFFSET (objfile->section_offsets,
> ! SYMBOL_SECTION (sym));
> SYMBOL_CLASS (sym) = LOC_STATIC;
> }
> else
> --- 4195,4204 ----
> if (SYMBOL_VALUE_ADDRESS (sym))
> {
> fixup_symbol_section (sym, objfile);
> ! if (SYMBOL_SECTION (sym) != -1)
> ! SYMBOL_VALUE_ADDRESS (sym) +=
> ! ANOFFSET (objfile->section_offsets,
> ! SYMBOL_SECTION (sym));
> SYMBOL_CLASS (sym) = LOC_STATIC;
> }
> else
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFA: [dwarf2read.c] Avoid using section index if not yet set
2001-05-11 13:38 ` Jim Blandy
@ 2001-05-11 13:58 ` Fernando Nasser
0 siblings, 0 replies; 3+ messages in thread
From: Fernando Nasser @ 2001-05-11 13:58 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb-patches
Jim Blandy wrote:
>
> This patch is not approved.
>
> At the moment, GDB isn't really designed to read debug info from .o
> files. I have no objection to enhancing GDB to provide this support,
> but it's ridiculous to try to do it by running GDB, looking to see
> where it crashes, and adding `if' statements to keep that code from
> being executed.
>
> The author of the patch needs to provide a complete story explaining
> how loading .o files will work. In particular, I want to know how
> they will provide values for undefined symbols referenced in the .o
> file. The absence of a coherent answer to that question is the
> underlying cause of the crash this patch attempts to plaster over.
>
Thank you Jim. I did not have the necessary knowledge to appraise this
contributed patch. I will get back to the originator and ask for more
details.
Reagrds,
Fernando
> > * dwarf2read.c (new_symbol): Do not attempt to use the section
> > index of a symbol if it is not yet set.
> >
> > Index: dwarf2read.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/dwarf2read.c,v
> > retrieving revision 1.24
> > diff -c -p -r1.24 dwarf2read.c
> > *** dwarf2read.c 2001/04/30 10:30:27 1.24
> > --- dwarf2read.c 2001/05/10 23:06:28
> > *************** new_symbol (struct die_info *die, struct
> > *** 4195,4203 ****
> > if (SYMBOL_VALUE_ADDRESS (sym))
> > {
> > fixup_symbol_section (sym, objfile);
> > ! SYMBOL_VALUE_ADDRESS (sym) +=
> > ! ANOFFSET (objfile->section_offsets,
> > ! SYMBOL_SECTION (sym));
> > SYMBOL_CLASS (sym) = LOC_STATIC;
> > }
> > else
> > --- 4195,4204 ----
> > if (SYMBOL_VALUE_ADDRESS (sym))
> > {
> > fixup_symbol_section (sym, objfile);
> > ! if (SYMBOL_SECTION (sym) != -1)
> > ! SYMBOL_VALUE_ADDRESS (sym) +=
> > ! ANOFFSET (objfile->section_offsets,
> > ! SYMBOL_SECTION (sym));
> > SYMBOL_CLASS (sym) = LOC_STATIC;
> > }
> > else
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFA: [dwarf2read.c] Avoid using section index if not yet set
[not found] <3AFB90A7.D8F37C43@redhat.com>
@ 2001-05-11 1:10 ` Kevin Buettner
2001-05-11 13:38 ` Jim Blandy
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2001-05-11 1:10 UTC (permalink / raw)
To: Fernando Nasser, gdb-patches, Jim Blandy, Elena Zannoni
On May 11, 3:11am, Fernando Nasser wrote:
> This fix was suggested to me by someone that loads symbols from object
> files. It seems that in this situation the section index may not be set
> and this bit of code tries to use it.
>
> I this fix correct? Can I check it in?
IMO, no. I think it would be better to figure out why (and where) the
section index isn't getting set.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-05-11 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <3AFB90A7.D8F37C43@redhat.com>
2001-05-11 1:10 ` RFA: [dwarf2read.c] Avoid using section index if not yet set Kevin Buettner
2001-05-11 13:38 ` Jim Blandy
2001-05-11 13:58 ` Fernando Nasser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox