mirror of https://github.com/pwndbg/pwndbg.git
Retrieve debug info when present to show stack variables (#3451)
* Add stack variable lookup from DWARF debug info * Add get_stack_var_name to Process API * Implement get_stack_var_name for GDB * Implement get_stack_var_name for LLDB * Display stack variable names in memory view * Fix linter issue * Catch RuntimeError for stripped binaries * Skip stack vars without address * check prefix is not None instead of truthy * fix accidental spacing * address review feedback, adjust test regex, and introduce new test * fix newlines * fix lldb init * facepalm * Remove frame caching, remove import cache, and remove frame_pc parameter * Remove frame caching, remove import cache, and remove frame_pc parameter * Remove test from gdb * Add caching for get_stack_var_name * Remove unneeded variable * Add comments explaining errors * Add comments, not using the web editor... * Update test for PR #3457 * revert test name * fix test, match new schema to work on all architectures * update test name back * lldb tests fixy * just rerunning tests, had http 500 errors --------- Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>pull/3416/head^2
parent
7084a4321e
commit
832a009864
@ -0,0 +1,23 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
void inner_function(void) {
|
||||||
|
char buffer[64];
|
||||||
|
int local_var = 42;
|
||||||
|
|
||||||
|
strcpy(buffer, "Hello from inner function!");
|
||||||
|
|
||||||
|
printf("local_var = %d\n", local_var);
|
||||||
|
printf("buffer = %s\n", buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void outer_function() {
|
||||||
|
inner_function();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("Starting test program...\n");
|
||||||
|
outer_function();
|
||||||
|
printf("Done\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in new issue