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] Update ELF auxv entry types and update GDB to use them.


On 2/27/20 5:30 PM, Pedro Alves wrote:
On 2/25/20 12:10 PM, Luis Machado wrote:
I noticed GDB didn't know a particular AT tag (51) when doing some debugging.
Turns out we're missing a few entries compared to glibc's headers.

This patch adds them to the ELF include file and GDB.

include/ChangeLog:

	* elf/common.h (AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
	AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
	AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE, AT_L3_CACHEGEOMETRY,
	AT_MINSIGSTKSZ): New defines, imported from glibc.


The standard says to split lines by closing and reopening parens,
instead of comma.  Like:

	* elf/common.h (AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY)
	(AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE)
	(AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE, AT_L3_CACHEGEOMETRY)
	(AT_MINSIGSTKSZ): New defines, imported from glibc.


gdb/ChangeLog:

	* auxv.c (default_print_auxv_entry): Add new auxv entries.
---
  gdb/auxv.c           | 12 ++++++++++++
  include/elf/common.h | 15 +++++++++++++++
  2 files changed, 27 insertions(+)

diff --git a/gdb/auxv.c b/gdb/auxv.c
index eb1233527e..e7432e1852 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -497,6 +497,18 @@ default_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
  	   AUXV_FORMAT_HEX);
        TAG (AT_SUN_CAP_HW2, _("Machine-dependent CPU capability hints 2"),
  	   AUXV_FORMAT_HEX);
+      TAG (AT_L1I_CACHESIZE , _("L1 Instruction cache size"), AUXV_FORMAT_HEX);
+      TAG (AT_L1I_CACHEGEOMETRY , _("L1 Instruction cache geometry"),
+	   AUXV_FORMAT_HEX);
+      TAG (AT_L1D_CACHESIZE , _("L1 Data cache size"), AUXV_FORMAT_HEX);
+      TAG (AT_L1D_CACHEGEOMETRY , _("L1 Data cache geometry"),
+	   AUXV_FORMAT_HEX);
+      TAG (AT_L2_CACHESIZE , _("L2 cache size"), AUXV_FORMAT_HEX);
+      TAG (AT_L2_CACHEGEOMETRY , _("L2 cache geometry"), AUXV_FORMAT_HEX);
+      TAG (AT_L3_CACHESIZE , _("L3 cache size"), AUXV_FORMAT_HEX);
+      TAG (AT_L3_CACHEGEOMETRY , _("L3 cache geometry"), AUXV_FORMAT_HEX);
+      TAG (AT_MINSIGSTKSZ , _("Minimum stack size for signal delivery"),
+	   AUXV_FORMAT_HEX);

Odd space before comma in all the new lines above.
How about putting these right after AT_L3_CACHESHAPE /
before the SUN ones?

Thanks for the review. Fixed now and pushed.

Binutils side approved and pushed by Nick here https://sourceware.org/ml/binutils/2020-03/msg00043.html.


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