enter image description here
I want to print Buffer member variable in buf_, in other words,
I want to p *(tensorflow::Buffer*)buf_ to print member variables in class Buffer .
Codes in tensorflow, 1.10.1 .
Class relations : class TensorBuffer is base class in tensor.h, Buffer is a template and derived class in tensor.cc
The following is the output of lldb:
frame #0: 0x0000000175abffc0
libtensorflow_framework.so`tensorflow::Tensor::Tensor(this=0x000070000cadd308, a=0x00007fd91ea61500, type=DT_STRING, shape=0x000070000cadd2f0) at tensor.cc:726:3
723 CHECK_NOTNULL(a);
724 if (shape_.num_elements() > 0 || a->ShouldAllocateEmptyTensors()) {
725 CASES(type, buf_ = new Buffer<T>(a, shape.num_elements()));
-> 726 }
(lldb) p buf_
(tensorflow::TensorBuffer *) $17 = 0x00007fd91e927c40
(lldb) p *(Buffer<std::__1::string>*)buf_
error: use of undeclared identifier 'Buffer'
error: expected '(' for function-style cast or type construction
error: expected expression
(lldb) p *(tensorflow::Buffer<std::__1::string>*)buf_
error: no member named 'Buffer' in namespace 'tensorflow'
error: expected '(' for function-style cast or type construction
error: expected expression
line 725 decode :
switch(type)
case DataTypeToEnum<string>::value :
{
typedef string T;
buf_ = new Buffer<T>(a, shape.num_elements(), allocation_attr);
}
Yes, this is a problem with reconstructing template types from the debug info. The DWARF debug info format doesn't have an abstract representation for a template. It only records instantiated templates (i.e. there is no abstract std::vector<T> but only std::vector<int>, vector<std::string>, etc.
Making up a base "std::string" type, for instance, that clang requires for casting, out of a bunch of specific instantiations, is not something lldb has been taught to do yet, and turns out to be fairly tricky.
You can work around this on an ad hoc basis by introducing typedef's for the types you want to print, e.g.:
(lldb) source list -l 1
1 #include <vector>
2 #include <string>
3 #include <stdio.h>
4
5 int
6 main()
7 {
8 using VecType = std::vector<std::string>;
9 std::vector<std::string> my_vec = {"string", "other string"};
10 void *hidden = (void *) &my_vec;
(lldb)
11 VecType *revealed = (VecType *) hidden;
12 return 0;
13 }
14
15
(lldb) expr *(std::vector<std::string> *) hidden
error: no member named 'vector' in namespace 'std'
error: expected '(' for function-style cast or type construction
error: expected expression
(lldb) expr *(VecType *) hidden
(VecType) $0 = size=2 {
[0] = "string"
[1] = "other string"
}
This is obviously not a great solution, since you have to have introduced these typedef's into your code in order to use them in the debugger. Further, you need to not just define them, but also use them, or the compiler will not emit them into the debug info. So if I left out line 11 above, I would have gotten:
(lldb) expr *(VecType *) hidden
error: use of undeclared identifier 'VecType'
we can use tensor's data() function to solve this question .
for example p (std::__1::string *)(tensor->buf_->data())
and why we can use data() function in lldb ?
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I'm currently learning how to program in C++ and one of the practical examples is to write a program showing the data types numeric limit in a table. Currently writing in repl.it before pasting to .txt and compiling using makefile. There are no resources or similar examples I could find explaining how to do this, nor have I fully grasped enough to ID the correct keywords to use.
Question
Attempt:
#include <limits>
void main()
{
number = sizeor(int)
unsign = sizeor(unsigned int)
long = sizeor(long)
longlong = sizeor(long_long)
unsignedchar = sizeor(unsigned char)
float = sizeor(float)
double = sizeor(double)
char = sizeor(char)
cout<<numeric_limits<int>::min();
cout<<numeric_limits<int>::max();
cout<<numeric_limits<int>::epsilon();
cout<<numeric_limits<double>::min();
cout<<numeric_limits<double>::max();
cout<<numeric_limits<double>::epsilon();
cout<<numeric_limits<unsign>::min();
cout<<numeric_limits<unsign>::max();
cout<<numeric_limits<unsign>::epsilon();
cout<<numeric_limits<long>::min();
cout<<numeric_limits<long>::max();
cout<<numeric_limits<long>::epsilon();
cout<<numeric_limits<longlong>::min();
cout<<numeric_limits<longlong>::max();
cout<<numeric_limits<longlong>::epsilon();
cout<<numeric_limits<unsignedchar>::min();
cout<<numeric_limits<unsignedchar>::max();
cout<<numeric_limits<unsignedchar>::epsilon();
cout<<numeric_limits<float>::min();
cout<<numeric_limits<float>::max();
cout<<numeric_limits<float>::epsilon();
cout<<numeric_limits<char>::min();
cout<<numeric_limits<char>::max();
cout<<numeric_limits<char>::epsilon();
}
Except this prints
main.cpp:5:2: error: expected function body after function declarator
number = sizeor(int)
^
main.cpp:15:2: error: unknown type name 'cout'
cout<<numeric_limits<int>::max();
^
main.cpp:15:6: error: expected unqualified-id
cout<<numeric_limits<int>::max();
^
main.cpp:16:2: error: unknown type name 'cout'
cout<<numeric_limits<int>::epsilon();
^
main.cpp:16:6: error: expected unqualified-id
cout<<numeric_limits<int>::epsilon();
^
main.cpp:18:2: error: unknown type name 'cout'
cout<<numeric_limits<double>::min();
^
main.cpp:18:6: error: expected unqualified-id
cout<<numeric_limits<double>::min();
^
main.cpp:19:2: error: unknown type name 'cout'
cout<<numeric_limits<double>::max();
^
main.cpp:19:6: error: expected unqualified-id
cout<<numeric_limits<double>::max();
^
main.cpp:20:2: error: unknown type name 'cout'
cout<<numeric_limits<double>::epsilon();
^
main.cpp:20:6: error: expected unqualified-id
cout<<numeric_limits<double>::epsilon();
^
main.cpp:22:2: error: unknown type name 'cout'
cout<<numeric_limits<unsign>::min();
^
main.cpp:22:6: error: expected unqualified-id
cout<<numeric_limits<unsign>::min();
^
main.cpp:23:2: error: unknown type name 'cout'
cout<<numeric_limits<unsign>::max();
^
main.cpp:23:6: error: expected unqualified-id
cout<<numeric_limits<unsign>::max();
^
main.cpp:24:2: error: unknown type name 'cout'
cout<<numeric_limits<unsign>::epsilon();
^
main.cpp:24:6: error: expected unqualified-id
cout<<numeric_limits<unsign>::epsilon();
^
main.cpp:26:2: error: unknown type name 'cout'
cout<<numeric_limits<long>::min();
^
main.cpp:26:6: error: expected unqualified-id
cout<<numeric_limits<long>::min();
What is the correct method to acquire the desired result and where/what are the deficiencies in my attempt that I need to correct?
There're quite a lot of errors/typos within your code.
void main() will return a '::main' must return 'int' error, the correct syntax is int main().
number = (IMO is Pythonic syntax) should be int number = , as in C++, the correct format for declaring variables is type variable_name = value;. More info here.
Variables declarations should all end with ;, or the program will return a error: expected ',' or ';' before 'int'.
A keyword such as int or char mustn't be used as a variable name.
sizeor() is not a valid operator, it's sizeof() as specified clearly in your question.
cout and numeric_limits<int>::min() is invalid, it should be std::cout and std::numeric_limits<int>::min(), or you can use using namespace std; instead. Also, when using cout, #include <iostream> must be used.
Some of the type you used is invalid, such as long_long should be long long, unsign should be unsigned int and unsignedchar should be unsigned char.
I include a little snippet of your code which have been modified here (you can build and fill in the rest from this):
#include <limits>
#include <iostream>
int main()
{
int number = sizeof(int);
int unsign = sizeof(unsigned int);
int long_ = sizeof(long);
int longlong = sizeof(long long);
int unsignedchar = sizeof(unsigned char);
int float_ = sizeof(float);
int double_ = sizeof(double);
int char_ = sizeof(char);
std::cout<<std::numeric_limits<int>::min() << "\n";
std::cout<<std::numeric_limits<unsigned char>::min() << "\n";
std::cout<<std::numeric_limits<long long>::min() << "\n";
std::cout<<std::numeric_limits<float>::min() << "\n";
}
Result:
-2147483648
-9223372036854775808
1.17549e-38
It should also be noticed that sizeof() actually "Yields the size in bytes of the object representation of type", not bits. As #Nathan Pierson mentioned, the number of bits is 8 times more than the number of bytes.
P.S: As #tadman mentioned above:
Instead of typing all of this code in and then mashing the compile
button, start with the most minimal program, ensure it compiles, and
build incrementally from there. Compile frequently. Stop adding more
code the instant you have a compile problem, fix that issue before
making things worse.
And #JaMiT :
Building on what tadman wrote, your first error is on the first line
in your main function. Try reducing your program to #include <limits> void main() { number = sizeor(int) } and focusing on what is
preventing that much from compiling. (A minimal reproducible example
is a powerful debugging tool; it doesn't matter that there is no
useful functionality yet.)
IMO, you're not really familiar with C++ syntaxes, maybe you should try some simpler program first to get the hang of it. The list of books #Richard Critten provided is very useful for beginners.
More info:
std::numeric_limits : https://en.cppreference.com/w/cpp/types/numeric_limits
sizeof() : https://en.cppreference.com/w/cpp/language/sizeof
std::cout : https://en.cppreference.com/w/cpp/io/cout
sizeof is an operator and keyword in c++, and it calculates the bytes of data type or variables during the complying time. remember that sizeof is an operator, not a function.
I am studying about templates and typename keyword I am getting error in the following code:
/*1)*/ #include<iostream>
/*2)*/ #include<cstdio>
/*3)*/ #include<stdlib.h>
/*4)*/
/*5)*/ using namespace std;
/*6)*/
/*7)*/ class out
/*8)*/ {
/*9)*/ public:
/*10)*/ int i;
/*11)*/ out(int i,int j):i{i},ob{j}{}
/*12)*/ class in
/*13)*/ {
/*14)*/ public:
/*15)*/ int j;
/*16)*/ in(int j):j{j}{}
/*17)*/ }ob;
/*18)*/ };
/*19)*/
/*20)*/ template<typename type>
/*21)*/ class temp
/*22)*/ {
/*23)*/ public:
/*24)*/ typename type::in ob(3);
/*25)*/ type ob1(4,4);
/*26)*/ };
/*27)*/
/*28)*/ int main()
/*29)*/ {
/*30)*/ out ob(1,1);
/*31)*/ out::in ob1(2);
/*32)*/ temp<out> t;
/*33)*/ cout<<ob.i<<" "<<ob.ob.j<<endl;
/*34)*/ cout<<ob1.j<<endl;
/*35)*/ cout<<t.ob.j<<endl;
/*36)*/ cout<<t.ob1.i<<" "<<t.ob1.ob.j;
/*37)*/ }
The code shows the following error
Line Error
|24| error: expected identifier before numeric constant
|24| error: expected ',' or '...' before numeric constant
|25| error: expected identifier before numeric constant
|25| error: expected ',' or '...' before numeric constant
In function 'int main()':
|35| error: 't.temp<type>::ob<out>' does not have class type
|36| error: 't.temp<type>::ob1<out>' does not have class type
|36| error: 't.temp<type>::ob1<out>' does not have class type
=== Build failed: 7 error(s), 0 warning(s) (0 minute(s), 4 second(s)) ===
If i change the two lines
typename type::in ob(3);
type ob1(4,4);
To
typename type::in ob=typename type::in(3);
type ob1=type(4,4);
It will works fine and producing following output:
1 1
2
3
4 4
Process returned 0 (0x0) execution time : 0.847 s
Press any key to continue.
But i want to know why the error shows, How can i solve the error in above code Please help me?
Thanks for helping.
If you want to initialize variables in the definition of a class you have to use assignement syntax or curly braces. Plain paranthesis is not allowed.
typename type::in ob=typename type::in(3);
type ob1=type(4,4);
typename type::in ob{3};
type ob1{4,4};
This is unrelated to templates and works the same for all classes. One of the reasons is to make parsing easier for the compiler. As mentioned in the comments most vexing parse is an example when disambiguating between an initialization and a function declaration can be done by using {} instead of ().
So I've tried to figure out what exactly the professor was writing on the board and how it answers the lab assignment we are to do.
This is the lab assignment:
Create a Hash Table and Hash map that holds all of the WORDS in the (given below) Declaration of Independence.
Handle collisions using the chain method. (Note we will not be modifying this table nor doing deletions!)
Programmatically answer the following questions:
What is the size of your hash table?
What is the longest collision (ie. Chain)
What is the most frequently used word and how did you determine it?
Create a (second) Hash Table that holds all of the LETTERS in the Declaration of Independence.
What is the size of your hash table
What letter has the longest collision?
And this is the pseudo-code with some modifications that I did to fix some errors:
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <list>
using namespace std;
class Translate
{
string word;
public:
int trans(string word);
w = word.charAT(0); //gives a letter
return #num;
};
class HashTable
{
int size();
int collision();
int length();
char fword();
public:
Translate t;
list<string> hashTable[29];
bool insert(string word)
{
hashTable[t.trans(word)].push_back(word);
return true;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
HashTable h;
open file f("hash.txt");
//h.insert(word)
while (!f.eof())
{
h.insert(f.word());
}
cout << h.size;
cout << h.collision.length;
cout << h.fword;
return 0;
}
The errors that I have are:
Error 15 error C1903: unable to recover from previous error(s); stopping compilation
Error 5 error C2014: preprocessor command must start as first nonwhite space
Error 4 error C2059: syntax error : 'return'
Error 13 error C2065: 'f' : undeclared identifier
Error 10 error C2065: 'file' : undeclared identifier
Error 8 error C2065: 'open' : undeclared identifier
Error 6 error C2143: syntax error : missing ';' before '}'
Error 1 error C2143: syntax error : missing ';' before '='
Error 11 error C2146: syntax error : missing ';' before identifier 'f'
Error 9 error C2146: syntax error : missing ';' before identifier 'file'
Error 14 error C2228: left of '.eof' must have class/struct/union
Error 3 error C2238: unexpected token(s) preceding ';'
Error 7 error C2238: unexpected token(s) preceding ';'
Error 12 error C3861: 'f': identifier not found
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 19 IntelliSense: '#' not expected here
Error 17 IntelliSense: class "std::basic_string, std::allocator>" has no member "charAT"
Error 21 IntelliSense: expected a ';'
Error 18 IntelliSense: expected a declaration
Error 22 IntelliSense: identifier "f" is undefined
Error 20 IntelliSense: identifier "open" is undefined
Error 16 IntelliSense: this declaration has no storage class or type specifier
I've never used .c_str and I'm still pretty new to C++ so my knowledge is limited. I can tell that there are places that need an identifier but I think there is a better way to create a "open file". My previous knowledge is C#, HTML, and some Python in which C++ is giving me some difficulty in learning and understanding. Any help and/or insight would be greatly appreciated!
Code is too mangled to understand. However, I'm trying my best to help with the little knowledge of mine on C++ and hash.
Proposed Code Modification
Program entry point : instead of int _tmain(int, _TCHAR*), use int main().This should guarantee you the ability to test things out should you migrate to non-windows compiler.
Source : Unicode _tmain vs main
I would like to help with the remainder, however, the code posted is way too unintelligible. Would be kind if the algorithm is posted for reference.
There are a few things you should change:
Assuming trans() is supposed to be a function definition, not a declaration, and the lines following it are supposed to be the body:
Unless you specifically want to copy the passed string, you should use const string& instead of string.
It should have braces.
w is a char.
std::string defines operator[], so it can be indexed like an array.
I'm not sure what #num is (I assume it's from Python, but I'm not familiar with that), so I'm not sure how you intend to calculate the return value.
[I will thus assume that you want to return w, but as an int instead of a char. If this is the case, it would be simpler to just return word[0];.]
There are a few issues with HashTable's members.
Member functions size(), collision(), length(), and fword() are private. This doesn't appear to be intentional.
Member variables t and hashTable are public, when you likely wanted them to be private. Again, this doesn't appear to be intentional.
The functions aren't actually defined anywhere, unless you didn't show their definitions. This will cause a linking error when you call them.
While this doesn't need to be changed, there's no reason for HashTable::insert() to actually return a value, if it's hard-coded to always return true. Also, as mentioned in 1.1 above, the parameter should probably be const string&.
_tmain() and _TCHAR are a Microsoft extensions, which is available on Visual Studio and some (but not all) compilers aiming for compatibility with it (such as C++Builder). If you want your code to be platform-independent, you likely want main(). [Note that this doesn't need to be changed. If you're only compiling with Visual Studio, you can leave it as is. If you want platform independence, you can easily define _tmain and _TCHAR yourself.]
Opening a file:
Neither open nor file are keywords in C++, nor are they types (although FILE is a C type, it doesn't appear to be what you want). You appear to want std::ifstream.
You shouldn't use !f.eof() as a condition in a while loop, because eofbit won't be set until after reading fails.
fstream has no member function word(). However, the extraction operator, operator>>() will read a single word at a time, if given a parameter that can accept one.
HashTable::size(), HashTable::collision(), HashTable::length(), and HashTable::fword() are functions. To call them, you use operator(). If you just use a function's name directly, you don't call it, but instead refer to it (this can be used to create a function pointer or function reference).
int has no member function length(). Therefore, you cannot call h.collision().length(). In C++, if you chain function calls like that, each function in the chain is treated as if it were a member function of the directly preceding type, not the leftmost type; this means that for every function after the first, the return type of the preceding function is used. (In this case, h.collision() returns an int, so .length() attempts to call member function int::length(). int isn't a class type, and thus doesn't have any member functions.)
So, considering these, your code can be modified as follows:
// Assuming your stdafx.h contains "#include <string>" and "#include <tchar.h>".
// If it doesn't, either put them there, or #include them here.
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <list>
// #4: Defining _tmain and _TCHAR
#ifndef _tmain
#define _tmain main
typedef char _TCHAR;
#endif
using namespace std;
class Translate
{
string word;
public:
// #1: Fixing trans().
int trans(const string& word)
{
char w = word[0]; // First letter of word.
return w; // Will be promoted to int.
}
};
class HashTable
{
// #2: Making member functions public, and member variables private.
Translate t;
list<string> hashTable[29];
public:
int size();
int collision();
int length();
char fword();
// #3: Making word a const reference. Changing return type to void.
void insert(const string& word)
{
hashTable[t.trans(word)].push_back(word);
}
};
int _tmain(int argc, _TCHAR* argv[])
{
HashTable h;
// #5.1: Opening the file.
ifstream f("hash.txt");
//h.insert(word)
// #5.2 & 5.3: Reading a word.
std::string word;
while (f >> word)
{
h.insert(word);
}
// #6: Calling functions.
cout << h.size();
cout << h.collision(); // #7: Assuming you wanted to output both h.collision() and
cout << h.length(); // h.length(), I put them on separate lines.
// If you actually DID want h.collision().length(), then
// h.collision() should return a type (or reference to a type)
// with member function length(), or be an instance
// (or reference to an instance) of a class with member function
// length() (instead of being a function).
cout << h.fword();
return 0;
}
You still need to provide bodies for HashTable's member functions, apart from insert(), as well as make any other modifications you desire. You might also want to remove member word from Translate, if it doesn't actually need to store a string.
I am trying to build an old binutils (2.13). getting the error ./config/obj-elf.c:364: error: invalid type argument of ‘->’ (have ‘int’) on the next line :
if (symbol_get_obj (symbolP)->local)
{...
the function symbol_get_obj :
OBJ_SYMFIELD_TYPE *
symbol_get_obj (s)
symbolS *s;
{
if (LOCAL_SYMBOL_CHECK (s))
s = local_symbol_convert ((struct local_symbol *) s);
return &s->sy_obj;
}
OBJ_SYMFIELD_TYPE is defined to be :
#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
and elf_obj_sy is
struct elf_obj_sy
{
/* Whether the symbol has been marked as local. */
int local;
/* Use this to keep track of .size expressions that involve
differences that we can't compute yet. */
expressionS *size;
/* The name specified by the .symver directive. */
char *versioned_name;
#ifdef ECOFF_DEBUGGING
/* If we are generating ECOFF debugging information, we need some
additional fields for each symbol. */
struct efdr *ecoff_file;
struct localsym *ecoff_symbol;
valueT ecoff_extern_size;
#endif
};
couldn't understand what is wrong with this code ... any advice ?
Based on the error message, one possible reason is that the declaration of the function symbol_get_obj fails to appear before the place you call it, which makes the return value default to type int, an invalid type for operator ->. You might want to check this. Make sure the correct presence of symbol_get_obj's declaration through header file inclusion or explicit function prototype.
invalid type argument of ‘->’ (have ‘int’)
That can only make sense if
symbol_get_obj(symbolP)
returns int. Which it does not.
So, the only logical conclusion is that symbol_get_obj has not been declared at the point in the code where the error occurs. In which case the compiler will assume that it is a function that returns a value of type int. Which would then explain the error message.
I'm debugging a C++ program in Xcode 5 using lldb, and I would like to evaluate arbitrary expressions in the debugger, particularly those that use overloaded operators.
For example, I created a very simple Xcode 5 C++ project with the following main.cpp and all compiler/linker/etc options set to the default:
#include <iostream>
#include <vector>
int main(int argc, const char * argv[])
{
std::vector<int> vec;
vec.push_back(42);
std::cout << "vec[0] = " << vec[0] << std::endl;
return 0;
}
I set a breakpoint on the return 0; line and ran the program.
Then, at the lldb prompt, printing the vector as a whole works fine:
(lldb) expr vec
(std::__1::vector<int, std::__1::allocator<int> >) $0 = size=1 {
[0] = 42
}
However, I can't access its members using the overloaded operator[]:
(lldb) expr vec[0]
error: call to a function 'std::__1::vector<int, std::__1::allocator<int> >::operator[](unsigned long)' ('_ZNSt3__16vectorIiNS_9allocatorIiEEEixEm') that is not present in the target
error: The expression could not be prepared to run in the target
Similarly, I can't get the iterator (though I have less experience here, so my syntax may be wrong):
(lldb) expr vector<int>::iterator it = vec.begin()
error: use of undeclared identifier 'vector'
error: expected '(' for function-style cast or type construction
error: expected '(' for function-style cast or type construction
error: 3 errors parsing expression
and
(lldb) expr (vector<int>::iterator) vec.begin()
error: use of undeclared identifier 'vector'
error: expected '(' for function-style cast or type construction
error: expected '(' for function-style cast or type construction
error: 3 errors parsing expression
Analogously, printing a simple string works fine:
(lldb) expr string("a")
(std::__1::string) $0 = "a"
However, a simple string concatenation fails:
(lldb) expr string("a") + string("b")
error: invalid operands to binary expression ('string' (aka 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >') and 'string')
error: 1 errors parsing expression
What am I doing wrong? Does lldb support evaluation with overloaded operators?
Thank you in advance!
I just ran into the same issue and apparently found a simple work-around.
You can access i-th element of a vector vec like this:
(lldb) p vec.__begin_[i]
(int) $1 = 100
Note that the C++ standard libraries are set up so that they inline all the templated functions that they can sensibly inline, and no real function copies exist. So for instance, when you go to call std::vector<int>::begin(), there is no such function. All its uses have been inlined.
That is why you are getting errors about "call to function... not present in target." There may be inlined copies of the function, but none we can actually call. As an example, if I build a little C++ program that makes a std::vector, and pushes some elements onto it and then iterates over them, and then do:
(lldb) image lookup -r -n begin
2 matches found in /private/tmp/vector:
Address: vector[0x0000000100000eaf] (vector.__TEXT.__text + 1071)
Summary: vector`main + 1071 [inlined] std::__1::vector<int, std::__1::allocator<int> >::begin() at vector.cpp:12
vector`main + 1071 at vector.cpp:12 Address: vector[0x0000000100000eaf] (vector.__TEXT.__text + 1071)
Summary: vector`main + 1071 [inlined] std::__1::vector<int, std::__1::allocator<int> >::begin() at vector.cpp:12
vector`main + 1071 at vector.cpp:12
So all the instances of the begin & end accessors for std::vector<int> are inlined. And further down in the part that comes from the std c library itself:
12 matches found in /usr/lib/libc++.1.dylib:
Address: libc++.1.dylib[0x000000000003e4ec] (libc++.1.dylib.__TEXT.__text + 252188)
Summary: libc++.1.dylib`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::begin() Address: libc++.1.dylib[0x000000000003e51c] (libc++.1.dylib.__TEXT.__text + 252236)
Summary: libc++.1.dylib`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::begin() const Address: libc++.1.dylib[0x000000000003e574] (libc++.1.dylib.__TEXT.__text + 252324)
and a few more for basic_string, and that's all. So there aren't any real implementations that we can call. Then once we've only got a little bit of the real world of these std objects available to us, the world falls apart in other odd ways as you start to push on it.
lldb isn't currently smart enough to figure out how to reconstitute a templated function/method from the C++ standard library's header files. We don't have enough of the environment in which your code was originally compiled to do that task.
Note that this isn't really a problem with overloaded operators, it is more a problem with the way the std libraries are used by the compiler. Things should work better for your own classes, where at -O0 there isn't so much inlining.