x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to print callstack into log ?

Hey guys,

How can i print call stack into log ? In blueprint there is Stack Trace node but I can not call that directly in c++ because of linker errors.

What is the best way to print callstack in code ?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 06 '16 at 04:00 AM in C++ Programming

avatar image

Skylonxe
81 4 5 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I know it's 2 years late, but FDebug::DumpStackTraceToLog() will do exactly this.

more ▼

answered Nov 29 '18 at 08:41 PM

avatar image

Squirrlz
31 3 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
more ▼

answered Jul 06 '16 at 04:51 AM

avatar image

Shadowriver
36.6k 931 169 1111

avatar image Skylonxe Jul 06 '16 at 04:54 AM

Yes, I know but I can't belive there is not some simple function for that. But yeah, I am looking for CPU call stack, same stack which crash reporter shows.

avatar image Michael.Fortinbh Jun 13 '17 at 02:21 PM

Supposing the PDBs are loaded, you could look at / trace FWindwsPlatformStackWalk::StackWalkAndDump -- for other platforms there are other classes, each implements StackWalkAndDump.

That's what the crash reporter uses for the call stack.

avatar image L4g0 Apr 02 '18 at 05:10 PM

I found an easy way by actually causing a CallStack to happen by referencing a null pointer when the suspicious activity is believed to be happening. This, mixed with print logs helped me out. I used to do this when working with build scripts.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question