Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: hex <heixia108@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH]Add symbol whose field 'has_type' has been set to partial symbol table
Date: Fri, 01 Nov 2013 06:29:00 -0000	[thread overview]
Message-ID: <CAB_AMN738kBWPUtCjavmwGMA8ZgphP0B0uw2SdUJ-ojUk-+oUw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

> 2013/10/30 Tom Tromey <tromey@redhat.com>
>
> >>>>> ">" == hex  <heixia108@gmail.com> writes:
>
> >> Thank you for the review. I have attached the test case.
>
> The test case needs a ChangeLog entry.
>
> I'd much prefer a test using the DWARF assembler than one using actual
> assembly code.  There are other examples in gdb.dwarf2.  The reason to
> prefer the DWARF assembler is that it is more portable.
>
> >> # You should have received a copy of the GNU General Public License
> >> # along with this program.  If not, see <http://www.gnu.org/licenses/>.
> >> load_lib dwarf.exp
>
> A blank line between the comments and the first line of code, please.
>
> >> # Test DW_OP_stack_value and DW_OP_implicit_value.
>
> This comment seems incorrect.
>
> Tom

Thank you for the comments. A new version of test file is attached.
And the original patch is at
https://sourceware.org/ml/gdb-patches/2013-10/msg00747.html.

gdb/testsuite/Changelog:

2013-11-01  Jun Gong  <heixia108@gmail.com>

      * gdb.dwarf2/const-var.exp: New file.


Jun

[-- Attachment #2: const-var.exp --]
[-- Type: application/octet-stream, Size: 1749 bytes --]

# Copyright 2013 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

load_lib dwarf.exp

# This test can only be run on targets which support DWARF-2 and use gas.
if {![dwarf2_support]} {
    return 0
}

standard_testfile main.c .S

# Create the DWARF.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
    declare_labels int_label

    cu {} {
	compile_unit {{language @DW_LANG_C}} {
	    int_label: base_type {
		{name int}
		{byte_size 4 sdata}
		{encoding @DW_ATE_signed}
	    }

	    DW_TAG_variable {
		{name const_var}
		{type :$int_label}
		{const_value 6 data1}
	    }
	}
    }
}

if  { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
	   object {nodebug}] != "" } {
    return -1
}

if  { [gdb_compile $asm_file ${binfile}2.o object {nodebug}] != "" } {
    return -1
}

if  { [gdb_compile [list ${binfile}1.o ${binfile}2.o] \
	   "${binfile}" executable {}] != "" } {
    return -1
}

clean_restart ${testfile}

if ![runto_main] {
    return -1
}

# Print const variable, test whether it has been added to partial
# symbol table.
gdb_test "print const_var" " = 6" "print const variable"

             reply	other threads:[~2013-11-01  6:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01  6:29 hex [this message]
2013-11-07 15:41 ` Tom Tromey
  -- strict thread matches above, loose matches on Subject: below --
2014-01-24  6:19 Jun Gong
2014-01-26  9:15 ` Yao Qi
2013-10-24  6:59 hex
2013-10-24 20:31 ` Tom Tromey
2013-10-25  7:41   ` hex
2013-10-29 18:34     ` Tom Tromey

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=CAB_AMN738kBWPUtCjavmwGMA8ZgphP0B0uw2SdUJ-ojUk-+oUw@mail.gmail.com \
    --to=heixia108@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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