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

Unified Diff: gdb/nacl-tdep.c

Issue 10798008: GDB: set correct data model for x86_64-nacl (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: extra space Created 8 years, 5 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
« no previous file with comments | « gdb/features/i386/amd64-linux.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/nacl-tdep.c
diff --git a/gdb/nacl-tdep.c b/gdb/nacl-tdep.c
index 91db26266505d7c8edc26f3f3df889bb9363a586..edb376398bc6410b8ee3b97b0125e12c7df3dab4 100644
--- a/gdb/nacl-tdep.c
+++ b/gdb/nacl-tdep.c
@@ -81,6 +81,24 @@ amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_solib_svr4_fetch_link_map_offsets (gdbarch,
svr4_lp64_fetch_link_map_offsets);
nacl_init_abi (info, gdbarch);
+
+ /* NaCl data model.
+
+ WARNING! This might confuse a lot of code, as it uses
+ if (set_gdbarch_ptr_bit (gdbarch) == <bits>)
+ to distinguish between i386 and x86_64 (lame!). Luckily, most of that
+ code is about native debugging and syscalls, so it is not used for NaCl.
+
+ TODO(eaeltsin): find better way to distinguish between i386 and x86_64! */
+ set_gdbarch_long_bit (gdbarch, 32);
+ set_gdbarch_ptr_bit (gdbarch, 32);
+
+ /* TODO(eaeltsin): we might use address size instead of pointer size to
+ distinguish between i386 and x86_64... At least address size is not
+ a property of the data model. */
+ set_gdbarch_addr_bit (gdbarch, 64);
+
+ /* How to extract addresses from registers. */
set_gdbarch_addr_bits_remove (gdbarch, amd64_nacl_addr_bits_remove);
set_gdbarch_unwind_pc (gdbarch, amd64_nacl_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, amd64_nacl_unwind_sp);
« no previous file with comments | « gdb/features/i386/amd64-linux.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698