This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: --enable-targets=all cannot work with bfd?


If gdb still doesn't have some way to handle it, I have a idea on it.

In bfd_check_format_matches, if match_count > 1, mean that there are
more than one bfd_target fit with the file, it will check
"bfd_associated_vector".
static const bfd_target *_bfd_associated_vector[] = {
#ifdef ASSOCIATED_VECS
	ASSOCIATED_VECS,
#endif
	NULL
};
I think we can extend it.
static const bfd_target *_bfd_associated_vector[] = {
#ifdef DEFAULT_VECTOR
	&DEFAULT_VECTOR,
#endif
#ifdef ASSOCIATED_VECS
	ASSOCIATED_VECS,
#endif
	NULL
};

Add a new function set_bfd_associated_vector in there can set the
first member of _bfd_associated_vector.
And add a new cmd in gdb called "set bfd" to set it.
Then, user can set it when he need. Of course, we can post some hint
when he get "File format is ambiguous".

I did a small try on it, it worked OK.

What do you think about it?


Thanks,
Hui

On Tue, Jan 12, 2010 at 15:29, Hui Zhu <teawater@gmail.com> wrote:
> Thanks Jan and Daniel,
>
> For the amd64, I am OK now.
>
> For the arm and mips, I found that because it get more than one
> bfd_target in bfd_check_format_matches. ?I try set arch and set osabi,
> but still cannot handle it. ?Does gdb have some way to handle it?
>
> Best regards,
> Hui
>
> On Mon, Jan 11, 2010 at 17:29, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
>> On Mon, 11 Jan 2010 04:58:46 +0100, Hui Zhu wrote:
>>> $ ../src/configure --disable-sid --disable-rda --disable-binutils
>>> --disable-gas --disable-ld --disable-gprof --enable-targets=all
>>> --enable-64-bits-bfd
>> ? ? ? ? ? ? ? ? ^ typo bits->bit
>>
>> amd64:
>> not in executable format: File format not recognized
>> arm:
>> not in executable format: File format is ambiguous
>>
>> For arm it is something more specific.
>>
>>
>> Regards,
>> Jan
>>
>>
>>> On Mon, Jan 11, 2010 at 11:44, Daniel Jacobowitz <dan@codesourcery.com> wrote:
>>> > On Mon, Jan 11, 2010 at 11:25:05AM +0800, Hui Zhu wrote:
>>> >> What I miss?
>>> >
>>> > Try --enable-64-bit-bfd.
>>> >
>>> > --
>>> > Daniel Jacobowitz
>>> > CodeSourcery
>>> >
>>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]