public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
@ 2023-01-30 16:03 Simon Marchi
  2023-01-30 16:08 ` Simon Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Simon Marchi @ 2023-01-30 16:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

New in v2:

 - move the implementation to the cooked_index_vector class
 - use the gdbarch from the objfile
 - add some QUIT macro calls
 - add call to wait, to ensure the index is finished

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
---
 gdb/dwarf2/cooked-index.c | 93 +++++++++++++++++++++++++++++++++++++++
 gdb/dwarf2/cooked-index.h |  7 +++
 gdb/dwarf2/read.c         | 10 ++++-
 3 files changed, 109 insertions(+), 1 deletion(-)

diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 646bc76575cd..0ee7afb7b978 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -20,6 +20,7 @@
 #include "defs.h"
 #include "dwarf2/cooked-index.h"
 #include "dwarf2/read.h"
+#include "dwarf2/stringify.h"
 #include "cp-support.h"
 #include "c-lang.h"
 #include "ada-lang.h"
@@ -30,6 +31,22 @@
 
 /* See cooked-index.h.  */
 
+std::string
+to_string (cooked_index_flag flags)
+{
+  static constexpr cooked_index_flag::string_mapping mapping[] = {
+    MAP_ENUM_FLAG (IS_MAIN),
+    MAP_ENUM_FLAG (IS_STATIC),
+    MAP_ENUM_FLAG (IS_ENUM_CLASS),
+    MAP_ENUM_FLAG (IS_LINKAGE),
+    MAP_ENUM_FLAG (IS_TYPE_DECLARATION),
+  };
+
+  return flags.to_string (mapping);
+}
+
+/* See cooked-index.h.  */
+
 bool
 cooked_index_entry::compare (const char *stra, const char *strb,
 			     bool completing)
@@ -442,6 +459,82 @@ cooked_index_vector::get_main () const
   return result;
 }
 
+/* See cooked-index.h.  */
+
+void
+cooked_index_vector::dump (gdbarch *arch) const
+{
+  /* Ensure the index is done building.  */
+  this->wait ();
+
+  gdb_printf ("  entries:\n");
+  gdb_printf ("\n");
+
+  size_t i = 0;
+  for (const cooked_index_entry *entry : this->all_entries ())
+    {
+      QUIT;
+
+      gdb_printf ("    [%zu] ((cooked_index_entry *) %p)\n", i++, entry);
+      gdb_printf ("    name:       %s\n", entry->name);
+      gdb_printf ("    canonical:  %s\n", entry->canonical);
+      gdb_printf ("    DWARF tag:  %s\n", dwarf_tag_name (entry->tag));
+      gdb_printf ("    flags:      %s\n", to_string (entry->flags).c_str ());
+      gdb_printf ("    DIE offset: 0x%lx\n",
+		  to_underlying (entry->die_offset));
+
+      if (entry->parent_entry != nullptr)
+	gdb_printf ("    parent:     ((cooked_index_entry *) %p) [%s]\n",
+		    entry->parent_entry, entry->parent_entry->name);
+      else
+	gdb_printf ("    parent:     ((cooked_index_entry *) 0)\n");
+
+      gdb_printf ("\n");
+    }
+
+  const cooked_index_entry *main_entry = this->get_main ();
+  if (main_entry != nullptr)
+    gdb_printf ("  main: ((cooked_index_entry *) %p) [%s]\n", main_entry,
+		  main_entry->name);
+  else
+    gdb_printf ("  main: ((cooked_index_entry *) 0)\n");
+
+  gdb_printf ("\n");
+  gdb_printf ("  address maps:\n");
+  gdb_printf ("\n");
+
+  std::vector<const addrmap *> addrmaps = this->get_addrmaps ();
+  for (i = 0; i < addrmaps.size (); ++i)
+    {
+      const addrmap &addrmap = *addrmaps[i];
+
+      gdb_printf ("    [%zu] ((addrmap *) %p)\n", i, &addrmap);
+      gdb_printf ("\n");
+
+      addrmap.foreach ([arch] (CORE_ADDR start_addr, const void *obj)
+	{
+	  QUIT;
+
+	  const char *start_addr_str = paddress (arch, start_addr);
+
+	  if (obj != nullptr)
+	    {
+	      const dwarf2_per_cu_data *per_cu
+		= static_cast<const dwarf2_per_cu_data *> (obj);
+	      gdb_printf ("      [%s] ((dwarf2_per_cu_data *) %p)\n",
+			  start_addr_str, per_cu);
+	    }
+	  else
+	    gdb_printf ("      [%s] ((dwarf2_per_cu_data *) 0)\n",
+			start_addr_str);
+
+	  return 0;
+	});
+
+      gdb_printf ("\n");
+    }
+}
+
 void _initialize_cooked_index ();
 void
 _initialize_cooked_index ()
diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index 7299a4f77b44..9d9be517c3a9 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -54,6 +54,10 @@ enum cooked_index_flag_enum : unsigned char
 };
 DEF_ENUM_FLAGS_TYPE (enum cooked_index_flag_enum, cooked_index_flag);
 
+/* Return a string representation of FLAGS.  */
+
+std::string to_string (cooked_index_flag flags);
+
 /* A cooked_index_entry represents a single item in the index.  Note
    that two entries can be created for the same DIE -- one using the
    name, and another one using the linkage name, if any.
@@ -373,6 +377,9 @@ class cooked_index_vector : public dwarf_scanner_base
 
   quick_symbol_functions_up make_quick_functions () const override;
 
+  /* Dump a human-readable form of the contents of the index.  */
+  void dump (gdbarch *arch) const;
+
 private:
 
   /* The vector of cooked_index objects.  This is stored because the
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 9d8952a4eb8d..16559133a3d0 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -18589,7 +18589,15 @@ struct cooked_index_functions : public dwarf2_base_index_functions
 
   void dump (struct objfile *objfile) override
   {
-    gdb_printf ("Cooked index in use\n");
+    gdb_printf ("Cooked index in use:\n");
+    gdb_printf ("\n");
+
+    dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
+    cooked_index_vector *index
+      = (gdb::checked_static_cast<cooked_index_vector *>
+         (per_objfile->per_bfd->index_table.get ()));
+
+    index->dump (objfile->arch ());
   }
 
   void expand_matching_symbols
-- 
2.39.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-30 16:03 [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump Simon Marchi
@ 2023-01-30 16:08 ` Simon Marchi
  2023-01-30 19:07 ` Tom Tromey
  2023-01-30 21:35 ` Andrew Burgess
  2 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2023-01-30 16:08 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 1/30/23 11:03, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> New in v2:
