This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/4] gdb/lkd: Add Linux Kernel Awareness target
- From: Kieran Bingham <kieran dot bingham at linaro dot org>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org, arnez at linux dot vnet dot ibm dot com, jeffm at suse dot com, peter dot griffin at linaro dot org, lee dot jones at linaro dot org, russell dot wayman at linaro dot org, kernel at stlinux dot com
- Date: Tue, 1 Mar 2016 17:36:53 +0000
- Subject: Re: [PATCH 3/4] gdb/lkd: Add Linux Kernel Awareness target
- Authentication-results: sourceware.org; auth=none
- References: <1456427706-30077-1-git-send-email-kieran dot bingham at linaro dot org> <1456427706-30077-4-git-send-email-kieran dot bingham at linaro dot org> <86io169kho dot fsf at gmail dot com>
On 01/03/16 17:27, Yao Qi wrote:
> Kieran Bingham <kieran.bingham@linaro.org> writes:
>
>> Provide infrastructure and thread awareness for the Linux Kernel
>> This functionality is heavily derived from the functionality created
>> by ST Microelectronics which provides a greater feature set.
>
> In some file headers, there is such claimer
>
> Copyright 2011-2013 STMicroelectronics.
>
> the copyright should be associated to the FSF. See other GDB source
> file headers.
Yes, of course - Sorry - I'll update these. My aim was to get the code
out to review the overall implementation.
>
> Looks ST Microelectronics has already had signed copyright paper
>
> GDB/INSIGHT STMicroelectronics 2004-12-09
> Assigns past and future changes.
Excellent - I was worried about this :)
>
>>
>> This specific implementation is stripped down to provide thread
>> awareness only. Other functionality that can already be provided by python
>> infrastructure such as information gathering tools specific to linux
>> have been submitted to the linux kernel project separately.
>
> This patch includes too many things... could you split it so that the
> patch only include the very basic and simple kernel awareness feature.
> It may have bugs or may not handle some cases very well, but GDB can
> show the kernel threads. The following patches can fix these bugs and
> do improvements. For example, some commands added by this patch isn't
> necessary, nor the code for logging levels. They can be split to
> separated patches.
Ok, I can go further in the chop.
At this level, I was hoping for a review of the method of implementation
through a target layer.
>>
>> Kernel module support is also already working and available through the
>> python extensions provided by the linux kernel and has been removed from
>> this submission.
>
> I don't know how kernel module support is done through python
> extensions. I thought linux kernel module can be handled as shared
> library under the solib infrastructure. See files solib*.c.
The module list is parsed through a python command, which then searches
for the ko objects, and adds them to GDB as symbol files.
See:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/gdb/linux/modules.py
and in particular:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/gdb/linux/symbols.py
Regards
Kieran