Re: [PATCH] Fix for 'struct -o' option to display the offsets of struct fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 27, 2022 at 5:14 PM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@xxxxxxx> wrote:
On 2022/05/27 16:03, lijiang wrote:
>      >> If no another gdb setting, we will need to rewrite the parser.
>      >> So first, I'd like to know whether there is no another setting.
>      >
>      > Otherwise, maybe we can patch the gdb code...
>      >
>      > That '{...}' is probably printed in c_type_print_base_struct_union().
>      > And found a comment for c_type_print_base_1() in gdb/c-typeprint.c:
>      >
>      >      SHOW negative means just print the type name or struct tag if there
>      >      is one.  If there is no name, print something sensible but concise
>      >      like "struct {...}".
>      >
>      > Just an idea and clue.
>
>
> I like the good idea.
>
>     Just a rough try and I've not tested enough, but this patch might be
>     somewhat good.
>
>     --- gdb-10.2.orig/gdb/c-typeprint.c     2022-05-27 14:49:53.079853333 +0900
>     +++ gdb-10.2/gdb/c-typeprint.c  2022-05-27 14:47:18.729165094 +0900
>     @@ -1043,6 +1043,8 @@
>          struct type_print_options local_flags = *flags;
>          local_flags.local_typedefs = NULL;
>
>     +  show = 1;
>     +
>          std::unique_ptr<typedef_hash_table> hash_holder;
>          if (!flags->raw)
>            {
>
>
> This looks more reasonable to me. Could you please post a patch with this fix?

Sure.  But more understanding and testing are needed, I will look into it
next week.


Sounds good and thank you for working on this issue, Kazu.
I will continue to improve the "dev -d" patchset.

Thanks.
Lianbo
 
Thanks,
Kazu
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux