Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Philipp Rudo <prudo@linux.ibm.com>
Cc: Omair Javaid <omair.javaid@linaro.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 06/11] Add a more general version of lookup_struct_elt_type.
Date: Mon, 11 Feb 2019 17:44:00 -0000	[thread overview]
Message-ID: <652c13a9-c888-2a3a-7bf8-926bdcf02d0b@FreeBSD.org> (raw)
In-Reply-To: <20190211112733.698a1b72@laptop-ibm>

On 2/11/19 2:27 AM, Philipp Rudo wrote:
> Hey Jon
> 
> On Fri, 8 Feb 2019 17:07:22 -0800
> John Baldwin <jhb@FreeBSD.org> wrote:
> 
>> On 2/8/19 4:40 PM, John Baldwin wrote:
>>> lookup_struct_elt is a new function which returns a tuple of
>>> information about a component of a structure or union.  The returned
>>> tuple contains a pointer to the struct field object for the component
>>> as well as a bit offset of that field within the structure.  If the
>>> field names a field in an anonymous substructure, the offset is the
>>> "global" offset relative to the original structure type.  If noerr is
>>> set, then the returned tuple will set the field pointer to NULL to
>>> indicate a missing component rather than throwing an error.
>>>
>>> lookup_struct_elt_type is now reimplemented in terms of this new
>>> function.  It simply returns the type of the returned field.  
>>
>> Hopefully this is close enough to lk_find_field that you can reuse it.
>> One difference is that it defines its own dedicated type and the second is
>> that it returns the raw bitpos so that it is hopefully easier to reuse in
>> other places.  I think you can probably call it and just pass the members
>> the returned structure (with an added divide for the offset to convert to
>> bytes) to construct an lk_symbol.
> 
> sorry, I totally missed your v1.

Oh, this patch wasn't in the v1 is why.  I was using parse_and_eval_long
with hand-coded offsetof equivalents previously.

> The patch looks sane to me. It should be possible to use it in lk_find_field.
> I'm not fully sure what the 'check on baseclasses' does for C structs, but I
> guess it doesn't harm. Otherwise there would have already been an outcry :)

Ok.

-- 
John Baldwin

                                                                            


  reply	other threads:[~2019-02-11 17:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-09  0:42 [PATCH v2 00/11] Support for thread-local variables on FreeBSD John Baldwin
2019-02-09  0:42 ` [PATCH v2 08/11] Support TLS variables on FreeBSD/amd64 John Baldwin
2019-02-09  0:42 ` [PATCH v2 01/11] Support the fs_base and gs_base registers on i386 John Baldwin
2019-02-09  0:42 ` [PATCH v2 07/11] Add a helper function to resolve TLS variable addresses for FreeBSD John Baldwin
2019-03-07 16:18   ` Simon Marchi
2019-02-09  0:42 ` [PATCH v2 09/11] Support TLS variables on FreeBSD/i386 John Baldwin
2019-02-09  0:42 ` [PATCH v2 03/11] Handle an edge case for minisym TLS variable lookups John Baldwin
2019-02-09  0:42 ` [PATCH v2 11/11] Support TLS variables on FreeBSD/powerpc John Baldwin
2019-03-07 16:26   ` Simon Marchi
2019-02-09  0:42 ` [PATCH v2 06/11] Add a more general version of lookup_struct_elt_type John Baldwin
2019-02-09  1:08   ` John Baldwin
2019-02-11 10:27     ` Philipp Rudo
2019-02-11 17:44       ` John Baldwin [this message]
2019-03-07 15:53   ` Simon Marchi
2019-03-08  0:04     ` John Baldwin
2019-03-08  0:32       ` Pedro Alves
2019-03-08 18:39         ` John Baldwin
2019-02-09  0:42 ` [PATCH v2 02/11] Support fs_base and gs_base on FreeBSD/i386 John Baldwin
2019-02-09  0:50 ` [PATCH v2 05/11] Remove code disabled since at least 1999 from lookup_struct_elt_type John Baldwin
2019-03-07 16:25   ` Simon Marchi
2019-02-09  0:50 ` [PATCH v2 04/11] Add a new gdbarch method to resolve the address of TLS variables John Baldwin
2019-03-07 16:08   ` Simon Marchi
2019-03-07 23:50     ` John Baldwin
2019-03-08  2:55       ` Simon Marchi
2019-03-08 18:39         ` John Baldwin
2019-02-09  0:50 ` [PATCH v2 10/11] Support TLS variables on FreeBSD/riscv John Baldwin
2019-02-22 17:22 ` [PING][PATCH v2 00/11] Support for thread-local variables on FreeBSD John Baldwin
2019-03-12 20:21   ` Simon Marchi

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=652c13a9-c888-2a3a-7bf8-926bdcf02d0b@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=omair.javaid@linaro.org \
    --cc=prudo@linux.ibm.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