Go to file
Simon Marchi 7d82b08e9e gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
As I am investigating a crash I see with the cooked index, I thought it
would be useful to have a way to dump the index contents.  For those not
too familiar with it (that includes me), it can help get a feel of what
it contains and how it is structured.

The cooked_index_functions::dump function is called as part of the
"maintenance print objfiles" command.  I tried to make the output
well structured and indented to help readability, as this prints a lot
of text.

The dump function first dumps all cooked index entries, like this:

    [25] ((cooked_index_entry *) 0x621000121220)
    name:       __ioinit
    canonical:  __ioinit
    DWARF tag:  DW_TAG_variable
    flags:      0x2 [IS_STATIC]
    DIE offset: 0x21a4
    parent:     ((cooked_index_entry *) 0x6210000f9610) [std]

Then the information about the main symbol:

    main: ((cooked_index_entry *) 0x621000123b40) [main]

And finally the address map contents:

    [1] ((addrmap *) 0x6210000f7910)

      [0x0] ((dwarf2_per_cu_data *) 0)
      [0x118a] ((dwarf2_per_cu_data *) 0x60c000007f00)
      [0x1cc7] ((dwarf2_per_cu_data *) 0)
      [0x1cc8] ((dwarf2_per_cu_data *) 0x60c000007f00)
      [0x1cdf] ((dwarf2_per_cu_data *) 0)
      [0x1ce0] ((dwarf2_per_cu_data *) 0x60c000007f00)

The display of address maps above could probably be improved, to show it
more as ranges, but I think this is a reasonable start.

Note that this patch depends on Pedro Alves' patch "enum_flags
to_string" [1].  If my patch is to be merged before Pedro's series, I
will cherry-pick this patch from his series and merge it before mine.

[1] https://inbox.sourceware.org/gdb-patches/20221212203101.1034916-8-pedro@palves.net/

Change-Id: Ida13e479fd4c8d21102ddd732241778bc3b6904a
2023-01-30 15:04:44 -05:00
bfd Automatic date update in version.in 2023-01-30 00:00:07 +00:00
binutils Updated Swedish translation for the binutils sub-directory 2023-01-23 10:53:12 +00:00
config
contrib
cpu
elfcpp
etc
gas x86: move reg_operands adjustment 2023-01-27 09:23:38 +01:00
gdb gdb/dwarf: dump cooked index contents in cooked_index_functions::dump 2023-01-30 15:04:44 -05:00
gdbserver Fix 'make TAGS' in gdbserver 2023-01-18 11:12:20 -07:00
gdbsupport enum_flags to_string 2023-01-30 15:03:55 -05:00
gnulib
gold
gprof
gprofng gprofng: PR30043 libgprofng.so.* are installed to a wrong location 2023-01-26 11:00:51 -08:00
include sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
intl
ld Another fix for EFI generation with LTO enabled. 2023-01-27 12:00:35 +00:00
libbacktrace
libctf libctf: update regexp to allow makeinfo to build document 2023-01-16 23:18:38 +08:00
libdecnumber
libiberty
libsframe libsframe/doc: fix some warnings 2023-01-24 10:08:14 -08:00
opcodes x86: use ModR/M for FPU insns with operands 2023-01-27 09:22:49 +01:00
readline
sim sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def toplevel: Makefile.def: add install-strip dependency on libsframe 2023-01-18 23:17:49 -08:00
Makefile.in toplevel: Makefile.def: add install-strip dependency on libsframe 2023-01-18 23:17:49 -08:00
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.