This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix gdb.base/shreloc.exp: (msymbol) relocated functions have different addresses fail in cygwin
- From: Hui Zhu <teawater at gmail dot com>
- To: Hui Zhu <hui_zhu at mentor dot com>
- Cc: Yao Qi <yao at codesourcery dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Mon, 7 Oct 2013 17:27:33 +0800
- Subject: Re: [PATCH] Fix gdb.base/shreloc.exp: (msymbol) relocated functions have different addresses fail in cygwin
- Authentication-results: sourceware.org; auth=none
- References: <CANFwon0RVVQKLg2Ffm+TWQSKrJRTTtZ-573iJQ_T_HWMrm1hGQ at mail dot gmail dot com> <522DD104 dot 6090808 at codesourcery dot com> <CANFwon3Xny3nWLpUumJu2cuwy7vLXkGa+cEVSV1+AHmAZ66WRg at mail dot gmail dot com> <52315FC6 dot 4000005 at mentor dot com> <523163DF dot 3020707 at codesourcery dot com> <52316D0C dot 9000707 at mentor dot com>
Ping.
Thanks,
Hui
On Thu, Sep 12, 2013 at 3:28 PM, Hui Zhu <hui_zhu@mentor.com> wrote:
> Hi Yao,
>
> Thanks for your review.
>
>
> On 09/12/13 14:49, Yao Qi wrote:
>>
>> On 09/12/2013 02:31 PM, Hui Zhu wrote:
>>>
>>> -proc get_msym_addrs { var msymfile } {
>>> +proc get_msym_addrs { var msymfile { plus_var "" } } {
>>
>>
>> 'plus_var' is not good candidate for parameter name. I'd call it 'mst'
>> or 'msym_type'.
>
>
> Fixed.
>
>
>>
>>> # Extract the list of values for symbols matching var in the
>>> # minimal symbol output file
>>>
>>> global gdb_prompt hex
>>> set result ""
>>>
>>> - send_gdb "shell grep -E \" ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"
>>> + if { "${plus_var}" == "" } {
>>> + send_gdb "shell grep -E \" ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"
>>> + } else {
>>> + send_gdb "shell grep -E \" ${plus_var} .* ${var}(\[ \t\]+.*)?\$\"
>>> ${msymfile}\n"
>>> + }
>>
>>
>> This condition checking is not necessary, we can do
>>
>> send_gdb "shell grep -E \"${plus_var} ${var}(\[ \t\]+.*)?\$\"
>> ${msymfile}\n"
>
>
> Because for the output format is: [ 7] T 0x2aaaaacd058a fn_1 section .text
> shreloc1.c
> It need a ".*" after "T". So I change "T" to "T.*" to handle it.
>
> Post a new version according to your comments.
>
> Best,
>
> Hui
>
>
> 2013-09-12 Hui Zhu <hui@codesourcery.com>
>
> * gdb.base/shreloc.exp (get_msym_addrs): Add argument "msym_type".
>
> (check_different): Ditto.
> ((msymbol) relocated functions have different addresses): Add
> argument 'T.*' when call check_different.