Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* symbol files in python
@ 2024-05-25  8:58 Dmitry.Neverov via Gdb
  2024-06-26 17:21 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry.Neverov via Gdb @ 2024-05-25  8:58 UTC (permalink / raw)
  To: gdb

I'm trying to filter out uninitialized variables in a frame by checking
their lines in python, something like this:

sal = frame.find_sal()
frame_line = sal.line
frame_file = sal.symtab.filename

block = frame.block()
while block is not None and block.is_valid():
  for sym in block:
    if sym.line >= frame_line:
      continue
    symtab = sym.symtab
    if symtab is None or symtab.filename != frame_file:
      continue
    # otherwise show symbol as a variable
  if block.function is not None:
      break
  block = block.superblock

Is it correct to expect that symbols in blocks inside a function will
have the same file as the function's frame?

I've noticed that if I add a breakpoint in type::set_num_fields()
(gdb/gdbtypes.h:1002), symtab.filename' for 'this' is 'gdb/mdebugread.c'
and not 'gdb/gdbtypes.h'. Is it expected?

--
Dmitry

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

end of thread, other threads:[~2024-06-26 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-25  8:58 symbol files in python Dmitry.Neverov via Gdb
2024-06-26 17:21 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox