This is the mail archive of the gdb-prs@sources.redhat.com 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]

breakpoints/1235: GDB does not set breakpoint at function correctly (IA64)


>Number:         1235
>Category:       breakpoints
>Synopsis:       GDB does not set breakpoint at function correctly (IA64)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 05 10:48:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     sana@stl.sarov.ru
>Release:        unknown-1.0
>Organization:
>Environment:
64 bit Linux, GDB 5.1
>Description:
GDB does not set breakpoint at function 'main' correctly.
Really function main start is line 37.
But GDB sets breakpoint at line 39:

This GDB was configured as "ia64-redhat-linux"...
(gdb) b main
Breakpoint 1 at 0x4000000000000f81: file namesp_08.cpp, line 39.
(gdb) r
Starting program: /home/sana/trackers/tr34260/namesp_08.exe 

Breakpoint 1, main () at namesp_08.cpp:39
39        for (ii=5; ii<nodeww.ww; ii++)
(gdb) 


Other debuggers (for example IDB) sets this breakpoint correctly with the same debug line information (the same executable file):

Linux Application Debugger for Itanium(R)-based applications, Version 7.2, Build 20030424
------------------ 
object file name: namesp_08.exe 
Reading symbolic information ...done
stop main
r
(idb) stop main
[#1: stop in int main(void) ]
(idb) r
[1] stopped at [int main(void):37 0x4000000000000f42]
     37   tt = 11;
(idb) 

It looks like GDB problem with line information.
>How-To-Repeat:
Regression test is 
namespace AA {
  int ii;
  namespace BB {
    typedef struct bb_node_tag {
      long kk;
    } bb_node;
    bb_node nodeit;
    void bar(int aa) {int cc;}
  }
  enum names_tag { CRAIG, BOB, JOE };
  enum names_tag names;
  namespace TT = BB;
}
namespace KK = AA;
namespace PP = AA::BB;

struct node_tag {
  int ww;
};
struct node_tag nodeww;
namespace CC {
  int pp;
  class class_CC {
    typedef long dummy_long;
    void foo(int aa) {dummy_long dummycc;}

  };
}
namespace AA {
  typedef char dummy;
  dummy jj;
}
using namespace AA;
using namespace CC;
int tt;
main() {
  tt = 11;
  nodeww.ww = 5;
  for (ii=5; ii<nodeww.ww; ii++)
    nodeww.ww = ii + tt;
  class_CC class_test;
}

Intel compiler is necessary to reproduce described problem.
Command line is 'ecc -g test.cpp'.

Dump of debug line information is :
Dump of debug contents of section .debug_line:

  Length:                      105
  DWARF Version:               2
  Prologue Length:             38
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  0
  Line Base:                   -1
  Line Range:                  4
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args
 The Directory Table is empty.

 The File Name Table:
  Entry Dir     Time    Size    Name
  1     0       1054273455      686     namesp_08.cpp

 Line Number Statements:
  Extended opcode 2: set Address to 0xf40
  Advance Line by 35 to 36
  Copy
  Special opcode 10: advance Address by 2 to 0xf42 and Line by 1 to 37
  Special opcode 126: advance Address by 31 to 0xf61 and Line by 1 to 38
  Special opcode 130: advance Address by 32 to 0xf81 and Line by 1 to 39
  Advance PC by 143 to 1010
  Advance Line by 1 to 40
  Copy
  Advance PC by 66 to 1052
  Advance Line by -1 to 39
  Copy
  Advance PC by 78 to 10a0
  Advance Line by 3 to 42
  Copy
  Extended opcode 2: set Address to 0x10c0
  Advance Line by -34 to 8
  Copy
  Extended opcode 2: set Address to 0x10f0
  Extended opcode 1: End of Sequence

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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