qemu-devel
[Top][All Lists]
Advanced

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

Re: GDB get wrong debug infos on TI DSP architecture extension


From: Alex Bennée
Subject: Re: GDB get wrong debug infos on TI DSP architecture extension
Date: Thu, 28 May 2020 09:34:19 +0100
User-agent: mu4e 1.5.1; emacs 28.0.50

casmac <1482995675@qq.com> writes:

> Hi,
> &nbsp;&nbsp; Thank you for forwarding my question to developers and sharing 
> the C6x implementation.
> &nbsp;&nbsp; Perhaps I should follow up with another problem I encountered. 
> The senerio is the&nbsp; emulator keeps running eventhough the program it 
> emulates has already exited. And it keeps retrieving instructions which are 
> all zero "instruction"(0x00000000). 
>
> &nbsp;&nbsp; It looks to me that in function cpu_exec(CPUState *cpu), the 
> following loop never terminate:
> &nbsp;&nbsp; while (!cpu_handle_exception(cpu, &amp;ret)) {
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TranslationBlock *last_tb = NULL;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int tb_exit = 0;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (!cpu_handle_interrupt(cpu, 
> &amp;last_tb)) { ... }
> &nbsp;&nbsp; Is it because cpu-&gt;exit_request remains 0 ?
>
> &nbsp;&nbsp; At what point should we make cpu-&gt;exit_request=1 ?

cpu->exit_request is set for asynchronus conditions (e.g. timer IRQs or
IO events). A number of helpers will "kick" the cpu by calling
cpu_exit().

> &nbsp;&nbsp; Thanks again!!
>
>
> regards
> xiaolei
>
>
>
> ------------------&nbsp;Original&nbsp;------------------
> From:&nbsp;"Philippe Mathieu-Daudé"<f4bug@amsat.org&gt;;
> Date:&nbsp;Wed, May 27, 2020 03:19 PM
> To:&nbsp;"casmac"<1482995675@qq.com&gt;;"qemu-devel"<qemu-devel@nongnu.org&gt;;
> Cc:&nbsp;"Taylor Simpson"<tsimpson@quicinc.com&gt;;"Alex 
> Bennée"<alex.bennee@linaro.org&gt;;"Luc Michel"<luc.michel@greensocs.com&gt;;
> Subject:&nbsp;Re: GDB get wrong debug infos on TI DSP architecture extension
>
>
>
> Hi Xiaolei,
>
> Cc'ing more developers who might answer you.
>
> On 5/27/20 8:48 AM, casmac wrote:
> &gt; Hi all,
> &gt; &nbsp;&nbsp; I am working on a TI DSP architecture extension for QEMU.
>
> FYI you can find the TI TMS320C6x target implemented here:
> https://github.com/philmd/qemu/releases/tag/target-c6x-2.4
>
> I started rebasing it to QEMU 4.2 but then got distracted.
>
> &gt; Now, we are
> &gt; adding GDB debugging features.
> &gt; &nbsp;&nbsp; We have done the following, but not sure we are on the 
> right track :
> &gt; &nbsp;&nbsp; - add a xml description file in gdb-xml, without 
> understanding the
> &gt; purpose of the file, why some architectures don't provide such xml file?
> &gt; &nbsp;&nbsp; - add ***_cpu_gdb_read_register(), 
> ***_cpu_gdb_write_register();
> &gt; &nbsp;&nbsp; - added&nbsp; dsp_cpu_get_phys_page_attrs_debug(), but 
> uncertain about
> &gt; what to return
> &gt; &nbsp; &nbsp;&nbsp; dsp_cpu_get_phys_page_attrs_debug(CPUState *cs, 
> vaddr addr,
> &gt; MemTxAttrs *attrs)
> &gt; &nbsp; &nbsp;&nbsp; {
> &gt; &nbsp; &nbsp; &nbsp; &nbsp; return addr &amp; 
> TARGET_PAGE_MASK;&nbsp;&nbsp;
> &gt; &nbsp; &nbsp;&nbsp; }
> &gt; &nbsp;&nbsp;
> &gt; &nbsp;&nbsp; We run QEMU with the these arguments
> &gt; &nbsp;&nbsp; qemu-system-dsp ... -kernel filename.out -S -s
> &gt; &nbsp;&nbsp;
> &gt; &nbsp;&nbsp; It turns out that gdb reads incorrect register values, and 
> complains
> &gt; : "warning: Target-supplied registers are not supported by the current
> &gt; architecture".
> &gt; &nbsp;&nbsp;
> &gt; &nbsp;&nbsp; Something is missing here, or we do it in a wrong 
> way.&nbsp; Any advise
> &gt; would be helpful to us.
> &gt; &nbsp;&nbsp;
> &gt; &nbsp;&nbsp; Thanks.
> &gt; &nbsp; &nbsp;
> &gt; xiaolei
> &gt; 
> &gt; &nbsp;&nbsp; ----- ti_dsp.xml&nbsp; -----
> &gt; &nbsp;&nbsp;
> &gt; &nbsp;&nbsp; <?xml version="1.0"?&gt;
> &gt; <!DOCTYPE feature SYSTEM "gdb-target.dtd"&gt;
> &gt; <feature name="org.gnu.gdb.tic3x.core"&gt;
> &gt; &nbsp;&nbsp;&nbsp; <reg name="r0"&nbsp; bitsize="32"&gt;</reg&gt;
> &gt; &nbsp;<reg name="r1"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="r2"&nbsp; bitsize="32"&gt;</reg&gt;
> &gt; &nbsp;<reg name="r3"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="r4"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="r5"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="r6"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="r7"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar0" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar1" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar2" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar3" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar4" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar5" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar6" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ar7" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="dp"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ir0" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="ir1" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="bk"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="sp"&nbsp; bitsize="32" type="data_ptr"/&gt;
> &gt; &nbsp;<reg name="st"&nbsp; bitsize="32"&gt;</reg&gt;
> &gt; &nbsp;<reg name="ie"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="if"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="iof" bitsize="32"/&gt;
> &gt; &nbsp;<reg name="rs"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="re"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="rc"&nbsp; bitsize="32"/&gt;
> &gt; &nbsp;<reg name="pc"&nbsp; bitsize="32" type="data_ptr"/&gt;
> &gt; &nbsp;<reg name="clk"&nbsp; bitsize="32"/&gt;
> &gt; </feature&gt;
> &gt; &nbsp;&nbsp;


-- 
Alex Bennée



reply via email to

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