From: Yao Qi <yao@codesourcery.com>
To: <gdb@sourceware.org>
Subject: Symbol can't be found unless type 'tab'
Date: Mon, 10 Sep 2012 12:52:00 -0000 [thread overview]
Message-ID: <504DE251.1020702@codesourcery.com> (raw)
Hi,
I am trying to create a piece of fake dwarf information that a 8-byte
variable 'i' occupies two registers, as below, and it seems right to me.
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0x34 (32-bit)
Version: 2
Abbrev Offset: 0
Pointer Size: 4
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_name : set-reg.c
<16> DW_AT_producer : GNU C 3.3.3
<22> DW_AT_language : 2 (non-ANSI C)
<1><23>: Abbrev Number: 2 (DW_TAG_base_type)
<24> DW_AT_name : 8byte
<2a> DW_AT_byte_size : 8
<2b> DW_AT_encoding : 7 (unsigned)
<1><2c>: Abbrev Number: 3 (DW_TAG_variable)
<2d> DW_AT_name : i
<2f> DW_AT_type : <0x23>
<33> DW_AT_location : 0x0 (location list)
Contents of the .debug_loc section:
Offset Begin End Expression
00000000 080483d5 080483e6 (DW_OP_reg2 (edx); DW_OP_piece: 4;
DW_OP_reg3 (ebx); DW_OP_piece: 4)
00000000 <End of list>
However, the symbol 'i' can't be found unless I type 'tab' after command
'p'.
(gdb) p i
No symbol "i" in current context.
(gdb) p // type 'tab'
Display all 7422 possibilities? (y or n) // type 'n'
(gdb) p/x i
$2 = 0x45396ff4bfffeff4
Turning 'debug symtab-create' on tells me that 'tab' triggers creating
symtab, and I think that is the reason 'i' can be found after typing
'tab'. What should I complete/add in my faked dwarf information so that
symbol 'i' can be found directly when the executable is loaded? without
typing 'tab' to resolve symbol 'i'.
--
Yao
next reply other threads:[~2012-09-10 12:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 12:52 Yao Qi [this message]
2012-09-10 13:18 ` Jan Kratochvil
2012-09-12 7:45 ` Yao Qi
2012-09-12 8:07 ` Jan Kratochvil
2012-09-12 11:34 ` Yao Qi
2012-09-12 12:33 ` Jan Kratochvil
2012-09-12 13:37 ` Yao Qi
2012-09-12 13:45 ` Jan Kratochvil
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=504DE251.1020702@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb@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