[2/5,dap,&,linetable] : Add column to maint info linetable output

Message ID 20240116191305.126345-2-simon.farre.cx@gmail.com
State New
Headers
Series [1/5,dap,&,linetable] : Add column to linetable entry |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Testing failed

Commit Message

Simon Farre Jan. 16, 2024, 7:13 p.m. UTC
  This adds "COL" to the output of the maintenance command "info
line-table"
---
 gdb/symmisc.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 5dfb9fca8f0..78dc63df6ac 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -973,9 +973,10 @@  maintenance_print_one_line_table (struct symtab *symtab, void *data)
       /* Leave space for 6 digits of index and line number.  After that the
 	 tables will just not format as well.  */
       struct ui_out *uiout = current_uiout;
-      ui_out_emit_table table_emitter (uiout, 7, -1, "line-table");
+      ui_out_emit_table table_emitter (uiout, 8, -1, "line-table");
       uiout->table_header (6, ui_left, "index", _("INDEX"));
       uiout->table_header (6, ui_left, "line", _("LINE"));
+      uiout->table_header (6, ui_left, "col", _("COL"));
       uiout->table_header (18, ui_left, "rel-address", _("REL-ADDRESS"));
       uiout->table_header (18, ui_left, "unrel-address", _("UNREL-ADDRESS"));
       uiout->table_header (7, ui_left, "is-stmt", _("IS-STMT"));
@@ -991,9 +992,15 @@  maintenance_print_one_line_table (struct symtab *symtab, void *data)
 	  ui_out_emit_tuple tuple_emitter (uiout, nullptr);
 	  uiout->field_signed ("index", i);
 	  if (item->line > 0)
-	    uiout->field_signed ("line", item->line);
+	    {
+	      uiout->field_signed ("line", item->line);
+	      uiout->field_signed("col", item->col);
+	    }
 	  else
-	    uiout->field_string ("line", _("END"));
+	    {
+	      uiout->field_string ("line", _("END"));
+	      uiout->field_string ("col", _("END"));
+	    }
 	  uiout->field_core_addr ("rel-address", objfile->arch (),
 				  item->pc (objfile));
 	  uiout->field_core_addr ("unrel-address", objfile->arch (),