This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/7 v3] Tracepoint for ppc64.
- From: Wei-cheng Wang <cole945 at gmail dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 28 Jun 2015 01:48:36 +0800
- Subject: Re: [PATCH 2/7 v3] Tracepoint for ppc64.
- Authentication-results: sourceware.org; auth=none
- References: <1427733032-64989-2-git-send-email-cole945 at gmail dot com> <20150408165700 dot E9630CF20 at oc7340732750 dot ibm dot com>
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