Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to attach: Remote target doesn't support qGetTIBAddr packet #431

Open
jbreu opened this issue Jun 7, 2024 · 4 comments
Open

Failed to attach: Remote target doesn't support qGetTIBAddr packet #431

jbreu opened this issue Jun 7, 2024 · 4 comments

Comments

@jbreu
Copy link

jbreu commented Jun 7, 2024

Using GNU gdb (GDB) 14.2

My setup is connecting to qemu as remote target with pretty standard settings.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "gdb",
            "request": "attach",
            "executable": "dist/x86_64/kernel.bin",
            "cwd": "${workspaceFolder}",
            "valuesFormatting": "prettyPrinters",
            "target": ":1234",
            "remote": true,
            "printCalls": true,
            "stopAtConnect": true,
        }
    ]
}

Since 1 week ago, suddenly* I get following error message popup when connecting to the qemu gdb server:

grafik

Failed to attach: Remote target doesn't support qGetTIBAddr packet (from target-select remote :1234)

I wrote "suddenly" because I did not knowingly change anything related to this setup:

  • No QEMU version update (using latest)
  • No new Native Debug version (using latest)
  • No new VS Code (using latest, updated today to May version, no change in error)
  • No updated gdb version
  • No update in compiler/linker tooling
  • No code change

I have absolutely no clue why this appears now and what did impact this.

I found out that when I comment "executable": "dist/x86_64/kernel.bin",, the debugger starts normally. However, then I am obviously missing the debug symbols. Loading it later via file dist/x86_64/kernel.bin throws the error on the console, but then it works fine. But this is of course very inconvenient. It doesnt not work to put the file command in .gdbinit, this leads to the same error on startup.

Debug Console output with error:

1-gdb-set target-async on
2-list-features
3-environment-directory "C:\\Users\\Jakob\\Documents\\workspace\\os-series"
4-enable-pretty-printing
5-target-select remote :1234
add symbol table from file "build/userspace/x86_64-unknown-none/debug/helloworld"
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file 
C:\Users\Jakob\Documents\workspace\os-series\dist\x86_64\kernel.bin.
Use `info auto-load 
python-scripts [REGEXP]' to list them.
Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.
Use 'set mi-async'.

Debug Console output with manually loading the file later

1-gdb-set target-async on
2-list-features
3-environment-directory "C:\\Users\\Jakob\\Documents\\workspace\\os-series"
4-enable-pretty-printing
5-target-select remote :1234
add symbol table from file "build/userspace/x86_64-unknown-none/debug/helloworld"
Function "isr_common_stub" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.
Use 'set mi-async'.
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
6-thread-info
7-break-insert -f "c:\\Users\\Jakob\\Documents\\workspace\\os-series\\userland\\src\\libc.rs:31"
8-break-insert -f "c:\\Users\\Jakob\\Documents\\workspace\\os-series\\userland\\src\\main.rs:23"
9-break-insert -f "c:\\Users\\Jakob\\Documents\\workspace\\os-series\\kernel\\src\\process.rs:471"
10-break-insert -f "c:\\Users\\Jakob\\Documents\\workspace\\os-series\\kernel\\src\\syscall.rs:18"
No source file named c:\Users\Jakob\Documents\workspace\os-series\kernel\src\process.rs.
No source file named c:\Users\Jakob\Documents\workspace\os-series\kernel\src\syscall.rs.
11-stack-info-depth --thread 1
12-stack-list-frames --thread 1 0 2
13-stack-info-depth --thread 1
14-thread-info
15-stack-list-frames --thread 1 0 2
16-thread-info
17-thread-info
18-stack-info-depth --thread 1
19-stack-list-frames --thread 1 0 2


file dist/x86_64/kernel.bin
20-interpreter-exec console "file dist/x86_64/kernel.bin"
A program is being debugged already.
Are you sure you want to change the file? 
(y or n) [answered Y; input not from terminal]
Load new symbol table from "dist/x86_64/kernel.bin"? (y or n) [answered Y; input not from terminal]
Reading symbols from dist/x86_64/kernel.bin...
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file 
C:\Users\Jakob\Documents\workspace\os-series\dist\x86_64\kernel.bin.
Use `info auto-load 
python-scripts [REGEXP]' to list them.
Remote target doesn't support qGetTIBAddr packet
Remote target doesn't support qGetTIBAddr packet (from interpreter-exec console "file dist/x86_64/kernel.bin")
@GitMensch
Copy link
Collaborator

