UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 63606

2015.1 SDK: Debugger Unable to Reach the Catch Block in MicroBlaze C++ Program

Description

I have the following C++ code running on a MicroBlaze based system: 

#include<stdio.h>
void func1( int para1) {

throw "New exception";
}

int main()
{

int vara = 10;

try {
func1(vara);
}catch(...){
vara = 20;
vara=40;
  }

return 0;
}


When I keep breakpoints within the catch block, I observe that the debugger is unable to reach the catch block.

What is causing this issue?

Solution

The issue occurs because the <iostream> header is not included.

Including the <iostream> header should resolve this issue. 


#include<stdio.h>
#include <iostream>                         -----> Make sure to include this.

void func1( int para1) {

throw "New exception";
}

int main()
{

int vara = 10;

try {
func1(vara);
}catch(...){
vara = 20;
vara=40;
  }

return 0;
}
AR# 63606
Date Created 02/17/2015
Last Updated 04/30/2015
Status Active
Type General Article
Tools
  • Vivado Design Suite
IP
  • Microblaze