This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/10738] Cannot set breakpoint on inlined function


http://sourceware.org/bugzilla/show_bug.cgi?id=10738

--- Comment #5 from Xin Tong <x.tong at utoronto dot ca> 2010-12-31 02:24:28 UTC ---
After spending sometime with gdb. i found that gdb uses two ways for the user
(or much of the code in the debugger) to reference a symbol:

1. By its address (e.g. execution stops at some address which is inside a
function in this file). The address will be noticed to be in the range of this
psymtab, and the full symtab will be read in. find_pc_function, find_pc_line,
and other find_pc_... functions handle this.

2. By its name (e.g. the user asks to print a variable, or set a breakpoint on
a function). Global names and file-scope names will be found in the psymtab,
which will cause the symtab to be pulled in. Local names will have to be
qualified by a global name, or a file-scope name, in which case we will have
already read in the symtab as we evaluated the qualifier. Or, a local symbol
can be referenced when we are "in" a local scope, in which case the first case
applies. lookup_symbol does most of the work here.

In this case, "func" is referenced by name. However, taking a look at the
psymtab 


Partial symtab for source file test.c (object 0xa5e9d60)

  Read from object file /home/tongxin1/gdb-7.2/gdb/defect_10738/test
(0xa5dd980)
  Relocate symbols by 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,  0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
  Symbols cover text addresses 0x0-0x0
  Depends on 1 other partial symtabs.
    0 0xa5e9b20 test.c


Partial symtab for source file test.c (object 0xa5e9b20)

  Read from object file /home/tongxin1/gdb-7.2/gdb/defect_10738/test
(0xa5dd980)
  Relocate symbols by 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,  0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
  Symbols cover text addresses 0x400450-0x400473
  Depends on 0 other partial symtabs.
  Global partial symbols:
    `main', function, 0x400460
  Static partial symbols:
    `size_t', type, 0x0
    `long unsigned int', type, 0x0
    `unsigned char', type, 0x0
    `short unsigned int', type, 0x0
    `unsigned int', type, 0x0
    `signed char', type, 0x0
    `short int', type, 0x0
    `int', type, 0x0
    `long int', type, 0x0
    `__off_t', type, 0x0
    `__off64_t', type, 0x0
    `long unsigned int', type, 0x0
    `char', type, 0x0
    `_IO_lock_t', type, 0x0
    `_IO_FILE', struct domain, type, 0x0
    `_IO_marker', struct domain, type, 0x0
    `bar', function, 0x400450

"func" is not even included in the psymtab. I would like some pointers at this
point. should I investigate why "func" is in dwarf2 but not in psymtab ? Any
help would be greatly appreciated.


Xin

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]