> 
>  - move the implementation to the cooked_index_vector class
>  - use the gdbarch from the objfile
>  - add some QUIT macro calls
>  - add call to wait, to ensure the index is finished
> 
> 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/

I just realized, this patch also depends on the following patch:

  [PATCH v2] Make addrmap const-correct in cooked index
  https://inbox.sourceware.org/gdb-patches/20230130152936.41750-1-simon.marchi@efficios.com/T/#u

Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-30 16:03 [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump Simon Marchi
  2023-01-30 16:08 ` Simon Marchi
@ 2023-01-30 19:07 ` Tom Tromey
  2023-01-30 20:08   ` Simon Marchi
  2023-01-30 21:35 ` Andrew Burgess
  2 siblings, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2023-01-30 19:07 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi, Simon Marchi

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
Simon> New in v2:

Simon>  - move the implementation to the cooked_index_vector class
Simon>  - use the gdbarch from the objfile
Simon>  - add some QUIT macro calls
Simon>  - add call to wait, to ensure the index is finished

Thanks, this looks good to me.

I don't really know which trailer to use but --

Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-30 19:07 ` Tom Tromey
@ 2023-01-30 20:08   ` Simon Marchi
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2023-01-30 20:08 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches; +Cc: Simon Marchi

On 1/30/23 14:07, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
> Simon> New in v2:
> 
> Simon>  - move the implementation to the cooked_index_vector class
> Simon>  - use the gdbarch from the objfile
> Simon>  - add some QUIT macro calls
> Simon>  - add call to wait, to ensure the index is finished
> 
> Thanks, this looks good to me.
> 
> I don't really know which trailer to use but --
> 
> Approved-By: Tom Tromey <tom@tromey.com>

Gah, I forgot applying the trailer before pushing, sorry about that.

Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-30 16:03 [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump Simon Marchi
  2023-01-30 16:08 ` Simon Marchi
  2023-01-30 19:07 ` Tom Tromey
@ 2023-01-30 21:35 ` Andrew Burgess
  2023-01-31  3:06   ` Simon Marchi
  2 siblings, 1 reply; 11+ messages in thread
From: Andrew Burgess @ 2023-01-30 21:35 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> New in v2:
>
>  - move the implementation to the cooked_index_vector class
>  - use the gdbarch from the objfile
>  - add some QUIT macro calls
>  - add call to wait, to ensure the index is finished
>
> 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
> ---
>  gdb/dwarf2/cooked-index.c | 93 +++++++++++++++++++++++++++++++++++++++
>  gdb/dwarf2/cooked-index.h |  7 +++
>  gdb/dwarf2/read.c         | 10 ++++-
>  3 files changed, 109 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
> index 646bc76575cd..0ee7afb7b978 100644
> --- a/gdb/dwarf2/cooked-index.c
> +++ b/gdb/dwarf2/cooked-index.c
> @@ -20,6 +20,7 @@
>  #include "defs.h"
>  #include "dwarf2/cooked-index.h"
>  #include "dwarf2/read.h"
> +#include "dwarf2/stringify.h"
>  #include "cp-support.h"
>  #include "c-lang.h"
>  #include "ada-lang.h"
> @@ -30,6 +31,22 @@
>  
>  /* See cooked-index.h.  */
>  
> +std::string
> +to_string (cooked_index_flag flags)
> +{
> +  static constexpr cooked_index_flag::string_mapping mapping[] = {
> +    MAP_ENUM_FLAG (IS_MAIN),
> +    MAP_ENUM_FLAG (IS_STATIC),
> +    MAP_ENUM_FLAG (IS_ENUM_CLASS),
> +    MAP_ENUM_FLAG (IS_LINKAGE),
> +    MAP_ENUM_FLAG (IS_TYPE_DECLARATION),
> +  };
> +
> +  return flags.to_string (mapping);
> +}
> +
> +/* See cooked-index.h.  */
> +
>  bool
>  cooked_index_entry::compare (const char *stra, const char *strb,
>  			     bool completing)
> @@ -442,6 +459,82 @@ cooked_index_vector::get_main () const
>    return result;
>  }
>  
> +/* See cooked-index.h.  */
> +
> +void
> +cooked_index_vector::dump (gdbarch *arch) const
> +{
> +  /* Ensure the index is done building.  */
> +  this->wait ();
> +
> +  gdb_printf ("  entries:\n");
> +  gdb_printf ("\n");
> +
> +  size_t i = 0;
> +  for (const cooked_index_entry *entry : this->all_entries ())
> +    {
> +      QUIT;
> +
> +      gdb_printf ("    [%zu] ((cooked_index_entry *) %p)\n", i++, entry);
> +      gdb_printf ("    name:       %s\n", entry->name);
> +      gdb_printf ("    canonical:  %s\n", entry->canonical);
> +      gdb_printf ("    DWARF tag:  %s\n", dwarf_tag_name (entry->tag));
> +      gdb_printf ("    flags:      %s\n", to_string (entry->flags).c_str ());
> +      gdb_printf ("    DIE offset: 0x%lx\n",
> +		  to_underlying (entry->die_offset));
> +
> +      if (entry->parent_entry != nullptr)
> +	gdb_printf ("    parent:     ((cooked_index_entry *) %p) [%s]\n",
> +		    entry->parent_entry, entry->parent_entry->name);
> +      else
> +	gdb_printf ("    parent:     ((cooked_index_entry *) 0)\n");
> +
> +      gdb_printf ("\n");
> +    }
> +
> +  const cooked_index_entry *main_entry = this->get_main ();
> +  if (main_entry != nullptr)
> +    gdb_printf ("  main: ((cooked_index_entry *) %p) [%s]\n", main_entry,
> +		  main_entry->name);
> +  else
> +    gdb_printf ("  main: ((cooked_index_entry *) 0)\n");
> +
> +  gdb_printf ("\n");
> +  gdb_printf ("  address maps:\n");
> +  gdb_printf ("\n");
> +
> +  std::vector<const addrmap *> addrmaps = this->get_addrmaps ();
> +  for (i = 0; i < addrmaps.size (); ++i)
> +    {
> +      const addrmap &addrmap = *addrmaps[i];
> +
> +      gdb_printf ("    [%zu] ((addrmap *) %p)\n", i, &addrmap);
> +      gdb_printf ("\n");
> +
> +      addrmap.foreach ([arch] (CORE_ADDR start_addr, const void *obj)
> +	{
> +	  QUIT;
> +
> +	  const char *start_addr_str = paddress (arch, start_addr);
> +
> +	  if (obj != nullptr)
> +	    {
> +	      const dwarf2_per_cu_data *per_cu
> +		= static_cast<const dwarf2_per_cu_data *> (obj);
> +	      gdb_printf ("      [%s] ((dwarf2_per_cu_data *) %p)\n",
> +			  start_addr_str, per_cu);
> +	    }
> +	  else
> +	    gdb_printf ("      [%s] ((dwarf2_per_cu_data *) 0)\n",
> +			start_addr_str);
> +
> +	  return 0;
> +	});
> +
> +      gdb_printf ("\n");
> +    }
> +}
> +
>  void _initialize_cooked_index ();
>  void
>  _initialize_cooked_index ()
> diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
> index 7299a4f77b44..9d9be517c3a9 100644
> --- a/gdb/dwarf2/cooked-index.h
> +++ b/gdb/dwarf2/cooked-index.h
> @@ -54,6 +54,10 @@ enum cooked_index_flag_enum : unsigned char
>  };
>  DEF_ENUM_FLAGS_TYPE (enum cooked_index_flag_enum, cooked_index_flag);
>  
> +/* Return a string representation of FLAGS.  */
> +
> +std::string to_string (cooked_index_flag flags);
> +
>  /* A cooked_index_entry represents a single item in the index.  Note
>     that two entries can be created for the same DIE -- one using the
>     name, and another one using the linkage name, if any.
> @@ -373,6 +377,9 @@ class cooked_index_vector : public dwarf_scanner_base
>  
>    quick_symbol_functions_up make_quick_functions () const override;
>  
> +  /* Dump a human-readable form of the contents of the index.  */
> +  void dump (gdbarch *arch) const;
> +
>  private:
>  
>    /* The vector of cooked_index objects.  This is stored because the
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index 9d8952a4eb8d..16559133a3d0 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -18589,7 +18589,15 @@ struct cooked_index_functions : public dwarf2_base_index_functions
>  
>    void dump (struct objfile *objfile) override
>    {
> -    gdb_printf ("Cooked index in use\n");
> +    gdb_printf ("Cooked index in use:\n");
> +    gdb_printf ("\n");
> +
> +    dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
> +    cooked_index_vector *index
> +      = (gdb::checked_static_cast<cooked_index_vector *>
> +         (per_objfile->per_bfd->index_table.get ()));
> +

With this patch I'm seeing this failure:


(gdb) PASS: gdb.dwarf2/dw2-error.exp: file dw2-error
maint print objfiles /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error

Object file /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x40dada0, bfd at 0x426bf70, 50 minsyms

Cooked index in use:

../../src/gdb/../gdbsupport/gdb-checked-static-cast.h:58: internal-error: checked_static_cast: Assertion `result != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
FAIL: gdb.dwarf2/dw2-error.exp: maint print objfiles /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error (GDB internal error)
PATH: gdb.dwarf2/dw2-error.exp: maint print objfiles /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error (GDB internal error)
Resyncing due to internal error.
0x5ff81a gdb_internal_backtrace_1
        ../../src/gdb/bt-utils.c:122
0x5ff8bd _Z22gdb_internal_backtracev
        ../../src/gdb/bt-utils.c:168
0xf4f770 internal_vproblem
        ../../src/gdb/utils.c:401
0xf4fb3f _Z15internal_verrorPKciS0_P13__va_list_tag
        ../../src/gdb/utils.c:481
0x1701002 _Z18internal_error_locPKciS0_z
        ../../src/gdbsupport/errors.cc:58
0x835778 ???
0x82a86d ???
0xdc63a9 _ZN7objfile4dumpEv
        ../../src/gdb/symfile-debug.c:317
0xdea35f dump_objfile
        ../../src/gdb/symmisc.c:122
0xdec5e9 maintenance_print_objfiles
        ../../src/gdb/symmisc.c:728
0x67c1fc do_simple_func
        ../../src/gdb/cli/cli-decode.c:95
0x681318 _Z8cmd_funcP16cmd_list_elementPKci
        ../../src/gdb/cli/cli-decode.c:2737
0xe72b87 _Z15execute_commandPKci
        ../../src/gdb/top.c:688
0x897cb5 _Z15command_handlerPKc
        ../../src/gdb/event-top.c:620
0x8981bb _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE
        ../../src/gdb/event-top.c:856
...etc...


Thanks,
Andrew


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-30 21:35 ` Andrew Burgess
@ 2023-01-31  3:06   ` Simon Marchi
  2023-01-31  9:21     ` Andrew Burgess
  2023-01-31 14:19     ` Tom Tromey
  0 siblings, 2 replies; 11+ messages in thread
From: Simon Marchi @ 2023-01-31  3:06 UTC (permalink / raw)
  To: Andrew Burgess, Simon Marchi, gdb-patches


> With this patch I'm seeing this failure:
> 
> 
> (gdb) PASS: gdb.dwarf2/dw2-error.exp: file dw2-error
> maint print objfiles /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error
> 
> Object file /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x40dada0, bfd at 0x426bf70, 50 minsyms
> 
> Cooked index in use:
> 
> ../../src/gdb/../gdbsupport/gdb-checked-static-cast.h:58: internal-error: checked_static_cast: Assertion `result != nullptr' failed.

Ah, sorry about that.

This is because dwarf2_build_psymtabs_hard throws, because of a bad
DWARF header (this is the point of the test), so no index ever gets
installed in index_table.

The obvious fix, to fix the test quickly, would be to add a nullptr
check in cooked_index_functions::dump.  However, the result is weird:

    (gdb) maintenance print objfiles

    Object file /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x614000007240, bfd at 0x6120000dbdc0, 24 minsyms

    Cooked index in use:

    (gdb)

It says the cooked index is in use, but there's nothing, as we never
actually managed to build a cooked index.  Maybe we should consider that
an invalid state, and remove the cooked_index_functions instance from
the objfile's quick symbol functions, if failing to read the psymtabs.

Of course, this state (cooked_index_functions in the objfile's qf +
per_objfile->index_table == nullptr) exists before
objfile::require_partial_symbols has been called on the objfile, for
quick symbol functions that can read partial symbols lazily (i.e. just
the DWARF cooked index at this time), as we haven't tried to read
partial symbols yet.  But after we called
objfile::require_partial_symbols, I don't think it's a state that makes
sense.

See the patch below for a quick prototype.
quick_symbol_functions::read_partial_symbols now returns a bool, and if
it returns false (failure), objfile::require_partial_symbols removes
that quick symbol instance from the qf list.

The result is:

    (gdb) file testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error
    Reading symbols from testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error...
    Dwarf Error: wrong version in compilation unit header (is 153, should be 2, 3, 4 or 5) [in module /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error]
    (No debugging symbols found in testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error)

The "No debugging symbols" message now appears.  It wouldn't appear,
because objfile_has_symbols would return true, which is kind of a lie.
When the cooked index qf is removed, it returns false.

And the problematic command that crashes the test now shows:

    (gdb) maintenance print objfiles

    Object file /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x614000007240, bfd at 0x6120000dbdc0, 24 minsyms

    (gdb)

Which is the same that would be shown if the objfile didn't have DWARF
info at all in the first place.

Please let me know if you think this approach makes sense, and if I'll
finish and polish the patch.

Simon

From ef55dbecacc7ec5f5e1cea82fc731b21e078783e Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Mon, 30 Jan 2023 21:38:28 -0500
Subject: [PATCH] fix

Change-Id: Ic6b741324cca13239ac84c5dbef474534ad08870
---
 gdb/dwarf2/read.c   | 14 ++++++++++----
 gdb/quick-symbol.h  |  8 ++++++--
 gdb/symfile-debug.c | 17 +++++++++++++----
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index e8a3e359adaa..118cbd450668 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -5422,13 +5422,13 @@ dwarf2_initialize_objfile (struct objfile *objfile)
 
 /* Build a partial symbol table.  */
 
