Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* What about check the bfd_arch_info before load the solib?
@ 2009-06-30 13:07 Hui Zhu
  2009-07-01  4:11 ` Michael Snyder
  0 siblings, 1 reply; 3+ messages in thread
From: Hui Zhu @ 2009-06-30 13:07 UTC (permalink / raw)
  To: gdb

Hi guys,

In cross-compile remote debug environment, the gdb will load the solib
of local host if user doesn't set sysroot or something.
Load the wrong lib will make gdb get error.

I think maybe we can add some check code to check if the bfd_arch_info
of this solib is same with the current_gdbarch before load this solib
in.
If not same, output a warning to let user set gdb to load right lib.

What do you think about it?

Thanks,
Hui


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

* Re: What about check the bfd_arch_info before load the solib?
  2009-06-30 13:07 What about check the bfd_arch_info before load the solib? Hui Zhu
@ 2009-07-01  4:11 ` Michael Snyder
  2009-07-01  6:55   ` Hui Zhu
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2009-07-01  4:11 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb

Hui Zhu wrote:
> Hi guys,
> 
> In cross-compile remote debug environment, the gdb will load the solib
> of local host if user doesn't set sysroot or something.
> Load the wrong lib will make gdb get error.
> 
> I think maybe we can add some check code to check if the bfd_arch_info
> of this solib is same with the current_gdbarch before load this solib
> in.
> If not same, output a warning to let user set gdb to load right lib.
> 
> What do you think about it?

It would certainly be reasonable to reject an object file (eg. shlib)
if it has the wrong architecture type.  I'm surprised that we don't
already do it.


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

* Re: What about check the bfd_arch_info before load the solib?
  2009-07-01  4:11 ` Michael Snyder
@ 2009-07-01  6:55   ` Hui Zhu
  0 siblings, 0 replies; 3+ messages in thread
From: Hui Zhu @ 2009-07-01  6:55 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb

On Wed, Jul 1, 2009 at 12:08, Michael Snyder<msnyder@vmware.com> wrote:
> Hui Zhu wrote:
>>
>> Hi guys,
>>
>> In cross-compile remote debug environment, the gdb will load the solib
>> of local host if user doesn't set sysroot or something.
>> Load the wrong lib will make gdb get error.
>>
>> I think maybe we can add some check code to check if the bfd_arch_info
>> of this solib is same with the current_gdbarch before load this solib
>> in.
>> If not same, output a warning to let user set gdb to load right lib.
>>
>> What do you think about it?
>
> It would certainly be reasonable to reject an object file (eg. shlib)
> if it has the wrong architecture type.  I'm surprised that we don't
> already do it.

Me too.  I will try to make a patch for it.

Thanks,
Hui


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

end of thread, other threads:[~2009-07-01  6:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-30 13:07 What about check the bfd_arch_info before load the solib? Hui Zhu
2009-07-01  4:11 ` Michael Snyder
2009-07-01  6:55   ` Hui Zhu

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