Discussion: print stack...
Afficher un message
Vieux 17/10/2007, 07h56   #6
red floyd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: print stack...

James Kanze wrote:
> On Oct 16, 8:20 pm, red floyd <no.s...@here.dude> wrote:
>> call_me_anything wrote:

>
> [...]
>>> Is there something similar, which can print the current stack ?
>>> I mean some C/C++ API which can me get any info related to the
>>> current stack of functions.
>>> Thats is required for debugging.
>>> (Please do not suggest gdb... I want something similar to gdb stack
>>> traces but that should print stack info everytime I compile with DEBUG
>>> on)

>[redacted]
> Your implementation has two major problems: it requires that
> every function use the TRACE macro, it skips functions which
> don't use the macro; and it fails radically in a multi-thread
> environment.
>


1. You're right, it does require the TRACE macro and skips those that don't.

2. You're right. I wrote the original version years ago in a single
threaded environment. However, if I *really* wanted to be pedantic, I'd
note that multithreaded environments are OT in comp.lang.c++... :-).
  Réponse avec citation
 
Page generated in 0,04998 seconds with 9 queries