public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Andrew Burgess <aburgess@broadcom.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Disassemble over end of line table sequence.
Date: Fri, 14 Jan 2011 16:30:00 -0000	[thread overview]
Message-ID: <20110114160919.GP2504@adacore.com> (raw)
In-Reply-To: <4D08CF76.1000809@broadcom.com>

Andrew,

First, I apologize for the delay in reviewing your patch.  Looks like
we've all been very busy the last few weeks.

> 2010-12-10  Andrew Burgess  <aburgess@broadcom.com>
> 
>           * (compare_lines): Sort by pc for entries where the line
>             number is 0, these are the end of sequence markers.

I think that the patch is correct in principle, there are are a few nits
that need to be fixed before it can go in.  See below.

Note that ever line in the CL entry needs to be aligned - I can't remember
if it was you already told about this. I may have, this patch is from
4 weeks ago...

> gdb/testsuite/
> 
> 2010-12-10  Andrew Burgess  <aburgess@broadcom.com>
> 
>           * gdb.disasm/disasm-end-cu-1.c, gdb.disasm/disasm-end-cu-2.c,
>             gdb.disasm/disasm-end-cu.exp: New test for disassembling
>             over the boundary between two compilation units.

I think you got mislead a bit by the directory name when choosing
the directory where to put your testcase. This directory contains
testcase that use files with assembly code, and thus limited to
selected architectures.  Yours uses plain C files, which can be compiled
on all hosts.  So, let's move your testcase to gdb.base.

> +  /* Work with end of sequence markers
> +     where the line number is set to 0 */

The lines are too short - please join them into 1 (actually, the guideline
is 70 characters, and that means it doesn't fit, but let's make the first
line a little longer, which is a more natural length). Also, the GNU Coding
Standards (GCS) require that we put a period at the end of every sentence,
and periods are followed by 2 spaces. Thus:

  /* Work with end of sequence markers where the line number is set
     to 0. */

> +  if ( mle1->line == 0 || mle2->line == 0 )

Formatting, no space after '(' and before ')':

  if (mle1->line == 0 || mle2->line == 0)

> +      if ( val == 0 )

Same here.

> +++ b/gdb/testsuite/gdb.disasm/disasm-end-cu-1.c
> @@ -0,0 +1,14 @@
> +#include <stdio.h>

This file needs a copyright header.

> +++ b/gdb/testsuite/gdb.disasm/disasm-end-cu-2.c
> @@ -0,0 +1,13 @@
> +#include <stdio.h>

Same here.

> +++ b/gdb/testsuite/gdb.disasm/disasm-end-cu.exp
> @@ -0,0 +1,70 @@
> +# Copyright 2010 Free Software Foundation, Inc.

Can you add 2011? (And a `(C)' - this is not strictly mandated by the FSF,
but the script I'm planning on using to perform yearly updates requires it).

> +# This test can only be run on targets which support DWARF-2 and use gas.
> +# For now pick a sampling of likely targets.
> +if {![istarget *-*-linux*]
> +    && ![istarget *-*-gnu*]
> +    && ![istarget *-*-elf*]
> +    && ![istarget *-*-openbsd*]
> +    && ![istarget arm-*-eabi*]
> +    && ![istarget powerpc-*-eabi*]} {
> +    return 0

This is not necessary in your case.

> +send_gdb "disassemble /m ${main_addr},${dummy_3_addr}\n"
> +gdb_expect {
> +    -re "Dump of assembler code from ${main_addr} to

We should not be using gdb_send/gdb_expect.  Can you use gdb_test_multiple
instead?

> +gdb_stop_suppressing_tests;

You can remove this line.

-- 
Joel

  parent reply	other threads:[~2011-01-14 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 14:24 Andrew Burgess
2011-01-13 11:47 ` Andrew Burgess
2011-01-15  7:56   ` Doug Evans
2011-01-14 16:30 ` Joel Brobecker [this message]
2011-01-18 15:20   ` Andrew Burgess
2011-01-25 17:45     ` Andrew Burgess
2011-01-31  3:14     ` Joel Brobecker
2011-02-02 19:17       ` Andrew Burgess
2011-02-03  5:02         ` Joel Brobecker
2011-02-03 14:47           ` [PATCH] [COMMIT] " Andrew Burgess

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=20110114160919.GP2504@adacore.com \
    --to=brobecker@adacore.com \
    --cc=aburgess@broadcom.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).