Please post the device console with full debug output (there are two options in launch config for that which are by default turned off) to see when the message from GDB is parsed an what it looks like.

@jbreu
Copy link
Author

jbreu commented Sep 14, 2024

Sure, I assume you mean options "printCalls" and "showDevDebugOutput"?

This gives

1-gdb-set target-async on
2-list-features
3-environment-directory "C:\\Users\\Jakob\\Documents\\workspace\\os-series"
4-enable-pretty-printing
5-target-select remote :1234
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-added","output":[["id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","auto-load safe-path"],["value","/"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"Reading symbols from C:\\Users\\Jakob\\Documents\\workspace\\os-series\\dist\\x86_64\\kernel.bin...\n"}]}
Reading symbols from C:\Users\Jakob\Documents\workspace\os-series\dist\x86_64\kernel.bin...
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","output-radix"],["value","16"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","disassembly-flavor"],["value","intel"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"add symbol table from file \"build/userspace/x86_64-unknown-none/debug/helloworld\"\n"}]}
add symbol table from file "build/userspace/x86_64-unknown-none/debug/helloworld"
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"breakpoint-created","output":[["bkpt",[["number","1"],["type","breakpoint"],["disp","keep"],["enabled","y"],["addr","0x0000000000100018"],["file","kernel/asm/boot/main.asm"],["fullname","C:\\Users\\Jakob\\Documents\\workspace\\os-series\\kernel\\asm\\boot\\main.asm"],["line","7"],["thread-groups",["i1"]],["times","0"],["original-location","*0x100018"]]]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"breakpoint-modified","output":[["bkpt",[["number","1"],["type","breakpoint"],["disp","keep"],["enabled","y"],["addr","0x0000000000100018"],["file","kernel/asm/boot/main.asm"],["fullname","C:\\Users\\Jakob\\Documents\\workspace\\os-series\\kernel\\asm\\boot\\main.asm"],["line","7"],["thread-groups",["i1"]],["times","0"],["script",null]]]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"log","content":"warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts\nof file "}]}
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"log","content":"C:\\Users\\Jakob\\Documents\\workspace\\os-series\\dist\\x86_64\\kernel.bin.\nUse `info auto-load "}]}
C:\Users\Jakob\Documents\workspace\os-series\dist\x86_64\kernel.bin.
Use `info auto-load
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"log","content":"python-scripts [REGEXP]' to list them.\n"}]}
python-scripts [REGEXP]' to list them.
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.\n"}]}
Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"Use 'set mi-async'.\n\n"}]}
Use 'set mi-async'.
GDB -> App: {"token":1,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"token":2,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["features",["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info","language-option","info-gdb-mi-command","undefined-command-error-code","exec-run-start-option","data-disassemble-a-option","simple-values-ref-types","python"]]]}}
GDB -> App: {"token":3,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["source-path","C:\\Users\\Jakob\\Documents\\workspace\\os-series;$cdir;$cwd"]]}}
GDB -> App: {"token":4,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-started","output":[["id","i1"],["pid","1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-created","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-exited","output":[["id","i1"]]}]}
GDB -> App: {"token":5,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Remote target doesn't support qGetTIBAddr packet"]]}}


@jbreu
Copy link
Author

jbreu commented Nov 17, 2024

In my blog a commenter gave a solution: https://jakobbr.eu/2024/06/02/remote-target-doesnt-support-qgettibaddr-packet/
Adding 'set osabi none' worked!
I dont close it yet, because the maintainers may want to consider this for the extension somehow?

@jbreu
Copy link
Author

jbreu commented Nov 17, 2024

Thanks @merskip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants