This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] Add testcases for display function
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Fei Jie <feij dot fnst at cn dot fujitsu dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 4 Nov 2015 13:39:28 -0800
- Subject: Re: [PATCH 2/3] Add testcases for display function
- Authentication-results: sourceware.org; auth=none
- References: <1446620987-4140-1-git-send-email-feij dot fnst at cn dot fujitsu dot com> <1446620987-4140-3-git-send-email-feij dot fnst at cn dot fujitsu dot com>
> add testcases to test display under different conditions
Same kind of procedural issues as before, so I'm not going to comment
on those again.
> --- a/gdb/testsuite/gdb.base/display.c
> +++ b/gdb/testsuite/gdb.base/display.c
> @@ -4,6 +4,11 @@
> #define LOOP 10
>
> int sum = 0;
> +int int_array[2]={0,1};
The formatting does not follow the GCS:
- spaces around binary operators;
- space after comma.
Thus:
int int_array[2] = {0, 1};
> +struct {
> + char name;
> + int age;
> +} human;
GCS issues:
- the opening curly braces should be on the next line.
- the indentation level should be 2 characters.
Thus:
struct
{
char name;
int age;
} human;
> +set bp_location [gdb_get_line_number "set breakpoint 1 here"]
> +send_gdb "break $bp_location\n"
> +send_gdb "run\n"
Do not use send_gdb unless you absolutely have no other choice.
Take a look at the gdb testsuite cookbook for how to insert breakpoints
and run to them.
Also, this might no longer become relevant, but it's better to never
test the "run" command directly, since there are targets where this
is not the appropriate thing to do (Eg: when using gdbserver, we do
"set target remote ..." followed by "continue" instead).
But why not enhance display.exp instead of creating a new one?
--
Joel