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: Taylor Simpson
Subject: RE: GDB get wrong debug infos on TI DSP architecture extension
Date: Wed, 27 May 2020 21:41:55 +0000

For Hexagon, we have LLDB, not GDB.  I tinkered with getting LLDB to talk to 
qemu but never got if fully functional.  I'm planning to get back to it at some 
point.

With that caveat, I'll try to answer Xiaolei's questions
- The xml file is returned from qemu to gdb in response to the 
Xfer:features:read command.  Providing it should be optional unless your 
debugger requires the target to support that command.  If the target doesn't 
support this command, the debugger will generally use the qRegisterInfo command.
- I don't think get_phys_page_debug is used for gdb debugging.  Which mode are 
you implementing?  In linux-user mode, it's not needed.  In softmmu mode, it is 
used when you use "-d in_asm" to find the memory to disassemble.  If you have 
an MMU, you need to map the virtual address passed in to the physical address 
or return -1 if there is no mapping.  If there isn't a MMU, return the virtual 
address.
- The error you are getting from gdb sounds like a mismatch between the version 
of the processor that qemu is emulating and gdb thinks it is debugging.  In 
other words, qemu thinks there is a register that gdb know about.  To see 
what's going on, try adding "-d 
trace:gdbstub_io_command,trace:gdbstub_io_reply" to your qemu command line.  
This will show you the commands from gdb and qemu's response.  Look for the 
commands I described above and see if qemu is giving a register that doesn't 
exist.

HTH,
Taylor


> -----Original Message-----
> From: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> On
> Behalf Of Philippe Mathieu-Daudé
> Sent: Wednesday, May 27, 2020 2:20 AM
> To: casmac <1482995675@qq.com>; qemu-devel <qemu-
> devel@nongnu.org>
> Cc: Luc Michel <luc.michel@greensocs.com>; Alex Bennée
> <alex.bennee@linaro.org>; Taylor Simpson <tsimpson@quicinc.com>
> Subject: 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:
> > Hi all,
> >    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.
>
> > Now, we are
> > adding GDB debugging features.
> >    We have done the following, but not sure we are on the right track :
> >    - add a xml description file in gdb-xml, without understanding the
> > purpose of the file, why some architectures don't provide such xml file?
> >    - add ***_cpu_gdb_read_register(), ***_cpu_gdb_write_register();
> >    - added  dsp_cpu_get_phys_page_attrs_debug(), but uncertain about
> > what to return
> >      dsp_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
> > MemTxAttrs *attrs)
> >      {
> >         return addr & TARGET_PAGE_MASK;
> >      }
> >
> >    We run QEMU with the these arguments
> >    qemu-system-dsp ... -kernel filename.out -S -s
> >
> >    It turns out that gdb reads incorrect register values, and complains
> > : "warning: Target-supplied registers are not supported by the current
> > architecture".
> >
> >    Something is missing here, or we do it in a wrong way.  Any advise
> > would be helpful to us.
> >
> >    Thanks.
> >
> > xiaolei
> >
> >    ----- ti_dsp.xml  -----
> >
> >    <?xml version="1.0"?>
> > <!DOCTYPE feature SYSTEM "gdb-target.dtd">
> > <feature name="org.gnu.gdb.tic3x.core">
> >     <reg name="r0"  bitsize="32"></reg>
> >  <reg name="r1"  bitsize="32"/>
> >  <reg name="r2"  bitsize="32"></reg>
> >  <reg name="r3"  bitsize="32"/>
> >  <reg name="r4"  bitsize="32"/>
> >  <reg name="r5"  bitsize="32"/>
> >  <reg name="r6"  bitsize="32"/>
> >  <reg name="r7"  bitsize="32"/>
> >  <reg name="ar0" bitsize="32"/>
> >  <reg name="ar1" bitsize="32"/>
> >  <reg name="ar2" bitsize="32"/>
> >  <reg name="ar3" bitsize="32"/>
> >  <reg name="ar4" bitsize="32"/>
> >  <reg name="ar5" bitsize="32"/>
> >  <reg name="ar6" bitsize="32"/>
> >  <reg name="ar7" bitsize="32"/>
> >  <reg name="dp"  bitsize="32"/>
> >  <reg name="ir0" bitsize="32"/>
> >  <reg name="ir1" bitsize="32"/>
> >  <reg name="bk"  bitsize="32"/>
> >  <reg name="sp"  bitsize="32" type="data_ptr"/>
> >  <reg name="st"  bitsize="32"></reg>
> >  <reg name="ie"  bitsize="32"/>
> >  <reg name="if"  bitsize="32"/>
> >  <reg name="iof" bitsize="32"/>
> >  <reg name="rs"  bitsize="32"/>
> >  <reg name="re"  bitsize="32"/>
> >  <reg name="rc"  bitsize="32"/>
> >  <reg name="pc"  bitsize="32" type="data_ptr"/>
> >  <reg name="clk"  bitsize="32"/>
> > </feature>
> >
>




reply via email to

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