[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automating Qemu and GDB together

From: R. Diez
Subject: Re: Automating Qemu and GDB together
Date: Wed, 13 May 2020 13:28:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

First of all, thanks for your answer.

If you launch linux-user with -g 1234 or system emulation with the -S
flag the guest starts suspended until gdb attaches and continues the

Yes, that is the option I am using. But this is a different subject. If both GDB and Qemu start in parallel, GDB may try to connect before Qemu has opened its listening socket.

The gdbstub should be ready pretty early on in start-up.

"pretty early" is a very vague statement. It may hold true today, because GDB perhaps starts more slowly. But it may not hold tomorrow. GDB may get faster. Or GDB may be on disk cache and Qemu not yet. Or Qemu may start doing more and get slower.

I guess Qemu has no scripting capabilities, has it? And no events that you could hook, something like "OnReady()". It is somewhat surprising. For example, GDB and OpenOCD both have scripting capabilities.

We now have a script in tests/guest-debug/run-test.py which we use to run our
own test cases.

That script makes no pause between launching Qemu and launching GDB.

Perhaps it is not necessary after all. But that is strange. This kind of 
synchronisation problem is prevalent among servers and clients.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]