Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: tests/gdb/gdb_test_guest.c

Issue 10826183: GDB: Test that we can step inside function. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/gdb/gdb_test_guest.c
===================================================================
--- tests/gdb/gdb_test_guest.c (revision 9432)
+++ tests/gdb/gdb_test_guest.c (working copy)
@@ -6,8 +6,10 @@
#include <assert.h>
#include <string.h>
+#include <alloca.h>
int global_var;
+volatile void *global_ptr;
void test_two_line_function(int arg) {
global_var = arg - 1;
@@ -40,6 +42,18 @@
return global_var;
}
+/* A function with non-trivial prolog. */
+void test_step_from_function_start(int arg) {
+ int local_var = arg - 1;
+ global_var = local_var;
+ /*
+ * Force using frame pointer for this function by calling alloca.
+ * This allows to test skipping %esp modifying instructions when they
+ * are located in the middle of the function.
+ */
+ global_ptr = alloca(arg);
+}
+
int main(int argc, char **argv) {
assert(argc >= 2);
@@ -58,5 +72,10 @@
nested_calls(1);
return 0;
}
+ if (strcmp(argv[1], "step_from_func_start") == 0) {
+ global_var = 0;
+ test_step_from_function_start(2);
+ return 0;
+ }
return 1;
}
« no previous file with comments | « TOOL_REVISIONS ('k') | tests/gdb/nacl.scons » ('j') | tests/gdb/step_from_func_start.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698