Hi Yf,
Just look at your System.map and you will see that all those main() became
<program>_main.

It isn't possible to have a unique main() symbol, otherwise we will have a
duplicated symbol, also even if the compiler accepted that, how could NuttX
know you want to call the main from Hello instead of the main from Alarm?

BR,

Alan

On Tue, Jan 9, 2024 at 10:20 PM yfliu2008 <yfliu2...@qq.com.invalid> wrote:

> Alan,
>
>
> Thanks a lot for your warm replies.
>
>
> These apps are built with kernel mode export libraries, their entrances
> are all "main" as they each run in their user address spaces.&nbsp;
>
>
> So when gdb connected with QEMU, command&nbsp; "break qemu_rv_start"&nbsp;
> can work but "break main" simply got function not defined even though I did
> "load ../apps/bin/init". It seems to me that current gdb session is bound
> to the kernel ELF, not to the apps ELF.
>
>
>
>
> Regards,
> yf
>
>
>
>
>
> Original
>
>
>
> From:"Alan C. Assis"< acas...@gmail.com &gt;;
>
> Date:2024/1/10 8:11
>
> To:"dev"< dev@nuttx.apache.org &gt;;
>
> Subject:Re: debugging user app crashes
>
>
> Hi Yf Liu,
> I don't know if this minidump server works on 64-bit and with QEMU, but
> about the other question how to setup breakpoint in the NSH user space
> program, just set the break point to the nsh_main if you want to debug the
> NSH itself or set it to program_main to put the breakpoint to some user
> program called from NSH. For example: setting it to hello_main will cause
> the GDB to stop at hello_main when you type "nsh&gt; hello" and press
> enter.
>
> BR,
>
> Alan
>
> On Mon, Jan 8, 2024 at 9:13 PM yfliu2008  wrote:
>
> &gt; Dear community,
> &gt;
> &gt;
> &gt;
> &gt;
> &gt; I have NSH command crashes within qemu-system-riscv64 using a testing
> &gt; rv-virt/knsh configuration, I wonder what tools can I use to find the
> crash
> &gt; stack?
> &gt;
> &gt;
> &gt;
> &gt;
> &gt; I have feed console crash.log to minidumpserver.py as per this
> guide:&nbsp;
> &gt; https://nuttx.apache.org/docs/12.3.0/guides/minidumpserver.htm,&nbsp;
> but
> &gt; it seems the tool might&nbsp; not support 64bit yet?
> &gt;
> &gt;
> &gt;
> &gt;
> &gt; I've tried gdb connection with qemu-system-riscv64 as per&nbsp; this
> &gt; guide: https://nuttx.apache.org/docs/12.3.0/guides/gdbwithpython.html
> ,
> &gt; but I don't know how to set a break point in the user space NSH
> program.
> &gt;
> &gt;
> &gt;
> &gt;
> &gt; Can anyone give me a pointer?
> &gt;
> &gt;
> &gt;
> &gt;
> &gt; Regards,
> &gt;
> &gt; yf

Reply via email to