This is the mail archive of the gdb-patches@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: [patch] Fix warning: Invalid entry in .debug_gdb_scripts section


On 03/16/2017 05:39 PM, Jan Kratochvil wrote:
> On Thu, 16 Mar 2017 18:03:41 +0100, Pedro Alves wrote:
>> I don't think you've supplied enough rationale.
> 
> I forgot to copy-paste prepared:
> 
> /usr/bin/rustc
> Section Headers:
>   [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
>   [15] .debug_gdb_scripts PROGBITS        00000000000008ed 0008ed 000022 00 AMS  0   0  1
> 
> /usr/lib/debug/usr/bin/rustc.debug
> Section Headers:
>   [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
>   [15] .debug_gdb_scripts NOBITS          00000000000008ed 000280 000022 00 AMS  0   0  1
> 

Well, that's just a tool output, not a self-contained
rationale/explanation.  With only that, any reviewer will have to
guess things that you probably have already discovered while
debugging the issue.  Josh said that the script is still loaded
fine.  I guess that's because GDB actually tries to read the script
twice, once from rustc, which succeeds, and another time from
rustc.debug, which runs into a zero'ed script ID type, which is
invalid exactly to catch this type of problems.

>> Shouldn't we be able to load scripts from debug-only sections?
> 
> I agree there is better to use SEC_HAS_CONTENTS, right?

Yes, I think so.

Thanks,
Pedro Alves


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