We have a custom board based on the T1024 with two e5500 cores on it. I just recently built a Linux for this machine with yocto. So far we've managed to get it up and running. Now I wanted to check whether the debugger works and I created a toy program in order to cross-compile it and have it debugged on the board. So I tried to use gdb on the machine itself, this didn't work, it seems gdb has a bug on ppc machines since it mixes up the ppccommon and ppccommon64 architectures. So I tried with gdbserver and afterwards with lldb-server.
This is what I get when I debug an application with lldb (connecting to lldb-server) and I try to set a breakpoint:
GDB
(gdb) target remote testbox:1234
Remote debugging using testbox:1234
Reading /home/root/foo from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
warning: Selected architecture powerpc:common64 is not compatible with reported target architecture powerpc:common
warning: Architecture of file not recognized.
Reading /home/root/foo from remote target...
Reading symbols from target:/home/root/foo...
Reading /lib64/ld64.so.1 from remote target...
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0xf7fce8d0 in ?? ()
(gdb) b main
warning: could not convert 'main' from the host encoding (UTF-8) to UTF-32.
This normally should not happen, please file a bug report.
Breakpoint 1 at 0x1814: file /home/david/tests/vrag-linux/src/foo.cpp, line 15.
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x1814
Cannot insert breakpoint -1.
Cannot access memory at address 0x1fb28
Command aborted.
(gdb) hbreak main
Note: breakpoint 1 also set at pc 0x1814.
Hardware assisted breakpoint 2 at 0x1814: file /home/david/tests/vrag-linux/src/foo.cpp, line 15.
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x1814
Cannot insert hardware breakpoint 2.
Cannot insert breakpoint -1.
Cannot access memory at address 0x1fb28
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
Command aborted.
(gdb)
LLDB
(lldb) platform select remote-linux
Platform: remote-linux
Connected: no
(lldb) platform connect connect://testbox:1234
Platform: remote-linux
Triple: powerpc64-vrag-linux
OS Version: 6.4.0 (6.4.0-rc6-rt8-vrag-00002-g308420dc5151)
Hostname: bf133
Connected: yes
WorkingDir: /home/root
Kernel: #1 SMP PREEMPT_RT Sun Jun 11 21:35:30 UTC 2023
(lldb) file build/src/foo
Current executable set to '/home/david/tests/vrag-linux/build/src/foo' (powerpc64).
(lldb) b main
Breakpoint 1: 2 locations.
(lldb) r
Process 461 launched: '/home/david/tests/vrag-linux/build/src/foo' (powerpc64)
Hi there from main
Hi there from foo
0123456789:;<=>?@ABCDEFGHIJKLMNO
Process 461 exited with status = 0 (0x00000000)
(lldb)
When I use the debugger protocol with codelldb to connect to lldb-server I get the following output (nvim-dap):
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
category = "console",
output = " Platform: remote-linux\n Connected: no\n\n"
},
event = "output",
seq = 4,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
category = "console",
output = " Platform: remote-linux\n Triple: powerpc64-vrag-linux\nOS Version: 6.4.0 (6.4.0-rc6-rt8-vrag-00002-g308420dc5151)\n Hostname: bf133\n Connected: yes\nWorkingDir: /home/root\n Kernel: #1 SMP PREEMPT_RT Sun Jun 11 21:35:30 UTC 2023\n\n"
},
event = "output",
seq = 5,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
event = "initialized",
seq = 6,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1672 ] "request" {
arguments = {
breakpoints = { {
line = 16
} },
lines = { 16 },
source = {
name = "foo.cpp",
path = "/home/david/tests/vrag-linux/src/foo.cpp"
},
sourceModified = false
},
command = "setBreakpoints",
seq = 2,
type = "request"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
module = {
addressRange = "FFFFFFFFFFFFFFFF",
id = "FFFFFFFFFFFFFFFF",
name = "foo",
path = "/home/david/tests/vrag-linux/build/src/foo",
symbolFilePath = "/home/david/tests/vrag-linux/build/src/foo",
symbolStatus = "Symbols loaded."
},
reason = "new"
},
event = "module",
seq = 7,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
breakpoints = { {
id = 1,
line = 16,
message = "Resolved locations: 0",
verified = true
} }
},
command = "setBreakpoints",
request_seq = 2,
seq = 8,
success = true,
type = "response"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1672 ] "request" {
arguments = {
filters = { "cpp_throw" }
},
command = "setExceptionBreakpoints",
seq = 3,
type = "request"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
command = "setExceptionBreakpoints",
request_seq = 3,
seq = 9,
success = true,
type = "response"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1672 ] "request" {
command = "configurationDone",
seq = 4,
type = "request"
}
[ DEBUG ] 2023-09-28T12:12:28Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
category = "console",
output = "Launching: /home/david/tests/vrag-linux/build/src/foo\n"
},
event = "output",
seq = 10,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
category = "console",
output = "Launched process 477\n"
},
event = "output",
seq = 11,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
command = "launch",
request_seq = 1,
seq = 12,
success = true,
type = "response"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
command = "configurationDone",
request_seq = 4,
seq = 13,
success = true,
type = "response"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
module = {
addressRange = "3FFFF7F9E000",
id = "3FFFF7F9E000",
name = "ld64.so.1",
path = "/home/david/.lldb/module_cache/remote-linux/.cache/B9E2FC14-1A0D-3AA5-FF06-162D87714892-BBEEF361/ld64.so.1",
symbolFilePath = "/home/david/.lldb/module_cache/remote-linux/.cache/B9E2FC14-1A0D-3AA5-FF06-162D87714892-BBEEF361/ld64.so.1",
symbolStatus = "Symbols loaded."
},
reason = "new"
},
event = "module",
seq = 14,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
module = {
addressRange = "3FFFF7FF2000",
id = "3FFFF7FF2000",
name = "[vdso]",
path = "[vdso]",
symbolStatus = "Symbols not found"
},
reason = "new"
},
event = "module",
seq = 15,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
module = {
addressRange = "FFFFFFFFFFFE19B8",
id = "FFFFFFFFFFFE19B8",
name = "foo",
path = "/home/david/tests/vrag-linux/build/src/foo",
symbolFilePath = "/home/david/tests/vrag-linux/build/src/foo",
symbolStatus = "Symbols loaded."
},
reason = "new"
},
event = "module",
seq = 16,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
allThreadsContinued = true,
threadId = 477
},
event = "continued",
seq = 17,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
category = "stdout",
output = "Hi there from main\r\nHi there from foo\r\n0123456789:;<=>?@ABCDEFGHIJKLMNO\r\n"
},
event = "output",
seq = 18,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
category = "console",
output = "Process exited with code 0.\n"
},
event = "output",
seq = 19,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = {
exitCode = 0
},
event = "exited",
seq = 20,
type = "event"
}
[ DEBUG ] 2023-09-28T12:12:29Z+0200 ] ...avid/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1 {
body = vim.empty_dict(),
event = "terminated",
seq = 21,
type = "event"
}
GDB stops, lldb continues but does not stop at any breakpoint. The DAP log shows that the breakpoint could not be inserted (message = "Resolved locations: 0").
I have a slight feeling that there is something wrong with the MSR - or am I mistaken - is it that there is no software debugging capability on this product? I have searched for a MSR or SPR description of the E5500 but I could not find any. Now I am really confused.
I would be very happy if someone could bring some light into this issue.