This is the mail archive of the gdb-patches@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]

[RFC] info scope function command not showing symbols properly.


I was printing symbols and got some problem in info scope.

Here is the source (case 1)

void f()
{
  {
    struct Z { virtual ~Z() { } };
    Z zz;
    Z* p = &zz;
  }
  {
    struct Z1 { virtual ~Z1() { } };
    Z1 z1;
    Z1* p1 = &z1;
  }
}

(gdb) info scope f
Scope for f:
Symbol Z is a typedef.
Symbol zz is a variable at frame base reg $rbp offset 16+-48, length 8.
Symbol p is a variable at frame base reg $rbp offset 16+-32, length 8.


Here GDB only show symbols enclosed in 1st parenthesis. why not it shows symbols
in 2nd parathions?

And if we change the source and apply some if else condition like below (case 2)

void f1()
{
  if (condition)
    {
      struct Z { virtual ~Z() { } };
      Z zz;
      Z* p = &zz;
    }
  else
    {
      struct Z1 { virtual ~Z1() { } };
      Z1 z1;
      Z1* p1 = &z1;
    }
}

(gdb) info scope f1
Scope for f1 contains no locals or arguments.

In this case GDB is not showing any symbols. If output of this case is
correct then in 1st case GDB should print like that

Scope for f contains no locals or arguments.

Please comment on this or correct me, if I'm wrong any where. Is it need to fix?

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