gdb: move lm_info to solib in dsbt_current_sos

Message ID 20240515171332.45675-1-simon.marchi@efficios.com
State New
Headers
Series gdb: move lm_info to solib in dsbt_current_sos |

Checks

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

Commit Message

Simon Marchi May 15, 2024, 5:13 p.m. UTC
  Commit 8971d2788e79 ("gdb: link so_list using intrusive_list")
mistakenly removed the line that moves the lm_info unique pointer to
sop->lm_info, probably due to a bad conflict resolution.  Restore that
line.

Unfortunately, this code is only used for TI C66, which is not widely
tested (if used at all).

Change-Id: I9f64eb4430c324bc93ddb4bd00d820dee34adfbb
---
 gdb/solib-dsbt.c | 1 +
 1 file changed, 1 insertion(+)


base-commit: 53071aac476c2d497b313b1ee09a462912cb1d87
  

Comments

Tom Tromey May 15, 2024, 7:28 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Commit 8971d2788e79 ("gdb: link so_list using intrusive_list")
Simon> mistakenly removed the line that moves the lm_info unique pointer to
Simon> sop-> lm_info, probably due to a bad conflict resolution.  Restore that
Simon> line.

Seems reasonable to me.

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


Simon> Unfortunately, this code is only used for TI C66, which is not widely
Simon> tested (if used at all).

I do wonder how much dead-in-practice code we're carting around.

Tom
  
Simon Marchi May 16, 2024, 3:33 p.m. UTC | #2
On 2024-05-15 15:28, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> Commit 8971d2788e79 ("gdb: link so_list using intrusive_list")
> Simon> mistakenly removed the line that moves the lm_info unique pointer to
> Simon> sop-> lm_info, probably due to a bad conflict resolution.  Restore that
> Simon> line.
> 
> Seems reasonable to me.
> 
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, will push.

> Simon> Unfortunately, this code is only used for TI C66, which is not widely
> Simon> tested (if used at all).
> 
> I do wonder how much dead-in-practice code we're carting around.

Yeah it's always the same question.  Support for c6x has been removed
from Linux in 2021:

  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a579fcfa8e49cc77ad59211bb18bc5004133e6a0

This means that after some time, tic6x-linux-tdep.c would become
obsolete, and solib-dsbt.c too.

As for the c6x architecture itself, I find some threads that are not too
old of people trying to debug their bare metal program with GDB (through
JTAG or emulation or otherwise), for instance:

  https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/665959/ccs-debugging-c66-with-host-gdb

Simon
  

Patch

diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index 11225f72ed01..908c78aebdca 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -616,6 +616,7 @@  dsbt_current_sos (void)
 	      sop->so_original_name = sop->so_name;
 	    }
 
+	  sop->lm_info = std::move (li);
 	  sos.push_back (*sop);
 	}
       else