473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

stack trace in c++ application

Hello,

Is there a way to print stack trace in a c++ application?

I would like to do this before asserting in a situation that can't be handled.

Thanks,
-Ashish
Jul 22 '05 #1
4 2215
Ashish wrote:
Is there a way to print stack trace in a c++ application?
Not unless you write it yourself. There are no means in the language
to do "stack trace".
I would like to do this before asserting in a situation that can't be handled.


You should explore the means available to you in the OS and the compiler
you're using. Ask in their respective newsgroups.

V
Jul 22 '05 #2
Ashish wrote:

Hello,

Is there a way to print stack trace in a c++ application?

I would like to do this before asserting in a situation that can't be handled.


Not in a standard conforming way.
You have to consult the documentation for your system or ask in a newsgrouop
dedicated to your system if this is possible and if yes, how.
--
Karl Heinz Buchegger
kb******@gascad.at
Jul 22 '05 #3
Ashish wrote:
Hello,

Is there a way to print stack trace in a c++ application?

I would like to do this before asserting in a situation that can't be
handled.

Thanks,
-Ashish

I don't believe there is anything specifically addressing that in the C++
Standard document.**There*is*support*for*printing*backtrace s*on*all
platforms I have any familiarity with, but those are implementation
dependent.**I*just*came*across*the*discussion*on*t his*website,**It's
probably a bit deeper than you want to go, but it should give you some
insight into the current status of this type of thing in relationship to
C++.

http://www.armdevzone.com/EABI/CppABI.html
# 20th February 2004 - Latest draft (1.01) of the exception handling
components implementation (ZIP, 37KB). [Last updated 20-February-2004]
# 15th August 2003 - Latest draft of the exception handling ABI(PDF, 259KB).
[Last updated 20-February-2004]

--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
Jul 22 '05 #4
"Ashish" <as**********@yahoo.com> wrote in message
news:da**************************@posting.google.c om...
Hello,

Is there a way to print stack trace in a c++ application?

I would like to do this before asserting in a situation that can't be handled.
Thanks,
-Ashish


I would also like to see this facility in standard C++. I have just posted
in comp.std.c++ asking if this has ever been considered for inclusion in the
standard. Maybe the question has been asked there before, we'll find out.
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andy Fish | last post by:
Hi, in my c# code I have something like this: try { ... } catch (Exception ex) { ... throw ex; }
7
by: Markus Dehmann | last post by:
What's the best way to implement an exception stack trace? What I want is sth like printStackTrace() in Java. It could look like this: Car.cpp:381:runtime_exception:Could not find the brake...
1
by: Humber Consumer | last post by:
I have a simple question. I have following piece of code in a sample MFC application: void CSampleAppDlg::OnButton1() { try { char e; ...
3
by: Jeremy | last post by:
While working with ASP.NET I've sometimes encountered errors in my applications, but I've always known exactly why I'm getting the error and have been able to fix it. So I've never needed to...
2
by: RC | last post by:
I have implemented an error logging routine that writes out the stack trace (associated with the Exception object). It tells me the exact line(s) of code that lead up to the Exception. Example:...
2
by: Lasse Vågsæther Karlsen | last post by:
If I got the following code: try { // something that might throw an exception } catch (Exception ex) { // Log contents of ex here throw;
2
by: news.microsoft.com | last post by:
Hi all. If I wanted to write something so that, when an exception was thrown, and the stack unwound, the stack trace was captured with the values of the parameters (instead of just the parameter...
6
by: saju.prabhakaran | last post by:
We have an application developed in c++ and the development environment is visual studio .net 2003. We have added a cpp program to the application which will create a log file containing the trace...
5
by: Mr. SweatyFinger | last post by:
WHY CAN'T THE CLOWN -HOLES WHO WROTE ASP.NET PROVIDE AN ERROR LINE NUMBER??? HONEST TO SH@THOLE PETE Server Error in '/New Folder (7)' Application....
2
by: pavel.orehov | last post by:
Hi, I am using Environment.StackTrace to print the stack trace to the log when I have any exceptions in my application. When I work in development environment I see the line numbers in the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.