This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Patch for new DW_OP
- From: Nick Clifton <nickc at redhat dot com>
- To: "Tambay, Pallavi" <Pallavi dot Tambay at amd dot com>
- Cc: binutils at sourceware dot org, "Meissner, Michael" <michael dot meissner at amd dot com>, "rajagopal, dwarak" <dwarak dot rajagopal at amd dot com>, steven dot nakamoto at pgroup dot com
- Date: Mon, 03 Mar 2008 10:21:07 +0000
- Subject: Re: Patch for new DW_OP
- References: <9BCA02B0979C2A429C5965B8AE292698020ECBA6@SAUSEXMB2.amd.com>
Hi Pallavi,
This patch adds the following dwarf operation as a PGI
(STMicroelectronics) extension.
As a matter of interest have PGI submitted this extension to the DWARF
committee for consideration ?
elf/ChangeLog
2008-02-29 Pallavi Tambay <pallavi.tambay@amd.com>
* dwarf2.h: (enum dwarf_location_atom): Add new DW_OP,
DW_OP_PGI_omp_thread_num.
Approved and applied.
I also applied the attached patch to allow objdump and readelf to decode
this op.
Cheers
Nick
binutils/ChangeLog
2008-03-03 Nick Clifton <nickc@redhat.com>
* dwarf.c (decode_location_expression): Handle
DW_OP_PGI_omp_thread_num.
Index: binutils/dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.30
retrieving revision 1.32
diff -c -3 -p -r1.30 -r1.32
*** binutils/dwarf.c 29 Jan 2008 15:45:00 -0000 1.30
--- binutils/dwarf.c 3 Mar 2008 10:19:01 -0000 1.32
*************** print_dwarf_vma (dwarf_vma val, unsigned
*** 175,182 ****
--- 175,186 ----
integer value, so we print the full value into a buffer and then select
the precision we need. */
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
+ #ifndef __MSVCRT__
snprintf (buff, sizeof (buff), "%16.16llx ", val);
#else
+ snprintf (buff, sizeof (buff), "%016I64x ", val);
+ #endif
+ #else
snprintf (buff, sizeof (buff), "%16.16lx ", val);
#endif
*************** decode_location_expression (unsigned cha
*** 1010,1015 ****
--- 1014,1028 ----
/* FIXME: Is there data associated with this OP ? */
break;
+ /* PGI (STMicroelectronics) extensions. */
+ case DW_OP_PGI_omp_thread_num:
+ /* Pushes the thread number for the current thread as it would be
+ returned by the standard OpenMP library function:
+ omp_get_thread_num(). The "current thread" is the thread for
+ which the expression is being evaluated. */
+ printf ("DW_OP_PGI_omp_thread_num");
+ break;
+
default:
if (op >= DW_OP_lo_user
&& op <= DW_OP_hi_user)