On 10/7/2014 1:27 PM, Frank Rowand wrote: > On 10/7/2014 12:00 PM, joaoandrefe...@sapo.pt wrote: >> Citando Frank Rowand <frowand.l...@gmail.com>: >> >>> On 10/7/2014 4:04 AM, joaoandrefe...@sapo.pt wrote: >>> >>> < snip > >>> >>>> >>>> Hello again, >>>> >>>> Just one more doubt, regarding kdmx: after researching a little bit, >>>> I need to confirm that I indeed need to use it, since that in the >>>> cases I've found the setup seemed different from mine (sharing a >>>> serial port among GDB / KGDB). I have two different physical machines >>>> (target and host), each one with its own physical serial port, and a >>>> RS-232 cable making the connection between them (I think this is the >>>> "classic" setup). Sorry for insisting but this doubt arose >>>> yesterday. >>>> >>>> In the case I really need to use kdmx, following the instructions you >>>> kindly pointed me (http://elinux.org/Kgdb), in the link to Git >>>> provided there >>>> (git://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git/) I >>>> can't seem to find the kdmx files. However, accessing the link above >>>> (strikethrough), I'm able to download a kdmx tar.gz. However, >>>> following the instructions in the README-KDMX.txt file, I'm having no >>>> luck: >>>> >>>> $ sudo make make: >>>> `kdmx' is up to date. >>>> $ sudo ./kdmx -h >>>> ./kdmx: ./kdmx: cannot execute binary file >>> >>> You should not be using sudo. You do not need superuser capabilities >>> to use kdmx. If the serial port you are using requires you to be >>> superuser to access it then you should instead modify the permissions >>> on the serial port or add your user to the group that has permissions >>> on the serial port. >>> >>> Get rid of the pre-built kdmx: >>> make clean >>> >>> (or if that does not work: rm kdmx) >>> >>> The compile kdmx: >>> make >>> >>> Then print help: >>> ./kdmx -h >> >> Even after reading the help, I'm not 100% sure whether I should run kdmx on >> the target (KGDB) or on the host (GDB). It seems to me it is meant to be run >> on the target, but if I run it there (after resuming the target kernel boot, > > Run kdmx on the host.
Here is an example, where I am using a USB serial port to connect between my host and target. I did all of the commands in "host window 1" before I did the commands in "host window 2". I did all of the commands in "host window 2" before I did the commands in "host window 3". ---------------------- HOST -------------------------------------- --- TARGET --- terminal <----> /dev/pty/29 <----> +------+ emulator | | | kdmx | <----> serial port <== cable ==> target console gdb <---------> /dev/pty/53 <----> | | /dev/ttyUSB0 +------+ ----- host window 1 - kdmx ----- $ export PS1='[1]: ' [1]: ./kdmx -n -d -p/dev/ttyUSB0 -b115200 serial port: /dev/ttyUSB0 Initalizing the serial port to 115200 8n1 /dev/pts/29 is slave pty for for terminal emulator /dev/pts/53 is slave pty for gdb ----- host window 2 - terminal emulator ----- # In this example, I am using the sysrq debug command instead of the # kernel command line 'kgdbwait' option to enter kgdb $ export PS1='[2]: ' [2]: minicom -o -w -p /dev/pts/29 # Now in minicom, connected to the target console. # CONFIG_PRINTK_TIME=y, so timestamps will be added to # printk() messages to the console. $ export PS1='% ' % cat /proc/version Linux version 3.17.0-dirty (frank@ussvlx) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Mon Oct 6 10:19:37 PDT 2014 % echo g >/proc/sysrq-trigger [ 24.246292] SysRq : DEBUG [ 24.247184] Entering KGDB ----- host window 3 - gdb ----- # current directory is the root of the kernel source tree $ export PS1='[3]: ' [3]: hostname ussvlx [3]: whoami frank [3]: pwd /xxx/git_linus/linux--3.17 [3]: echo $KBUILD_OUTPUT ../build/dragon_linus_3.17 [3]: strings $KBUILD_OUTPUT/vmlinux | grep "^Linux version" Linux version 3.17.0-dirty (frank@ussvlx) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Mon Oct 6 10:19:37 PDT 2014 Linux version [3]: gdb $KBUILD_OUTPUT/vmlinux GNU gdb (GDB) 7.3.1-gg2 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /xxx/git_linus/build/dragon_linus_3.17/vmlinux...done. (gdb) target remote /dev/pts/53 Remote debugging using /dev/pts/53 kgdb_breakpoint () at /xxx/git_linus/linux--3.17/kernel/debug/debug_core.c:1050 1050 arch_kgdb_breakpoint(); (gdb) b sys_sync Breakpoint 1 at 0xc031d450: file /xxx/git_linus/linux--3.17/fs/sync.c, line 103. (gdb) c Continuing. > > >> of course), I 'll have as output something like: >> >> /dev/pts/1 is slave pty for for terminal emulator >> /dev/pts/2 is slave pty for gdb >> >> Next, in the host machine, if I try to connect GDB to /dev/pts/2, I'll have: >> >> (gdb) target remote /dev/pts/2 >> Remote debugging using /dev/pts/2 >> Ignoring packet error, continuing... >> warning: unrecognized item "timeout" in "qSupported" response >> Ignoring packet error, continuing... >> >> What am I doing wrong? >> >> Again, thanks for everything. >> João >> > ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Kgdb-bugreport mailing list Kgdb-bugreport@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport