callstack

How can I keep a ref to an object's state at a given time?

跟風遠走 提交于 2021-02-11 12:20:53
问题 My goal is to save in a file the callstack state when an exception is raised. But I have one major restraint: I cannot touch any of the existing code. My goal is to implement that in a context where I'm unaware of the current workflow. So I can use it in any C# Project. To do so I need to have access to all the nested methods that lead to the exception but also all the method's arguments. Until now I used postsharp OnMethodBoundaryAspect which allow me to define OnEntry, OnSucess, and

What does the call stack look like in a system of nested functions, functions passed as arguments, and returned functions?

时间秒杀一切 提交于 2021-02-08 06:33:13
问题 Here is a made up example of nested functions with functions passed as parameters and functions returned: function foo() { let x = 100 function bar(a, b) { function mul(cb) { let m = x * a cb(m) } function add(cb) { let m = x + b cb(m) } function update(m) { x = m } mul(update) add(update) console.log(x) } return bar } let bar = foo() bar(2, 3) // => 203 bar(2, 3) // => 409 bar(2, 3) // => 821 bar(2, 3) // => 1645 Without figuring out potential ways in which these functions could be optimized

switching to user stack in kernel dumps

北城以北 提交于 2021-02-06 09:33:06
问题 Is there a way to switch to user mode of a particular process in a kernel dump while doing postmortem debugging ? I remember doing this while live debugging using the .process command. 回答1: .process also works in kernel dumps. First, you can find your process using !process 0 0 myprocess.exe and then switch to that process using .process <address> where <address> is the hex number after PROCESS . Note that you are still kernel debugging and you have only the physical memory of that process

Does Chrome have a built-in Call Stack?

纵然是瞬间 提交于 2021-02-05 20:15:42
问题 From Visual Studio, I'm accustomed to a call stack showing up at any breakpoint. Does Chrome have a call stack feature where I can see what functions preceded my breakpoint? If not, is there a substitute (3rd party solution that works with Chrome?) that developers use to see what functions led to a breakpoint? Edit: to be clear, I was expecting the call stack to appear within the javascript console in Chrome. 回答1: I don't know what version of Chrome you're using. I'm using Chromium 17 and the

Does Chrome have a built-in Call Stack?

别等时光非礼了梦想. 提交于 2021-02-05 19:58:21
问题 From Visual Studio, I'm accustomed to a call stack showing up at any breakpoint. Does Chrome have a call stack feature where I can see what functions preceded my breakpoint? If not, is there a substitute (3rd party solution that works with Chrome?) that developers use to see what functions led to a breakpoint? Edit: to be clear, I was expecting the call stack to appear within the javascript console in Chrome. 回答1: I don't know what version of Chrome you're using. I'm using Chromium 17 and the

NASM should I pop function argument after calling a function?

女生的网名这么多〃 提交于 2021-02-05 06:51:29
问题 Let's say I have a nasm function like this: inc: mov rax,[rsp + 8] add [rax],BYTE 1 ret And I am calling this function like this: push some_var call inc I want to pass an argument to the function through the stack, so I push some_var and then call my function. In the function my item is second on the stack so I take it like: mov rax,[rsp+8] My question is: after calling function should I somehow pop my argument from the stack? If so, can I somehow delete it from the stack, I mean pop it, but

Can I get the instance of the calling object in Java?

不打扰是莪最后的温柔 提交于 2021-02-04 17:59:05
问题 There's a library which calls my method with a few arguments. I'd like to receive another argument, but the library doesn't provide it to the method it calls. By decompiling the library, I can see that it has the argument, and it's assigned to an instance variable (not private, but not public either.) I know I can get at the variable using reflection if I have the instance, but I don't have the instance, either. Is there a way I can get at the instance? SecurityManager has getClassContext(),

Wrong line numbers from addr2line

人盡茶涼 提交于 2021-02-04 10:40:28
问题 I try to find the exact line of a call in the backtrace in C++ program. Right now I am using these lines (from the man page of backtrace) to get the trace: void *bt_buffer[1000]; char **bt_strings; int bt_nptrs = backtrace(bt_buffer, 1000); bt_strings = backtrace_symbols(bt_buffer, bt_nptrs); In bt_strings I find lines of the form ./prog() [0x402e42] Now I take the address (the hex string) and feed it to addr2line. That sometimes results in apparently wrong line numbers. Internet search led

How can I increase the maximum call stack size in Node.js

爱⌒轻易说出口 提交于 2021-01-27 12:26:55
问题 This is different to other questions regarding an error message in Node that reads RangeError: Maximum call stack size exceeded in that I know exactly why I'm getting this error message. It's happening because I'm recursing, recursing quite a lot in fact. Thanks. 回答1: From node --help : node --max-stack-size=val Update: as the comments indicate, even though the help text still lists the --max-stack-size option, in node v0.10.x you need to use --stack-size instead. node --stack-size=val 回答2:

save_stack_trace_tsk and struct stack_trace is no longer available in Linux 5.2+

瘦欲@ 提交于 2021-01-27 05:42:57
问题 In kernel version before 5.2, I use save_stack_trace_tsk to retrieve call stack. But this method is no longer available in Linux kernel 5.2+, what should I use? 回答1: This question seemed so tempting so I did some digging here is my findings. TLDR; stack_trace_save () functions replaced by arch_stack_walk() interfaces * this is part of consolidation plan and remove duplicate code. linux commit 214d8ca6ee854 provide common architecture to walking stack trace. the new interface called arch_stack