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 gdb/11745] New: Command 'list main' does not work on AIX


The 'list' command for gdb-6.8 compiled for AIX can't find the 'main' function 
of a program.  It reports "No line number known for main"

--- Test Source ---

~/gdb/test
imts1-AIX(1):steinr> cat take5.c
#define ONE_MINUTE 60
main()
{
int minutes = 5;

while(minutes--)
  sleep(ONE_MINUTE);
}

--- Test results for gdb-6.8 ---

~/gdb/test
imts1-AIX(1):steinr> ~/gdb/gdb-6.8/gdb/gdb take5
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.2.0.0"...
(gdb) list main
No line number known for main.
(gdb)

--- Test results for gdb-6.5 ---
However, this works fine for gdb-6.5

~/gdb/test
imts1-AIX(1):steinr> ~/gdb/gdb-6.5/gdb/gdb take5
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.3.0.0"...
(gdb) list main
1       #define ONE_MINUTE 60
2       main()
3       {
4       int minutes = 5;
5
6       while(minutes--)
7         sleep(ONE_MINUTE);
8       }
(gdb)

The above happens on AIX 5.2 and AIX 5.3

I have ported support for COBOL from gdb-5.3 to gdb-6.8.  This port does not 
work on gdb-7.1, so I need the above to work on gdb-6.8.  The above tests were 
run with an unmodified, freshly compiled gdb.  My primary issue is that when I 
use gdb against a COBOL program, I need to be able to list by the COBOL module:

--- COBOL Test Source ---

~/gdb/test
imts1-AIX(1):steinr> cat bank.cbl
       IDENTIFICATION DIVISION.
       PROGRAM-ID. "MYBANK".
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       1   ABC GLOBAL EXTERNAL.
           2 FOO PIC X(4).
       1   UVW GLOBAL EXTERNAL.
           2 BAR PIC X(5).
       1   XYZ GLOBAL EXTERNAL.
           2 BAZ PIC X(6).
       Procedure division.
       main.

           move "FOO?" to foo.
           move "BAR??" to bar.
           move "BAZ???" to baz.
           display foo.
           display bar.
           display baz.

           stop run.

~/gdb/test
imts1-AIX(1):steinr> cat makebank
#!/usr/local/bin/bash
cob2 -g  '-qLIB,PGMNAME(MIXED),NOSEPOBJ,NOSEQ,SIZE(12000k),FLAG(I,I),LINECOUNT
(0)' bank.cbl -o bank

--- Test results for gdb-6.8 with a COBOL program ---

~/gdb/test
imts1-AIX(1):steinr> ~/gdb/gdb-6.8/gdb/gdb bank
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.2.0.0"...
(gdb) list MYBANK
No line number known for MYBANK.
(gdb)

--- Test results for gdb-6.5 with a COBOL program ---

~/gdb/test
imts1-AIX(1):steinr> ~/gdb/gdb-6.5/gdb/gdb bank
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.3.0.0"...
(gdb) list MYBANK
1              IDENTIFICATION DIVISION.
2              PROGRAM-ID. "MYBANK".
3              DATA DIVISION.
4              WORKING-STORAGE SECTION.
5              1   ABC GLOBAL EXTERNAL.
6                  2 FOO PIC X(4).
7              1   UVW GLOBAL EXTERNAL.
8                  2 BAR PIC X(5).
9              1   XYZ GLOBAL EXTERNAL.
10                 2 BAZ PIC X(6).
(gdb)

Again the above is for an unmodified, freshly compiled gdb.  The COBOL support 
changes provide the ability to print and display COBOL variables.

-- 
           Summary: Command 'list main' does not work on AIX
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: rick dot stein at aciworldwide dot com
                CC: gdb-prs at sourceware dot org,rick dot stein at
                    aciworldwide dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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