-static void
+static bool
 dwarf2_build_psymtabs (struct objfile *objfile)
 {
   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
 
   if (per_objfile->per_bfd->index_table != nullptr)
-    return;
+    return true;
 
   try
     {
@@ -5436,10 +5436,14 @@ dwarf2_build_psymtabs (struct objfile *objfile)
 
       /* (maybe) store an index in the cache.  */
       global_index_cache.store (per_objfile);
+
+      return true;
     }
   catch (const gdb_exception_error &except)
     {
       exception_print (gdb_stderr, except);
+
+      return false;
     }
 }
 
@@ -18622,10 +18626,12 @@ struct cooked_index_functions : public dwarf2_base_index_functions
     return true;
   }
 
-  void read_partial_symbols (struct objfile *objfile) override
+  bool read_partial_symbols (struct objfile *objfile) override
   {
     if (dwarf2_has_info (objfile, nullptr))
-      dwarf2_build_psymtabs (objfile);
+      return dwarf2_build_psymtabs (objfile);
+
+    return true;
   }
 };
 
diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h
index a7fea2ccb494..41a34ec6e200 100644
--- a/gdb/quick-symbol.h
+++ b/gdb/quick-symbol.h
@@ -221,9 +221,13 @@ struct quick_symbol_functions
   }
 
   /* Read the partial symbols for OBJFILE.  This will only ever be
-     called if can_lazily_read_symbols returns true.  */
-  virtual void read_partial_symbols (struct objfile *objfile)
+     called if can_lazily_read_symbols returns true.
+
+     Return true on success.  Return false on failure, in which case the
+     quick_symbol_functions instance is removed from the objfile's QF list.  */
+  virtual bool read_partial_symbols (struct objfile *objfile)
   {
+    return true;
   }
 };
 
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index efc6bcdf2bdf..f244ec0d5d6e 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -313,7 +313,7 @@ objfile::dump ()
     gdb_printf (gdb_stdlog, "qf->dump (%s)\n",
 		objfile_debug_name (this));
 
