public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Symbol can't be found unless type 'tab'
@ 2012-09-10 12:52 Yao Qi
  2012-09-10 13:18 ` Jan Kratochvil
  0 siblings, 1 reply; 8+ messages in thread
From: Yao Qi @ 2012-09-10 12:52 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-12 13:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-10 12:52 Symbol can't be found unless type 'tab' Yao Qi
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

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).