pspace != NULL failed assertion on ppc-aix
This patch fixes the following problem:
% 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)
The problem happens when we try to get the program space from
a minimal symbol. For that, we go through the minimal symbol's
obj_section->objfile->pspace. But the minimal symbol's obj_section
is not set, and thus we somehow get a NULL program space. And
the reason why the obj_section is not set is because the XCOFF
reader did not pass the bfd_section when calling minsyms.c's
prim_record_minimal_symbol_and_info.
gdb/ChangeLog:
* xcoffread.c (xcoff_secnum_to_sections): New function.
(secnum_to_section, secnum_to_bfd_section): Reimplement
using xcoff_secnum_to_sections. Rename "secnum" parameter
into "n_scnum".
(RECORD_MINIMAL_SYMBOL): Delete.
(record_minimal_symbol): New function.
(scan_xcoff_symtab): Replace uses of RECORD_MINIMAL_SYMBOL
by call to record_minimal_symbol and set misc_func_recorded
to 1. Set last_csect_sec to the XCOFF section index instead
of GDB's section_offset index. Update calls to
prim_record_minimal_symbol_and_info to pass the BFD section
as well.