public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] solib-display.exp: displays for local variables automatically disabled
@ 2010-11-08 13:19 Xingxing Pan
  2010-11-08 14:36 ` Jan Kratochvil
  0 siblings, 1 reply; 6+ messages in thread
From: Xingxing Pan @ 2010-11-08 13:19 UTC (permalink / raw)
  To: gdb-patches

FAIL: gdb.base/solib-display.exp: NO: continue
FAIL: gdb.base/solib-display.exp: IN: continue
FAIL: gdb.base/solib-display.exp: SEP: continue


Breakpoint 4, bar () at gdb/testsuite/gdb.base/solib-display-main.c:25^M
25        return main_global + a_local + a_static; /* break here */^M
3: c_global = 43^M
1: a_global = 41^M
(gdb) PASS: gdb.base/solib-display.exp: NO: continue
display main_global^M
4: main_global = 44^M
(gdb) PASS: gdb.base/solib-display.exp: NO: display main_global
display a_local^M
5: a_local = 45^M
(gdb) PASS: gdb.base/solib-display.exp: NO: display a_local
display a_static^M
6: a_static = 46^M
(gdb) PASS: gdb.base/solib-display.exp: NO: display a_static
start ^M
The program being debugged has been started already.^M
Start it from the beginning? (y or n) y^M
Temporary breakpoint 5 at 0x20005e0: file gdb/testsuite/gdb.base/solib-display-
main.c, line 30.^M
Starting program: gdb/testsuite/gdb.base/solib-display-main ^M
^M
Breakpoint 1, main () at gdb/testsuite/gdb.base/solib-
display-main.c:30^M30        bar ();^M
warning: Unable to display "a_static": No symbol "a_static" in current
context.^M
warning: Unable to display "a_local": No symbol "a_local" in current context.^M
4: main_global = 44^M
3: c_global = 43^M
1: a_global = 41^M
(gdb) break 25^M
Note: breakpoint 4 also set at pc 0x20005a0.^M
Breakpoint 6 at 0x20005a0: file
gdb/testsuite/gdb.base/solib-display-main.c, line
25.^M
(gdb) PASS: gdb.base/solib-display.exp: NO: break 25
continue^M
Continuing.^M
^M
Breakpoint 4, bar () at gdb/testsuite/gdb.base/solib-display-main.c:25^M
25        return main_global + a_local + a_static; /* break here */^M
4: main_global = 44^M
3: c_global = 43^M
1: a_global = 41^M
(gdb) FAIL: gdb.base/solib-display.exp: NO: continue


solib-display-main.c:

extern int foo ();

int main_global = 44;
int bar ()
{
 int a_local = 45;
 static int a_static = 46;
 return main_global + a_local + a_static; /* break here */
}

int main ()
{
 bar ();
 return foo ();
}


After restart to main, the display expressions for A_LOCAL and A_STATIC were
disabled automatically because of out of scope (which is different
from gdb-6.8).
we need to enable them.

--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-08  Pan Xingxing <panxingxing@mprc.pku.edu.cn>
+
+       * gdb.base/solib-display.exp: Add 'enable display'
+       when display expressions for local variables are
+       disabled automatically because of out of scope.
+
 2010-11-05  Doug Evans  <dje@google.com>

       * gdb.base/help.exp: Update expected output.


--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -132,6 +132,8 @@ foreach libsepdebug {NO IN SEP} {
    }

    gdb_test "" "6: a_static = 46\\r\\n4: main_global = 44\\r\\n.*"
+    gdb_test "enable display 5"
+    gdb_test "enable display 6"
    gdb_test "break [gdb_get_line_number "break here" ${testfile}.c]" \
           ".*Breakpoint.* at .*"
    gdb_test "continue" "6: a_static = 46\\r\\n5: a_local =
45\\r\\n4: main_global

= 44\\r\\n.*"

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

* Re: [patch] solib-display.exp: displays for local variables automatically disabled
  2010-11-08 13:19 [patch] solib-display.exp: displays for local variables automatically disabled Xingxing Pan
@ 2010-11-08 14:36 ` Jan Kratochvil
  2010-11-09  2:38   ` Xingxing Pan
       [not found]   ` <AANLkTin3WfSRcmZnc2jke_Pebhp0dMM5V==0CJDBR87o@mail.gmail.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Kratochvil @ 2010-11-08 14:36 UTC (permalink / raw)
  To: Xingxing Pan; +Cc: gdb-patches

On Mon, 08 Nov 2010 14:19:18 +0100, Xingxing Pan wrote:
> FAIL: gdb.base/solib-display.exp: NO: continue
> FAIL: gdb.base/solib-display.exp: IN: continue
> FAIL: gdb.base/solib-display.exp: SEP: continue

But it PASSes for me on FSF GDB HEAD and x86_64-fedora14-linux-gnu.


> warning: Unable to display "a_static": No symbol "a_static" in current context.

This means `d->exp == NULL' in do_one_display.  But the expression should be
valid, inferior has been just restarted, not reloaded.


Do you have info on your system to make the problem reproducible for me?


Thanks,
Jan

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

* Re: [patch] solib-display.exp: displays for local variables automatically disabled
  2010-11-08 14:36 ` Jan Kratochvil
@ 2010-11-09  2:38   ` Xingxing Pan
       [not found]   ` <AANLkTin3WfSRcmZnc2jke_Pebhp0dMM5V==0CJDBR87o@mail.gmail.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Xingxing Pan @ 2010-11-09  2:38 UTC (permalink / raw)
  To: gdb-patches

