Passing by reference / "Unhandled exception: User breakpoint"

A

Andy

Hi,

I'm doing a nested pass by reference of a vector. I'm in Vis Studio 2003.

Example:

vector <unsigned long long> vect;
func1(vect);

where func1 calls func2(vect);

which calls ONLY "vect.push_back(0);"

where func1 is defined as func1(vector <unsigned long long> & vect)
and func2 is defined as func2(vector <unsigned long long> & vect).

The first two times I call func2(vect), it works fine, and on the third
time, I get an exception right on the push_back( ) call, but only when I'm
in Debug mode. Else, it works fine.

The exception is: "Unhandled exception: User breakpoint."

I can keep stepping through, and it keeps going. I get another exception of
the same type right after the last call of a function returning void. I have
breakpoints in both these spots. I can step through to the end, and the
results are fine.

Why is it throwing exceptions? What's this mean?



Thanks,
Andy
 
V

Victor Bazarov

Andy said:
I'm doing a nested pass by reference of a vector. I'm in Vis Studio 2003.

Example:

vector <unsigned long long> vect;
[...]

This is OT. 'unsigned long long' is not a standard type, you're apparently
using some MS language extensions. "User breakpoint" has nothing to do
with standard C++ either. Ask in 'microsoft.public.vc.language'.

V
 
A

Andre Kostur

Hi,

I'm doing a nested pass by reference of a vector. I'm in Vis Studio
2003.

Example:

vector <unsigned long long> vect;
func1(vect);

where func1 calls func2(vect);

which calls ONLY "vect.push_back(0);"

where func1 is defined as func1(vector <unsigned long long> & vect)
and func2 is defined as func2(vector <unsigned long long> & vect).

The first two times I call func2(vect), it works fine, and on the
third time, I get an exception right on the push_back( ) call, but
only when I'm in Debug mode. Else, it works fine.

The exception is: "Unhandled exception: User breakpoint."

I can keep stepping through, and it keeps going. I get another
exception of the same type right after the last call of a function
returning void. I have breakpoints in both these spots. I can step
through to the end, and the results are fine.

Why is it throwing exceptions? What's this mean?

Not enough information. You need to post the smallest compilable code that
shows the problem. Otherwise we're left with guessing what else you're
doing that may be causing the crash. You're probably doing something else
in func1() to cause this problem....
 
P

Pete Becker

Victor said:
This is OT. 'unsigned long long' is not a standard type,

Well, yes, but it's about to be. Should be voted in tomorrow. Besides,
just about every compiler in existence supports it.
 
A

Andy

This is OT. 'unsigned long long' is not a standard type, you're apparently
using some MS language extensions.

Pretend I used unsigned int, as it still happens.

"User breakpoint" has nothing to do
with standard C++ either. Ask in 'microsoft.public.vc.language'.

V

Good to know, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top