-  for (const auto &iter : qf)
+  for (const auto &iter : this->qf_require_partial_symbols ())
     iter->dump (this);
 }
 
@@ -528,9 +528,10 @@ objfile::require_partial_symbols (bool verbose)
       flags |= OBJF_PSYMTABS_READ;
 
       bool printed = false;
-      for (const auto &iter : qf)
+      for (auto iter = qf.begin (), prev = qf.before_begin ();
+	   iter != qf.end (); )
 	{
-	  if (iter->can_lazily_read_symbols ())
+	  if ((*iter)->can_lazily_read_symbols ())
 	    {
 	      if (verbose && !printed)
 		{
@@ -538,7 +539,15 @@ objfile::require_partial_symbols (bool verbose)
 			      objfile_name (this));
 		  printed = true;
 		}
-	      iter->read_partial_symbols (this);
+
+	      bool success = (*iter)->read_partial_symbols (this);
+	      if (success)
+		{
+		  ++iter;
+		  ++prev;
+		}
+	      else
+		iter = qf.erase_after (prev);
 	    }
 	}
       if (printed && !objfile_has_symbols (this))

base-commit: 9c6e6c8f4b07a51a47c10a84e10a938b64b65fd5
-- 
2.39.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-31  3:06   ` Simon Marchi
@ 2023-01-31  9:21     ` Andrew Burgess
  2023-01-31 15:49       ` Simon Marchi
  2023-01-31 14:19     ` Tom Tromey
  1 sibling, 1 reply; 11+ messages in thread
