Citando Pete Delaney <pdela...@silver-peak.com>:

> I've never found KGDB or JTAG debugging very useful for user space  
> applications.
> On Xtensa, with JTAG and GDB, we did use the PC and a bit of the  
> context is user space to understand
> The context of a TLB miss. That was a bit helpful for cache alias issues.

Hello Pete,

Thanks for your answer. From the above paragraph, I deduce that is  
indeed possible (with KGDB) to debug not only the target kernel, but  
also the target's applications. Is that right? I've searched all over  
Google, but as I've mentioned previously the documentation doesn't  
refer the (im)possibility of this scenario. From using KGDB / GDB  
empirically, I understand that I can run GDB on the target and control  
it remotely on the host (via the terminal emulator while the target  
system is running, i. e. KGDB isn't enabled), but this seems to be a  
strange and unreliable way to do it (alternating between KGDB and  
GDB). Am I thinking correctly?

Also, while experimenting with KGDB / GDB, more doubts emerged. If  
it's not too much, I would like to know if:

1 - Breakpoints accept physical addresses or virtual addresses?

2 - I know it's possible to change the value of a register with the  
"set" command. It is also possible to change an instruction (code  
segment)? And what about a data segment (memory zone)?

3 - Let's assume that I set a breakpoint in a certain line of code, on  
a C file. Since that line will certainly be transformed into several  
assembly lines by the compiler, how will I know in which assembly line  
the breakpoint will really be? In other words, what's the granularity  
of KGDB / GDB breakpoints?

I'm still reading the documentation for both debuggers  
(https://sourceware.org/gdb/onlinedocs/gdb/index.html and  
https://www.kernel.org/pub/linux/kernel/people/jwessel/kgdb/), so  
let's see if I have any luck on the meantime. I'm assuming these are  
the best sources of documentation, but if you know other valuable  
resources I'd appreciate if you can share it with me. Also, if you  
know the answer to any of the questions above, that would be awesome.

Thanks for reading, all the best,
João

>
> ARM has a $100,000 Corsight debugger which has the ability to  
> profile both the
> Kernel and user space applications; perhaps debugging the  
> application was also supported;
> Ir was pretty slick.
>
> Perhaps that demo was done on a M-series Chip. At an ARM lecture  
> they mentioned that the M-series handles Exception
> In a why which is compatible with the C-ABI. This makes it so that  
> exceptions can be
> Back-traced with gdb; perhaps even across the user-space to kernel  
> exceptions.
>
> -piet
>
> --
> Pete/Piet Delaney
> O: +1 408 935-1813
> C: +1 408 646-8557
> H: +1 408 243-8872
> Home Email: piet.dela...@gmail.com
>
>
>
>
> -----Original Message-----
> From: joaoandrefe...@sapo.pt [mailto:joaoandrefe...@sapo.pt]
> Sent: Monday, October 20, 2014 9:26 AM
> To: kgdb-bugreport@lists.sourceforge.net
> Subject: [Kgdb-bugreport] Can KGDB also debug applications?
>
> Hello all, again,
>
> I'm using KGDB to interrupt and debug the linux kernel on a target  
> machine, and I'm noq wondering if I can do the same at application  
> level, i.e. interrupt / debug a application (not a kernel module) of  
> my choice, that would be running on the target machine. I know that  
> supposedly GDB is intended to debug applications and KGDB the  
> kernel, but this is a feature that quite I'm interested in, and  
> despite the intensive search, I haven't reached a conclusion. What I  
> found was the mention of the typical scenarios where GDB debugs  
> applications, and KGDB the kernel.
>
> Thanks for reading,
> João
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Kgdb-bugreport mailing list
> Kgdb-bugreport@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport



------------------------------------------------------------------------------
_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to