public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>, gdb-patches@sourceware.org
Subject: Re: [PUSHED OBV] Fix loongarch_iterate_over_regset_sections for non-native targets.
Date: Tue, 24 May 2022 09:47:19 -0700	[thread overview]
Message-ID: <47d2fec5-36a3-012d-4d60-0553b04c3405@FreeBSD.org> (raw)
In-Reply-To: <9ff1f06f-f274-36e0-0921-bac72ff4df74@loongson.cn>

On 5/24/22 2:20 AM, Tiezhu Yang wrote:
> 
> 
> On 05/24/2022 02:15 AM, John Baldwin wrote:
>> Define a constant for the number of registers stored in a register set
>> and use this with register_size to compute the size of the
>> general-purpose register set in core dumps.
>>
>> This also fixes the build on hosts such as FreeBSD that do not define
>> an elf_gregset_t type.
> 
> Hi John,
> 
> Sorry for the related issues on FreeBSD,
> the original patch is only tested on LoongArch Linux,
> thank you very much for your test and fix.

Testing on x86-64 Linux or the like might also be good to help ensure
that you can cross-debug core dumps in the future.  Testing on that
would probably have also not worked due to elf_gregset_t being different
sizes for different architectures.

>> ---
>>   gdb/loongarch-linux-tdep.c | 14 ++++++++++++--
>>   1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/gdb/loongarch-linux-tdep.c b/gdb/loongarch-linux-tdep.c
>> index f13756dd003..bbb43abe13f 100644
>> --- a/gdb/loongarch-linux-tdep.c
>> +++ b/gdb/loongarch-linux-tdep.c
>> @@ -29,6 +29,11 @@
>>   #include "trad-frame.h"
>>   #include "tramp-frame.h"
>>
>> +/* The general-purpose regset consists of 32 R registers, plus PC,
>> +   and BADV registers.  */
>> +
>> +#define LOONGARCH_LINUX_NUM_GREGSET	(34)
> 
> LOONGARCH_LINUX_NUM_GREGSET should be defined as 45 (32 + 1 + 1 + 11)
> due to reserved 11 for extension in glibc, otherwise when execute:

Thanks for fixing the constant.  I just guessed based on what the regset
functions supplied and collected.

-- 
John Baldwin

      reply	other threads:[~2022-05-24 16:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 18:15 John Baldwin
2022-05-24  9:20 ` Tiezhu Yang
2022-05-24 16:47   ` John Baldwin [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=47d2fec5-36a3-012d-4d60-0553b04c3405@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=yangtiezhu@loongson.cn \
    /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).