From: Andrew Burgess @ 2023-01-31  9:21 UTC (permalink / raw)
  To: Simon Marchi, Simon Marchi, gdb-patches

Simon Marchi <simon.marchi@polymtl.ca> writes:

>> With this patch I'm seeing this failure:
>> 
>> 
>> (gdb) PASS: gdb.dwarf2/dw2-error.exp: file dw2-error
>> maint print objfiles /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error
>> 
>> Object file /tmp/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x40dada0, bfd at 0x426bf70, 50 minsyms
>> 
>> Cooked index in use:
>> 
>> ../../src/gdb/../gdbsupport/gdb-checked-static-cast.h:58: internal-error: checked_static_cast: Assertion `result != nullptr' failed.
>
> Ah, sorry about that.
>
> This is because dwarf2_build_psymtabs_hard throws, because of a bad
> DWARF header (this is the point of the test), so no index ever gets
> installed in index_table.
>
> The obvious fix, to fix the test quickly, would be to add a nullptr
> check in cooked_index_functions::dump.  However, the result is weird:
>
>     (gdb) maintenance print objfiles
>
>     Object file /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x614000007240, bfd at 0x6120000dbdc0, 24 minsyms
>
>     Cooked index in use:
>
>     (gdb)
>
> It says the cooked index is in use, but there's nothing, as we never
> actually managed to build a cooked index.  Maybe we should consider that
> an invalid state, and remove the cooked_index_functions instance from
> the objfile's quick symbol functions, if failing to read the psymtabs.
>
> Of course, this state (cooked_index_functions in the objfile's qf +
> per_objfile->index_table == nullptr) exists before
> objfile::require_partial_symbols has been called on the objfile, for
> quick symbol functions that can read partial symbols lazily (i.e. just
> the DWARF cooked index at this time), as we haven't tried to read
> partial symbols yet.  But after we called
> objfile::require_partial_symbols, I don't think it's a state that makes
> sense.
>
> See the patch below for a quick prototype.
> quick_symbol_functions::read_partial_symbols now returns a bool, and if
> it returns false (failure), objfile::require_partial_symbols removes
> that quick symbol instance from the qf list.
>
> The result is:
>
>     (gdb) file testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error
>     Reading symbols from testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error...
>     Dwarf Error: wrong version in compilation unit header (is 153, should be 2, 3, 4 or 5) [in module /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error]
>     (No debugging symbols found in testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error)
>
> The "No debugging symbols" message now appears.  It wouldn't appear,
> because objfile_has_symbols would return true, which is kind of a lie.
> When the cooked index qf is removed, it returns false.
>
> And the problematic command that crashes the test now shows:
>
>     (gdb) maintenance print objfiles
>
>     Object file /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw2-error/dw2-error:  Objfile at 0x614000007240, bfd at 0x6120000dbdc0, 24 minsyms
>
>     (gdb)
>
> Which is the same that would be shown if the objfile didn't have DWARF
> info at all in the first place.
>
> Please let me know if you think this approach makes sense, and if I'll
> finish and polish the patch.

I think this would be a good improvement.  Especially the "No debugging
symbols found..." message now being printed, is, I think, a good thing.

Thanks,
Andrew


>
> Simon
>
> From ef55dbecacc7ec5f5e1cea82fc731b21e078783e Mon Sep 17 00:00:00 2001
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Date: Mon, 30 Jan 2023 21:38:28 -0500
> Subject: [PATCH] fix
>
> Change-Id: Ic6b741324cca13239ac84c5dbef474534ad08870
> ---
>  gdb/dwarf2/read.c   | 14 ++++++++++----
>  gdb/quick-symbol.h  |  8 ++++++--
>  gdb/symfile-debug.c | 17 +++++++++++++----
>  3 files changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index e8a3e359adaa..118cbd450668 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -5422,13 +5422,13 @@ dwarf2_initialize_objfile (struct objfile *objfile)
>  
>  /* Build a partial symbol table.  */
>  
> -static void
> +static bool
>  dwarf2_build_psymtabs (struct objfile *objfile)
>  {
>    dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
>  
>    if (per_objfile->per_bfd->index_table != nullptr)
> -    return;
> +    return true;
>  
>    try
>      {
> @@ -5436,10 +5436,14 @@ dwarf2_build_psymtabs (struct objfile *objfile)
>  
>        /* (maybe) store an index in the cache.  */
>        global_index_cache.store (per_objfile);
> +
> +      return true;
>      }
>    catch (const gdb_exception_error &except)
>      {
>        exception_print (gdb_stderr, except);
> +
> +      return false;
>      }
>  }
>  
> @@ -18622,10 +18626,12 @@ struct cooked_index_functions : public dwarf2_base_index_functions
>      return true;
>    }
>  
> -  void read_partial_symbols (struct objfile *objfile) override
> +  bool read_partial_symbols (struct objfile *objfile) override
>    {
>      if (dwarf2_has_info (objfile, nullptr))
> -      dwarf2_build_psymtabs (objfile);
> +      return dwarf2_build_psymtabs (objfile);
> +
> +    return true;
>    }
>  };
>  
> diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h
> index a7fea2ccb494..41a34ec6e200 100644
> --- a/gdb/quick-symbol.h
> +++ b/gdb/quick-symbol.h
> @@ -221,9 +221,13 @@ struct quick_symbol_functions
>    }
>  
>    /* Read the partial symbols for OBJFILE.  This will only ever be
> -     called if can_lazily_read_symbols returns true.  */
> -  virtual void read_partial_symbols (struct objfile *objfile)
> +     called if can_lazily_read_symbols returns true.
> +
> +     Return true on success.  Return false on failure, in which case the
> +     quick_symbol_functions instance is removed from the objfile's QF list.  */
> +  virtual bool read_partial_symbols (struct objfile *objfile)
>    {
> +    return true;
>    }
>  };
>  
> diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
> index efc6bcdf2bdf..f244ec0d5d6e 100644
> --- a/gdb/symfile-debug.c
> +++ b/gdb/symfile-debug.c
> @@ -313,7 +313,7 @@ objfile::dump ()
>      gdb_printf (gdb_stdlog, "qf->dump (%s)\n",
>  		objfile_debug_name (this));
>  
> -  for (const auto &iter : qf)
> +  for (const auto &iter : this->qf_require_partial_symbols ())
>      iter->dump (this);
>  }
>  
> @@ -528,9 +528,10 @@ objfile::require_partial_symbols (bool verbose)
>        flags |= OBJF_PSYMTABS_READ;
>  
>        bool printed = false;
> -      for (const auto &iter : qf)
> +      for (auto iter = qf.begin (), prev = qf.before_begin ();
> +	   iter != qf.end (); )
>  	{
> -	  if (iter->can_lazily_read_symbols ())
> +	  if ((*iter)->can_lazily_read_symbols ())
>  	    {
>  	      if (verbose && !printed)
>  		{
> @@ -538,7 +539,15 @@ objfile::require_partial_symbols (bool verbose)
>  			      objfile_name (this));
>  		  printed = true;
>  		}
> -	      iter->read_partial_symbols (this);
> +
> +	      bool success = (*iter)->read_partial_symbols (this);
> +	      if (success)
> +		{
> +		  ++iter;
> +		  ++prev;
> +		}
> +	      else
> +		iter = qf.erase_after (prev);
>  	    }
>  	}
>        if (printed && !objfile_has_symbols (this))
>
> base-commit: 9c6e6c8f4b07a51a47c10a84e10a938b64b65fd5
> -- 
> 2.39.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-31  3:06   ` Simon Marchi
  2023-01-31  9:21     ` Andrew Burgess
@ 2023-01-31 14:19     ` Tom Tromey
  2023-01-31 15:35       ` Simon Marchi
  1 sibling, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2023-01-31 14:19 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Andrew Burgess, Simon Marchi, Simon Marchi

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> See the patch below for a quick prototype.
Simon> quick_symbol_functions::read_partial_symbols now returns a bool, and if
Simon> it returns false (failure), objfile::require_partial_symbols removes
Simon> that quick symbol instance from the qf list.

I'm working to get rid of this lazy symbol stuff.  So I'd rather not add
another meaning to it.  You can see the WIP on t/bg-dwarf-reading, but
the basic idea is that instead of delaying the reading of DWARF, start
the reading early and just delay the completion of it.  I haven't sent
this yet because it currently crashes, I think it will benefit from
being rebased on the write-index-in-background patch.

All the other methods in cooked_index_functions already do:

  dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
  if (per_objfile->per_bfd->index_table == nullptr)
    return;

So maybe this would be an ok choice for dump.

As an aside the code is doing:

  if (per_bfd->index_table == nullptr)
    return nullptr;
  cooked_index_vector *table
    = (gdb::checked_static_cast<cooked_index_vector *>
       (per_bfd->index_table.get ()));

It seems to me that it would be fine if checked_static_cast passed
through null in this case -- that is, do not assert when the result is
null if the parameter is also null.

Tom

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-31 14:19     ` Tom Tromey
@ 2023-01-31 15:35       ` Simon Marchi
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Marchi @ 2023-01-31 15:35 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches; +Cc: Andrew Burgess, Simon Marchi

On 1/31/23 09:19, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> See the patch below for a quick prototype.
> Simon> quick_symbol_functions::read_partial_symbols now returns a bool, and if
> Simon> it returns false (failure), objfile::require_partial_symbols removes
> Simon> that quick symbol instance from the qf list.
> 
> I'm working to get rid of this lazy symbol stuff.  So I'd rather not add
> another meaning to it.  You can see the WIP on t/bg-dwarf-reading, but
> the basic idea is that instead of delaying the reading of DWARF, start
> the reading early and just delay the completion of it.  I haven't sent
> this yet because it currently crashes, I think it will benefit from
> being rebased on the write-index-in-background patch.
> 
> All the other methods in cooked_index_functions already do:
> 
>   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
>   if (per_objfile->per_bfd->index_table == nullptr)
>     return;

Ah ok, I had not seen that.  Then it makes sense to follow that paradigm
in dump too.

> So maybe this would be an ok choice for dump.
> 
> As an aside the code is doing:
> 
>   if (per_bfd->index_table == nullptr)
>     return nullptr;
>   cooked_index_vector *table
>     = (gdb::checked_static_cast<cooked_index_vector *>
>        (per_bfd->index_table.get ()));
> 
> It seems to me that it would be fine if checked_static_cast passed
> through null in this case -- that is, do not assert when the result is
> null if the parameter is also null.

I think that would make sense.  Both static_cast and dynamic_cast return
nullptr if passed nullptr, so checked_static_cast should too.

However, in my case it would have crashed anyway on the following line
dereferencing the table variable.

Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-31  9:21     ` Andrew Burgess
@ 2023-01-31 15:49       ` Simon Marchi
  2023-01-31 17:27         ` Tom Tromey
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Marchi @ 2023-01-31 15:49 UTC (permalink / raw)
  To: Andrew Burgess, Simon Marchi, gdb-patches

