Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Fei Jie <feij.fnst@cn.fujitsu.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] Add testcases for display function
Date: Wed, 04 Nov 2015 21:39:00 -0000	[thread overview]
Message-ID: <20151104213928.GP4009@adacore.com> (raw)
In-Reply-To: <1446620987-4140-3-git-send-email-feij.fnst@cn.fujitsu.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


  reply	other threads:[~2015-11-04 21:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04  7:10 [PATCH 0/3] Add tesecases for examine/display/list Fei Jie
2015-11-04  7:10 ` [PATCH 3/3] Add testcases for list function Fei Jie
2015-11-04 21:42   ` Joel Brobecker
2015-11-04  7:10 ` [PATCH 1/3] Add testcases for examine function Fei Jie
2015-11-04 21:30   ` Joel Brobecker
2015-11-04 21:37   ` Andrew Burgess
2015-11-04  7:10 ` [PATCH 2/3] Add testcases for display function Fei Jie
2015-11-04 21:39   ` Joel Brobecker [this message]
2015-11-04 21:21 ` [PATCH 0/3] Add tesecases for examine/display/list Joel Brobecker
2015-11-05  8:02   ` fj
2015-11-16  1:30   ` fj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151104213928.GP4009@adacore.com \
    --to=brobecker@adacore.com \
    --cc=feij.fnst@cn.fujitsu.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox