Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: bfd_section should not be NULL in call to prim_record_minimal_*
@ 2012-04-16 21:14 Joel Brobecker
  2012-04-16 21:14 ` [RFA/commit 1/2] Unused local variables in xcoffread.c:read_xcoff_symtab Joel Brobecker
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Joel Brobecker @ 2012-04-16 21:14 UTC (permalink / raw)
  To: gdb-patches

Hello,

It seems that creating breakpoints no longer works on ppc-aix:

    % gdb foo
    (gdb) b main
    /[...]/progspace.c:216: internal-error: set_current_program_space: Assertion `pspace != NULL' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

Patch #2 explains what is going on, but basically, xcoffread.c
creates minimal symbols where the obj_section is not set. At first
sight, minsyms.h seems to indicate that it is OK, if you look at
prim_record_minimal_symbol_full's documentation:

   BFD_SECTION - the symbol's BFD section; used to find the
   appropriate obj_section for the minimal symbol.  This can be NULL.
                                                    ^^^^^^^^^^^^^^^^

But I think it is wrong, because I think a lot of places in the GDB code
make the assumption that a minimal symbol's obj_section is not NULL, and
the only way to set it, I think, is to have the BFD section.

So, I think the function documentation should be changed to remove
the permission to pass NULL, and a gdb_assert should also be added
to verify that SYMBOL_OBJ_SECTION (msymbol) != NULL after the
BFD section to obj_section search.

In the meantime, patch #2 fixes the problem by making sure that we
always pass a BFD section.  I haven't tested it against the official
testsuite, I will do so now, but I also wanted to start this discussion
before I forget.


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

end of thread, other threads:[~2012-04-18 15:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 21:14 RFC: bfd_section should not be NULL in call to prim_record_minimal_* Joel Brobecker
2012-04-16 21:14 ` [RFA/commit 1/2] Unused local variables in xcoffread.c:read_xcoff_symtab Joel Brobecker
2012-04-16 21:19   ` [RFA/commit 2/2] pspace != NULL failed assertion on ppc-aix Joel Brobecker
2012-04-18  0:43     ` Joel Brobecker
2012-04-18 10:17       ` Pedro Alves
2012-04-18 14:57         ` Joel Brobecker
2012-04-18 15:13           ` Pedro Alves
2012-04-18  0:32   ` checked in: [RFA/commit 1/2] Unused local variables in xcoffread.c:read_xcoff_symtab Joel Brobecker
2012-04-17 12:03 ` RFC: bfd_section should not be NULL in call to prim_record_minimal_* Tom Tromey
2012-04-17 15:17   ` Joel Brobecker
2012-04-17 15:23     ` Tom Tromey
2012-04-17 23:26       ` Joel Brobecker
2012-04-18 15:01         ` Tom Tromey
2012-04-18  0:24   ` Joel Brobecker
2012-04-17 12:45 ` Pedro Alves
2012-04-17 14:21   ` Tom Tromey
2012-04-17 14:29     ` Pedro Alves

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