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 c++/16180] New: print iterator+1 = Attempt to take address of value not located in memory.


https://sourceware.org/bugzilla/show_bug.cgi?id=16180

            Bug ID: 16180
           Summary: print iterator+1 = Attempt to take address of value
                    not located in memory.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: jan.kratochvil at redhat dot com
            Target: x86_64-unknown-linux-gnu

(gdb) b 8
(gdb) r
(gdb) p it
$1 = 1
(gdb) p it+1
Attempt to take address of value not located in memory.
(gdb) p it+longvar1
Attempt to take address of value not located in memory.
(gdb) p it.operator+(longvar1)
Attempt to take address of value not located in memory.
(gdb) p it.'operator+'(longvar1)
Attempt to take address of value not located in memory.
(gdb) _

GNU gdb (GDB) 7.6.50.20131109-cvs


#include <vector>
int main() {
  std::vector<int> vec;
  long longvar1(1);
  vec.push_back(1);
  vec.push_back(2);
  for (std::vector<int>::iterator it=vec.begin();it!=vec.end();it=it+1)
    ++*it;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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