From: Simon Marchi <simark@simark.ca>
To: Jan Vrany <jan@vrany.io>, Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb/testsuite: add support for running tests using QEMU
Date: Tue, 3 Nov 2026 21:36:48 -0500 [thread overview]
Message-ID: <932ebaa5-9fe6-48bc-b439-0455bf65f22c@simark.ca> (raw)
In-Reply-To: <75cc3bcfcbf89512070df156461210a721e35e17.camel@vrany.io>
On 2026-11-03 15:43, Jan Vrany wrote:
> On Tue, 2026-11-03 at 15:34 -0500, Simon Marchi wrote:
>> On 11/3/26 2:34 PM, Tom Tromey wrote:
>>>>>>>> "Jan" == Jan Vrany <jan@vrany.io> writes:
>>>
>>> Jan> + set portnum [expr {1024+round(rand()*(65535-1024))}]
>>> [...]
>>>
>>> I wonder if you considered using unix domain sockets instead.
>>>
>>> https://qemu-project.gitlab.io/qemu/system/gdb.html#using-unix-sockets
>>>
>>> With these I think you could pick the names, and more or less avoid
>>> clashes by construction.
>>
>> I suppose that this board file is not relevant for Windows? If so, then
>> it would be a good idea to try using unix sockets.
>
> I do not think we can use sockets here as this patch is using user-mode qemu,
> not system qemu.
Seems to work by just passing a path to -g:
$ qemu-arm -cpu cortex-a15 -g /tmp/qemu-gdb.sock ./bitpiece &
[1] 1783149
$ file /tmp/qemu-gdb.sock
/tmp/qemu-gdb.sock: socket
$ ~/build/binutils-gdb-all-targets/gdb/gdb -nx -q --data-directory=/home/simark/build/binutils-gdb-all-targets/gdb/data-directory -ex "tar rem /tmp/qemu-gdb.sock" -ex "b main" -ex c
Remote debugging using /tmp/qemu-gdb.sock
Reading symbols from /tmp/foo/bitpiece...
This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
_start () at bitpiece.c:13
13 __asm__ volatile("bl main\n\tmov r7, #1\n\tsvc #0");
Breakpoint 1 at 0x20164: file bitpiece.c, line 8.
Continuing.
Breakpoint 1, main () at bitpiece.c:8
8 use(in[0], in[1], in[2], in[3]);
(gdb) bt
#0 main () at bitpiece.c:8
next prev parent reply other threads:[~2026-11-04 2:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 13:59 Jan Vrany
2026-11-03 12:37 ` [PING] " Jan Vrany
2026-11-03 16:27 ` Simon Marchi
2026-11-03 19:34 ` Tom Tromey
2026-11-03 20:34 ` Simon Marchi
2026-11-03 20:43 ` Jan Vrany
2026-11-04 2:36 ` Simon Marchi [this message]
2026-11-04 10:44 ` Jan Vrany
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=932ebaa5-9fe6-48bc-b439-0455bf65f22c@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=jan@vrany.io \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox