Re: [patchv3 0/8] Validate binary before use

Pedro Alves
2014-03-10T14:27:45Z

On 03/08/2014 05:33 PM, Jan Kratochvil wrote:
> On Mon, 03 Mar 2014 14:27:14 +0100, Pedro Alves wrote:
>> On 03/02/2014 06:36 PM, Jan Kratochvil wrote:
>>>> BTW, do you plan on contributing support for validation with cores too?
>>>
>>> No.
>>
>> OK. I think it'd be useful, so that GDB can warn/reject in the
>> common scenario of the user not pointing at a sysroot with the
>> correct DSOs.
>
> Yes, may extensions would be useful.

> The question is if it should be a blocker for this patch series.

Not at all, IMO. I was just really asking whether that was
already in the works. If not, fine, it's still forward progress
without it.

>> Thanks. I think that feature may be a little beyond borderline
>> for that project page though, as core loading is not really part
>> of the native target. IMO it'd good if this had its own project
>> page, where it'd give answer to questions like the below.
>
> Created:
> https://sourceware.org/gdb/wiki/GDBserverCoreFiles
> And removed it from:
> https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity?action=diff&rev2=57&rev1=56

Thanks.

>
>
>> #0 - If implemented by gdbserver, it seems like it'd involve further user
>> action to trigger the feature? How does one tell GDB/gdbserver to load the
>> ore on the remote side rather than locally?
>
> I did not think more about it as I have never started that project.
>
> The basic functionality would be:
> $ gdbserver -c :1234 corefile
> $ gdb executable
> (gdb) target remote :1234
> And if I did not forget anything it could work.

Yeah. I was more thinking of (persistent) extended-remote, like:

$ gdbserver --multi :1234
$ gdb
(gdb) target extended-remote :1234
(gdb) ???

Just "core COREFILE" at that point currently makes GDB disconnect
from the remote, and load the core itself (on the host). Ideally
we'd have some way to tell GDB we actually want to load the core on
the currently connected remote end. I guess a new knob ('set core
host/target/auto'), plus a new option to the "core" command,
like "core -target" or some such. Seems doable.

--
Pedro Alves