This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/7 v3] Tracepoint for ppc64.


Hi,

On Thu, Apr 9, 2015 at 12:57 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> Wei-cheng Wang wrote:
>> The fail cases in gdb-unavailable are caused by inaccessible vtable for object
>> For x86, such structures (_ZVTxxx) are put in .rodata section, so gdb can read
>> them in local file if not collected by tracepoint action, but for PowerpPC,
>> they are put in .rel.ro sections.  Technically they not read-only, so gdb won't
>> read them in file if not collected.
>
> Is this really a difference between Intel and PowerPC, or this is rather
> a difference between different binutils levels?  I don't see off-hand
> why this should be Power-specific ...  Do you have example assembler
> code that shows the difference?

ppc64le:

        .weak   _ZTV7Derived
        .section
.data.rel.ro._ZTV7Derived,"awG",@progbits,_ZTV7Derived,comdat
                        ^^^^^^^^^^^^^              ^^^
        .align 3
        .type   _ZTV7Derived, @object
        .size   _ZTV7Derived, 56
_ZTV7Derived:
        .quad   28
        .quad   16
        .quad   0
        .quad   _ZTI7Derived
        .quad   12
        .quad   -16
        .quad   _ZTI7Derived
        .weak   _ZTT7Derived

x86_64:

        .section        .rodata._ZTV7Derived,"aG",@progbits,_ZTV7Derived,comdat
                        ^^^^^^^^              ^^^
        .align 32
        .type   _ZTV7Derived, @object
        .size   _ZTV7Derived, 56
_ZTV7Derived:
        .quad   28
        .quad   16
        .quad   0
        .quad   _ZTI7Derived
        .quad   12
        .quad   -16
        .quad   _ZTI7Derived
        .weak   _ZTT7Derived


The assembly code can be reproduced by compiling gdb.trace/unavailable.c

In this case, gdb wants to access (vtable for Derived + 32).
Because it's not collected, gdb tries to see if the address is read-only,
so it can access it from files.  See also remote_xfer_live_readonly_partial.

Thanks,
Wei-cheng


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]