[PATCH v3] Add helper script for glibc debugging
Carlos O'Donell
carlos@redhat.com
Fri Sep 27 21:39:00 GMT 2019
On 9/27/19 5:30 PM, Gabriel F. T. Gomes wrote:
> On Fri, 27 Sep 2019, Carlos O'Donell wrote:
>
>> On 9/27/19 3:44 PM, Gabriel F. T. Gomes wrote:
>>
>> Almost! Thank you for working through this, I think the script will be
>> really useful for new and old people... I always have to retype this
>>from the wiki ;}
>
> Thank you!
>
>>> +run --library-path $(rpath-link):$${BUILD_DIR}/nptl_db \
>>> +__TESTCASE__ __DIRECT__
>>
>> OK, run the loader directly.
>
> And the loader runs the test case (see updated comment suggestion below).
>
>>
>> [...]
>>
>>> +# We need to make sure that gdb is linked against the standalone glibc
>>> +# so that it picks up the correct nptl_db/libthread_db.so. So that means
>>> +# invoking gdb using the standalone glibc's linker and passing nptl_db
>>> +# in the argument to --library-path.
>>
>> This comment is no longer correct. We should remove it or rewrite it.
>
> How about:
>
> # Start the test case debugging in two steps:
> # 1. the following command invokes gdb to run the loader;
> # 2. the commands file tells the loader to run the test case.
>>> +gdb -q \
>>> + -x $${CMD_FILE} \
>>> + -d $${SOURCE_DIR} \
>>> + $${BUILD_DIR}/elf/ld.so
>
>> Suggest:
>>
>> echo "Env vars: $$ENVVARS"
>
> Yes, I like this, too.
>
>> Did you test the script with --enalbe-hardcoded-path-in-tests also? ;}
>
> I actually did (with and without it), then I ran both stdlib/tst-strfrom
> and nptl/tst-exec1, and everything seemed to work OK. Have you noticed
> anything weird?
>
> Should I send a v4?
Yes please, send v4, and I'll ack that.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list