Hi Gaurav, As Ciro mentioned, I think what you need is add-symbol-file (to keep the existing symbol). To make my life easier, I would still rely on lx-symbols to load symbols for kernel modules as they are loaded, and only use add-symbol-file for the binary you want to debug along with the driver (possibly even after you are done loading kernel modules).
Best, On Tue, May 19, 2020 at 1:25 PM Ciro Santilli via gem5-dev < [email protected]> wrote: > For the gdbserver approach, I haven't found a guest to host networking > possibility in gem5 yet: > > https://stackoverflow.com/questions/48941494/how-to-do-port-forwarding-from-guest-to-host-and-vice-versa-in-gem5 > but maybe I missed it. > > For a non-gdbserver approach, have you tried add-symbol-file as > mentioned at > https://stackoverflow.com/questions/26271901/is-it-possible-to-use-gdb-and-qemu-to-debug-linux-user-space-programs-and-kernel/46636070#46636070 > and > https://stackoverflow.com/questions/20380204/how-to-load-multiple-symbol-files-in-gdb > > BTW, have a look into lx-symbols to help with kernel modules in case > you are not using it yet: > > https://cirosantilli.com/linux-kernel-module-cheat/#gdb-step-debug-kernel-module > > BTW2 Dealing with userland apps perfectly from gem5 GDB stub > (including multiple userland programs with same address) asked at: > > https://stackoverflow.com/questions/9561546/thread-aware-gdb-for-the-linux-kernel > > On Tue, May 19, 2020 at 8:03 PM GAURAV JAIN via gem5-dev > <[email protected]> wrote: > > > > Hi All, > > > > We are trying to debug an application running inside gem5 full system. > > > > After running gem5, we are using 'gdb vmlinux' to attach to it so as to > be able to debug the kernel modules. > > > > One approach we tried was using the 'file' command to load the symbol > table for the application and continue. But then that approach would > overwrite the existing symbol table (for the kernel modules) with that of > the application which is not what we desire. > > > > The second approach we tried was running 'gdbserver' inside m5term and > then connect to it through a gdb instance running on the host. > > > > We did - 'gdbserver localhost:1234 ./app', which seemed to be successful > in launching a process and Listening on the port 1234. > > > > On the host, we did - 'gdb ./app' and from inside it, 'target remote > :1234'. > > Doing this did not work and we got the generic error - 'remote:1234 > connection timed out' > > > > It'd be great if someone could provide pointers on how can we debug an > application running in gem5 full system and if either of the two approaches > mentioned above would work. > > > > Thanks, > > Gaurav > > _______________________________________________ > > gem5-dev mailing list -- [email protected] > > To unsubscribe send an email to [email protected] > > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s > _______________________________________________ > gem5-dev mailing list -- [email protected] > To unsubscribe send an email to [email protected] > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s > -- Pouya Fotouhi PhD Candidate Department of Electrical and Computer Engineering University of California, Davis _______________________________________________ gem5-dev mailing list -- [email protected] To unsubscribe send an email to [email protected] %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
