This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [Patch, microblaze]: Port of Linux gdbserver
- From: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- To: Pedro Alves <palves at redhat dot com>, Michael Eager <eager at eagercon dot com>, Joel Brobecker <brobecker at adacore dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, "Nagaraju Mekala" <nmekala at xilinx dot com>
- Date: Tue, 30 Sep 2014 13:27:45 +0000
- Subject: RE: [Patch, microblaze]: Port of Linux gdbserver
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp dot mailfrom=ajit dot kumar dot agarwal at xilinx dot com;
- References: <2570e3c7-f55b-45cd-aa6e-7f4fa145f32a at BN1BFFO11FD002 dot protection dot gbl> <541052B5 dot 5080503 at eagercon dot com> <20140910134606 dot GO28404 at adacore dot com> <050c6461-c35c-441d-9b63-7636d9164e2e at BL2FFO11FD048 dot protection dot gbl> <20140910144313 dot GP28404 at adacore dot com> <89d100d8-4ebd-4f50-b5e9-59312124db6a at BL2FFO11FD057 dot protection dot gbl> <54131362 dot 1050009 at eagercon dot com> <daf38849-83e4-44a7-8903-a5251b5bbbbd at BY2FFO11FD021 dot protection dot gbl> <54186D95 dot 4000301 at redhat dot com> <84be59b9-9f3c-4789-8313-ca3b6061cd1d at BY2FFO11FD003 dot protection dot gbl> <54194300 dot 5090908 at redhat dot com> <517d120e-6565-406f-acc6-186bb63342fe at BN1BFFO11FD026 dot protection dot gbl> <542A9762 dot 1060407 at redhat dot com>
-----Original Message-----
From: Pedro Alves [mailto:palves@redhat.com]
Sent: Tuesday, September 30, 2014 5:14 PM
To: Ajit Kumar Agarwal; Michael Eager; Joel Brobecker
Cc: gdb-patches@sourceware.org; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch, microblaze]: Port of Linux gdbserver
On 09/23/2014 01:49 PM, Ajit Kumar Agarwal wrote:
>>>> >>> Note nothing is done with valid_p. It's write-only. Compare with other ports, like arm-tdep.c or mips-tdep.c.
>> >
>> > Would look into this and will make the modification.
> Thanks.
>>I'd much prefer if we had that patch in the tree before accepting further patches that tweak things around register names, etc. Could you send that (as an >>independent patch, in a new thread).
I will do this and send a separate independent patch.
> +#define microblaze_num_regs \
> + (sizeof microblaze_regmap / sizeof microblaze_regmap[0])
>>#define microblaze_num_regs ARRAY_SIZE (microblaze_regmap)
> +
> +static int
> +microblaze_cannot_store_register (int regno) {
> + if (microblaze_regmap[regno] == -1 || regno == 0)
> + return 1;
> +
> + return 0;
> +}
> +
> +static int
> +microblaze_cannot_fetch_register (int regno) {
> + return 0;
> +}
> +
> +static CORE_ADDR
> +microblaze_get_pc (struct regcache *regcache) {
> + unsigned long pc;
> + collect_register_by_name (regcache, "rpc", &pc);
Empty line after declaration. In several more places in the patch.
Please fix them all.
> + return (CORE_ADDR) (pc);
> +}
> + if (regno == 0)
> + {
> + unsigned long regbuf_0 = 0;
> + /* Clobbering r0 so that it is always 0 as enforced by hardware. */
> + supply_register (regcache, regno, (const char*)®buf_0);
supply_register_zeroed (regcache, regno);
> + }
> + else
> + {
> + if (size < sizeof (long))
> + supply_register (regcache, regno, buf + sizeof (long) - size);
> + else
> + supply_register (regcache, regno, buf);
> + }
> +}
> +
> +/* Provide only a fill function for the general register set. ps_lgetregs
> + will use this for NPTL support. */
> +
> +static void microblaze_fill_gregset (struct regcache *regcache, void
> +*buf)
Line break after "static void". Function name goes on column 0:
static void
microblaze_fill_gregset (struct regcache *regcache, void *buf)
>>Please make sure that's correct throughout.
> +{
> + int i;
> +
> + for (i = 0; i < microblaze_num_regs; i++)
> + microblaze_collect_ptrace_register (regcache, i,
> + (char *) buf +
> +microblaze_regmap[i]); }
> +
> +static void
> +microblaze_store_gregset (struct regcache *regcache, const void *buf)
> +{
> + int i;
> + for (i = 0; i < microblaze_num_regs; i++)
> + supply_register (regcache, i, (char *) buf +
> +microblaze_regmap[i]); }
> +
> +#endif /* HAVE_PTRACE_GETREGS */
> +
> +static struct regset_info microblaze_regsets[] = { #ifdef
> +HAVE_PTRACE_GETREGS
>>What's the #ifdef for?
>>Did this kernel port make it upstream without PTRACE_GETREGSET?
>>If there's support for that, can you please switch to using it?
>>PTRACE_GETREGS is supposed to an old way of doing things...
> + { PTRACE_GETREGS, PTRACE_SETREGS, 0, 36 * sizeof (elf_gregset_t),
> + GENERAL_REGS, microblaze_fill_gregset, microblaze_store_gregset
> +},
> + { 0, 0, 0, -1, -1, NULL, NULL },
> +#endif /* HAVE_PTRACE_GETREGS */
> + { 0, 0, 0, -1, -1, NULL, NULL }
> +};
> +
> diff --git a/gdb/regformats/microblaze-with-stack-protect.dat
> b/gdb/regformats/microblaze-with-stack-protect.dat
> index f71c111..e349b4a 100644
> --- a/gdb/regformats/microblaze-with-stack-protect.dat
> +++ b/gdb/regformats/microblaze-with-stack-protect.dat
> @@ -1,7 +1,7 @@
> # DO NOT EDIT: generated from microblaze-with-stack-protect.xml
^^^^^^^^^^^
^^^^^^^^^^^
^^^^^^^^^^^
^^^^^^^^^^^
^^^^^^^^^^^
>>Please send a preparatory, independent, patch that updates features/Makefile instead and generates this file, in a new thread, with self-contained >>description, following the
>>checklist:
>> https://sourceware.org/gdb/wiki/ContributionChecklist
I have created this file instead of editing. I should have written as New file in the ChangeLog. Still You want me to send a separate patch.
Thanks & Regards
Ajit
> name:microblaze_with_stack_protect
> xmltarget:microblaze-with-stack-protect.xml
> -expedite:r1,pc
> +expedite:r1,rpc
> 32:r0
> 32:r1
> 32:r2
> -- 1.7.1
>
Thanks,
Pedro Alves
- References:
- [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver