public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb/testsuite: Add gdb.base/memops-watchpoint.exp
Date: Mon, 22 Apr 2024 20:04:32 -0300	[thread overview]
Message-ID: <87a5ll2e4f.fsf@linaro.org> (raw)
In-Reply-To: <87wmoq2qid.fsf@linaro.org> (Thiago Jung Bauermann's message of "Sun, 21 Apr 2024 21:24:42 -0300")

Thiago Jung Bauermann <thiago.bauermann@linaro.org> writes:

> Kevin Buettner <kevinb@redhat.com> writes:
>
>> On Sat, 20 Apr 2024 18:33:07 -0300
>> Thiago Jung Bauermann <thiago.bauermann@linaro.org> wrote:
>>
>>> +# It's not possible to check in which libc function the watchpoint triggers
>>> +# without its debug info.
>>> +require libc_has_debug_info
>>
>> I'm wondering about the need for this requirement.  When I comment it
>> out and run it on a machine without libc debuginfo, I do see 3 FAILs,
>> but it seems to me that those could be turned into PASSes by changing
>> the regular expressions for the "continue until..." tests.
>>
>> E.g. for the first one, with libc debuginfo, I see:
>>
>> continue
>> Continuing.
>>
>> Hardware watchpoint 2: -location a[31]
>>
>> Old value = 101 'e'
>> New value = 0 '\000'
>> __memset_avx2_unaligned () at
>> ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:146
>> 146		VMOVU	%VMM(0), (%rdi)
>> (gdb) PASS: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits
>>
>> But, without libc debuginfo, the watchpoint still works:
>>
>> continue
>> Continuing.
>>
>> Hardware watchpoint 2: -location a[31]
>>
>> Old value = 101 'e'
>> New value = 0 '\000'
>> 0x00007ffff7e3553a in __memset_avx2_unaligned () from /lib64/libc.so.6
>> (gdb) FAIL: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits
>>
>> As stated earlier, this could be turned into a PASS by tweaking the RE.
>>
>> In both cases, we know that it's in a "memset" function.  (The presence
>> of minimal symbols provides GDB with this information.)
>
> I added the requirement because in my aarch64-linux system without libc6
> debug info I get:
>
> continue
> Continuing.
>
> Hardware watchpoint 2: -location a[28]
>
> Old value = 104 'h'
> New value = 0 '\000'
> 0x0000fffff7e90664 in ?? () from /lib/aarch64-linux-gnu/libc.so.6
> (gdb) FAIL: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits

<snip>

> So it depends on the system.
>
> One alternative would be to not use the require statement and run the
> test until the watchpoint hits, and have a case in gdb_test_multiple to
> mark as UNRESOLVED if the function name is '??'.

I was able to do this in v3. But I mark the test as UNSUPPORTED rather
than UNRESOLVED. The difference between them isn't always clear in my
mind, but I think UNSUPPORTED is better in this case.

--
Thiago

      parent reply	other threads:[~2024-04-22 23:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20 21:33 [PATCH 0/2] Add testcase for libc memory operations Thiago Jung Bauermann
2024-04-20 21:33 ` [PATCH 1/2] gdb/testsuite: Add libc_has_debug_info require helper Thiago Jung Bauermann
2024-04-21 20:44   ` Kevin Buettner
2024-04-21 21:02     ` Kevin Buettner
2024-04-22  0:05       ` Thiago Jung Bauermann
2024-04-20 21:33 ` [PATCH 2/2] gdb/testsuite: Add gdb.base/memops-watchpoint.exp Thiago Jung Bauermann
2024-04-21 21:20   ` Kevin Buettner
2024-04-22  0:24     ` Thiago Jung Bauermann
2024-04-22 18:40       ` Kevin Buettner
2024-04-23  1:20         ` Thiago Jung Bauermann
2024-04-22 23:04       ` Thiago Jung Bauermann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5ll2e4f.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).