Hi, Jan.

I'm using GDB 7.2, GCC 4.4.2, on an ARM similar arch.

I found that after the restart,
d->exp != NULL &&  d->exp->gdbarch != get_current_arch()
was asserted, which resulted in that d->exp was assigned NULL and parsed again.

For the local variables, because of out of scope, the parse was
failed, which resulted in d->enanble_p is assigned ZERO before the
warning.
For the globals, the parse would succeed.

Is it normal to have d->exp->gdbarch != get_current_arch() after restart?

Thanks,
Pan Xingxing


2010/11/8 Jan Kratochvil <jan.kratochvil@redhat.com>:
- 隐藏引用文字 -
> On Mon, 08 Nov 2010 14:19:18 +0100, Xingxing Pan wrote:
>> FAIL: gdb.base/solib-display.exp: NO: continue
>> FAIL: gdb.base/solib-display.exp: IN: continue
>> FAIL: gdb.base/solib-display.exp: SEP: continue
>
> But it PASSes for me on FSF GDB HEAD and x86_64-fedora14-linux-gnu.
>
>
>> warning: Unable to display "a_static": No symbol "a_static" in current context.
>
> This means `d->exp == NULL' in do_one_display.  But the expression should be
> valid, inferior has been just restarted, not reloaded.
>
>
> Do you have info on your system to make the problem reproducible for me?
>
>
> Thanks,
> Jan
>

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

* Re: [patch] solib-display.exp: displays for local variables automatically disabled
       [not found]     ` <20101109024617.GA20814@host0.dyn.jankratochvil.net>
@ 2010-11-09  3:29       ` Xingxing Pan
  2010-11-09  3:51         ` Jan Kratochvil
  0 siblings, 1 reply; 6+ messages in thread
From: Xingxing Pan @ 2010-11-09  3:29 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

Hi, Jan.

I found the reason. The arch-dependented function gdbarch_init should
reuse the existing arch.
I've to say sorry that something happend during the porting, and this
problem is not common.

Thanks,
Pan Xingxing

2010/11/9 Jan Kratochvil <jan.kratochvil@redhat.com>:
> Hi Pan,
>
> On Tue, 09 Nov 2010 03:36:21 +0100, Xingxing Pan wrote:
>> Is it normal to have d->exp->gdbarch != get_current_arch() after restart?
>
> No, that is not normal.
>
> It may be something with the Thumb vs. non-Thumb arch?  I do not know much
> ARM.
>
> But at least now I can image how it can happen, I will re-check it.
>
>
> Thanks,
> Jan
>

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

* Re: [patch] solib-display.exp: displays for local variables automatically disabled
  2010-11-09  3:29       ` Xingxing Pan
@ 2010-11-09  3:51         ` Jan Kratochvil
  2010-11-09  5:40           ` Xingxing Pan
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2010-11-09  3:51 UTC (permalink / raw)
  To: Xingxing Pan; +Cc: gdb-patches

Hi Pan,

On Tue, 09 Nov 2010 04:29:28 +0100, Xingxing Pan wrote:
> I found the reason. The arch-dependented function gdbarch_init should
> reuse the existing arch.
> I've to say sorry that something happend during the porting, and this
> problem is not common.

With:
This GDB was configured as "armv5tel-unknown-linux-gnueabi".
gdb.base/solib-display-main: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
Fedora 12 arm running inside qemu-system-arm-0.12.5-1.fc13.x86_64

it also fully PASSes.  I believe there is more some ARM problem, isn't it?


Thanks,
Jan

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

* Re: [patch] solib-display.exp: displays for local variables automatically disabled
  2010-11-09  3:51         ` Jan Kratochvil
@ 2010-11-09  5:40           ` Xingxing Pan
  0 siblings, 0 replies; 6+ messages in thread
From: Xingxing Pan @ 2010-11-09  5:40 UTC (permalink / raw)
  To: gdb-patches

Hi, Jan.

ARM's code is OK. The gdb in my hand ported from ARM  has some problem.

2010/11/9 Jan Kratochvil <jan.kratochvil@redhat.com>:
> Hi Pan,
>
> On Tue, 09 Nov 2010 04:29:28 +0100, Xingxing Pan wrote:
>> I found the reason. The arch-dependented function gdbarch_init should
>> reuse the existing arch.
>> I've to say sorry that something happend during the porting, and this
>> problem is not common.
>
> With:
> This GDB was configured as "armv5tel-unknown-linux-gnueabi".
> gdb.base/solib-display-main: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
> Fedora 12 arm running inside qemu-system-arm-0.12.5-1.fc13.x86_64
>
> it also fully PASSes.  I believe there is more some ARM problem, isn't it?
>
>
> Thanks,
> Jan
>

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

end of thread, other threads:[~2010-11-09  5:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 13:19 [patch] solib-display.exp: displays for local variables automatically disabled Xingxing Pan
2010-11-08 14:36 ` Jan Kratochvil
2010-11-09  2:38   ` Xingxing Pan
     [not found]   ` <AANLkTin3WfSRcmZnc2jke_Pebhp0dMM5V==0CJDBR87o@mail.gmail.com>
     [not found]     ` <20101109024617.GA20814@host0.dyn.jankratochvil.net>
2010-11-09  3:29       ` Xingxing Pan
2010-11-09  3:51         ` Jan Kratochvil
2010-11-09  5:40           ` Xingxing Pan

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