> I think this would be a good improvement.  Especially the "No debugging
> symbols found..." message now being printed, is, I think, a good thing.
Although I agree with you, given Tom's answer, I will go with the simple
nullptr check.  Hopefully we can being back the "No debugging symbols
found" message at some later point.

Simon


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
  2023-01-31 15:49       ` Simon Marchi
@ 2023-01-31 17:27         ` Tom Tromey
  0 siblings, 0 replies; 11+ messages in thread
From: Tom Tromey @ 2023-01-31 17:27 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Andrew Burgess, Simon Marchi, Simon Marchi

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

>> I think this would be a good improvement.  Especially the "No debugging
>> symbols found..." message now being printed, is, I think, a good thing.

Simon> Although I agree with you, given Tom's answer, I will go with the simple
Simon> nullptr check.  Hopefully we can being back the "No debugging symbols
Simon> found" message at some later point.

There really is debuginfo -- it's just not usable.  So I think it would
be better to print a big red error saying that, because it's probably of
interest to the user.

Maybe "info shared" could also be augmented to share this sort of info.

Tom

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-01-31 17:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 16:03 [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump Simon Marchi
2023-01-30 16:08 ` Simon Marchi
2023-01-30 19:07 ` Tom Tromey
2023-01-30 20:08   ` Simon Marchi
2023-01-30 21:35 ` Andrew Burgess
2023-01-31  3:06   ` Simon Marchi
2023-01-31  9:21     ` Andrew Burgess
2023-01-31 15:49       ` Simon Marchi
2023-01-31 17:27         ` Tom Tromey
2023-01-31 14:19     ` Tom Tromey
2023-01-31 15:35       ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).