stack-trace

Recursion done inside of a variable

ε祈祈猫儿з 提交于 2019-12-04 11:55:51
I am a bit confused on how the compiler does recursion if it is in a variable. The only way to easily explain the question is if I show an example. def recur_var(s1, s2): '''Test for recursion in variables.''' if s1 == '': return s2 elif s2 == '': return s1 else: test = recur_var(s1[:-1], s2[:-1]) if s1[-1] == '1' and s2[-1] == '1': return True return test The only recursion done in the above code is inside the variable that is above in priority over everything else, besides base cases. I realize this code is all over the place in terms of what it does, but my question is, in the trace of this

How to make gdb get stacktrace repeatably?

喜欢而已 提交于 2019-12-04 11:06:46
Like in for((;;)) { gdb -batch -n -ex 'set pagination off' -ex 'thread apply all bt' ffplay_g `pidof ffplay_g` >> /tmp/qq; } , but faster, without reloading GDB and symbols every time? Backtraces need to be taken by timer, not by triggering some breakpoints. Roman Jokl Use system sleep, this gdb command should do the trick: shell sleep 1 As recommended by the comment If you want to stick with gdb, then why not script a gdb session? Your controller process can sleep for 50 ms, then wake up, send a ^C, t a a bt, c, and then go back to sleep. – Jeremy W. Sherman http://vi-server.org/vi/bin

How can I adjust the rendering of objects in a longmess?

有些话、适合烂在心里 提交于 2019-12-04 10:55:52
问题 We're slowly refactoring our large Perl application towards object-oriented interfaces, especially for data models. The annoying part is that stack traces get less useful. To give a fabricated example: Before. sub send_message { my ($user_id, $message) = @_; ... Carp::confess('test'); } # output: test at example.pm line 23 foo('42', 'Hello World') called at example.pl line 5 After. sub send_message { my ($user, $message) = @_; ... Carp::confess('test'); } # output: test at example.pm line 23

Can I get the stack traces of all threads in my c# app?

若如初见. 提交于 2019-12-04 09:12:15
问题 I'm debugging an apparent concurrency issue in a largish app that I hack on at work. The bug in question only manifests on certain lower-performance machines after running for many (12+) hours, and I have never reproduced it in the debugger. Because of this, my debugging tools are basically limited to analyzing log files. C# makes it easy to get the stack trace of the thread throwing the exception, but I'd like to additionally get the stack traces of every other thread currently executing in

How to get call graph profiling working with gcc compiled code and ARM Cortex A8 target?

妖精的绣舞 提交于 2019-12-04 09:03:26
I am biting my teeth out on this one... I need to do profiling on an ARM board and need to view call graphs. I tried with OProfile, Kernel perf and Google performance tools. All work fine but do not output any call-graph information. This led me to the conclusion that I am not compiling my code correctly. I use the following flags when compiling my C++ code: Arch specific: -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=vfpv3 General: -fexceptions -fno-strict-aliasing -D_REENTRANT -Wall -Wextra Debugging (with optimization): -O2 -g -fno-omit-frame-pointer I did a lot of Google searching

madExcept, getting top of current stack

拜拜、爱过 提交于 2019-12-04 08:59:53
In an delphi 2007 application, we have used madExcept to handle exeptions for us. We use the standard dialog, letting the user send us a report with mail if he want to. We want to add a little to this functionality. If the user choose not to send a full report, we still want to log the exception to a file, but not a full report. We want the exception class and message, and the source file and line number. The first two is easy, but I can't find a straight forward way of finding the latter. I have the full exception report in the form of an IMEException interface. As far as I can see, the call

How can you programmatically inspect the stack trace of an exception in Python?

早过忘川 提交于 2019-12-04 08:20:40
问题 When an exception occurs in Python, can you inspect the stack? Can you determine its depth? I've looked at the traceback module, but I can't figure out how to use it. My goal is to catch any exceptions that occur during the parsing of an eval expression, without catching exceptions thrown by any functions it may have called. Don't berate me for using eval. It wasn't my decision. NOTE: I want to do this programmatically, not interactively. 回答1: You can use the inspect module which has some

Is stacktrace information available in .NET release mode build?

ぃ、小莉子 提交于 2019-12-04 08:03:06
If I choose release mode to build a dll, is the stacktrace information still available? If so, then what information is unavailable in release mode? You always have stack trace information--that's a runtime feature unrelated to the build mode--but line numbers and source file names are normally unavailable in release build stack traces. You can get both line numbers and source file names in release build stack traces (including in exceptions) by altering the build configuration to create full program database (.pdb) files. To do so in Visual Studio: open your project's property pages select

Is there any way to tell the arguments of the method calling a function in c#?

坚强是说给别人听的谎言 提交于 2019-12-04 07:46:56
I'm working on a hands-off log mechanism for my c# application. Here's what I'd like it to look like: function a(arg1, arg2, arg 3.....) calls function b(arg4,arg5,arg6....) , which in turn calls log() which is than able to detect the stacktrace (this can be done via Environment.StackTrace ) and the values with which each function (e.g. a and b ) in the stacktrace is called. I want it to work in debug and release mode (or, at least, in debug mode). Is this possible to do in .net? Provably not possible: By the time b is called, the space in the stack used by a's arg1 (the IL stack, so possibly

Recreate stack trace with line numbers from user bug-report in .net?

两盒软妹~` 提交于 2019-12-04 07:44:13
问题 First, the problem: I have several free projects, and as any software they contains bugs. Some fellow users when encounter bug send me a bug-reports with stack traces. In order to simplify finding fault place, I want to see line numbers in this stack traces. If application shipped without .pdb files, then all line information is lost, so currently all my projects deployed with .pdb files, and so generated stack traces has this numbers. But! But I do not want to see this files in distribution