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

Issue 10896004: Don't modify memory access right when changing data in debug stub. (Closed)

Created:
8 years, 3 months ago by halyavin
Modified:
8 years, 3 months ago
Reviewers:
Mark Seaborn, eaeltsin
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Don't modify memory access rights when changing data in debug stub. Add test for calling program functions from gdb. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2990 TEST= run_gdb_call_test Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=9622

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : UNREFERENCED_PARAMETER used #

Patch Set 4 : #

Total comments: 10

Patch Set 5 : #

Total comments: 11

Patch Set 6 : #

Total comments: 4

Patch Set 7 : #

Patch Set 8 : license #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -23 lines) Patch
M src/trusted/debug_stub/platform.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -4 lines 0 comments Download
M src/trusted/debug_stub/posix/platform_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +21 lines, -15 lines 0 comments Download
M src/trusted/debug_stub/target.cc View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -3 lines 0 comments Download
M src/trusted/debug_stub/win/platform_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -1 line 0 comments Download
A tests/gdb/call_from_gdb.py View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
M tests/gdb/gdb_test_guest.c View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -0 lines 0 comments Download
M tests/gdb/nacl.scons View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
halyavin
8 years, 3 months ago (2012-08-29 15:31:16 UTC) #1
eaeltsin
Am I right that IPlatform::SetMemory can be also used to modify user data? For example ...
8 years, 3 months ago (2012-08-29 16:12:17 UTC) #2
halyavin
Yes. I plan to add this test in the next CL. Andrey Khalyavin 2012/8/29 <eaeltsin@google.com> ...
8 years, 3 months ago (2012-08-29 17:03:43 UTC) #3
eaeltsin
On 2012/08/29 17:03:43, halyavin wrote: > Yes. I plan to add this test in the ...
8 years, 3 months ago (2012-08-29 17:13:09 UTC) #4
Mark Seaborn
"Don't" would be the usual tense to use in the commit message rather than "Doesn't". ...
8 years, 3 months ago (2012-08-29 17:29:43 UTC) #5
halyavin
http://codereview.chromium.org/10896004/diff/10004/src/trusted/debug_stub/platform.h File src/trusted/debug_stub/platform.h (right): http://codereview.chromium.org/10896004/diff/10004/src/trusted/debug_stub/platform.h#newcode34 src/trusted/debug_stub/platform.h:34: static bool SetMemory(struct NaClApp* nap, uint64_t address, uint32_t length, ...
8 years, 3 months ago (2012-08-30 09:46:28 UTC) #6
Mark Seaborn
Sorry to be picky -- I looked at the test more closely and realised it ...
8 years, 3 months ago (2012-08-30 16:55:57 UTC) #7
halyavin
http://codereview.chromium.org/10896004/diff/15001/src/trusted/debug_stub/posix/platform_impl.cc File src/trusted/debug_stub/posix/platform_impl.cc (right): http://codereview.chromium.org/10896004/diff/15001/src/trusted/debug_stub/posix/platform_impl.cc#newcode79 src/trusted/debug_stub/posix/platform_impl.cc:79: return false; On 2012/08/30 16:55:57, Mark Seaborn wrote: > ...
8 years, 3 months ago (2012-08-31 08:01:24 UTC) #8
Mark Seaborn
LGTM http://codereview.chromium.org/10896004/diff/26005/src/trusted/debug_stub/posix/platform_impl.cc File src/trusted/debug_stub/posix/platform_impl.cc (right): http://codereview.chromium.org/10896004/diff/26005/src/trusted/debug_stub/posix/platform_impl.cc#newcode90 src/trusted/debug_stub/posix/platform_impl.cc:90: // code via the dynamic code area the ...
8 years, 3 months ago (2012-08-31 16:40:13 UTC) #9
halyavin
8 years, 3 months ago (2012-09-03 10:33:50 UTC) #10
http://codereview.chromium.org/10896004/diff/26005/src/trusted/debug_stub/pos...
File src/trusted/debug_stub/posix/platform_impl.cc (right):

http://codereview.chromium.org/10896004/diff/26005/src/trusted/debug_stub/pos...
src/trusted/debug_stub/posix/platform_impl.cc:90: // code via the dynamic code
area the same way nacl_test.c does.
On 2012/08/31 16:40:13, Mark Seaborn wrote:
> It should be "nacl_text.c"

Done.

http://codereview.chromium.org/10896004/diff/26005/tests/gdb/gdb_test_guest.c
File tests/gdb/gdb_test_guest.c (right):

http://codereview.chromium.org/10896004/diff/26005/tests/gdb/gdb_test_guest.c...
tests/gdb/gdb_test_guest.c:86: /* Call function so that it doesn't optimized
away. */
On 2012/08/31 16:40:13, Mark Seaborn wrote:
> "doesn't get optimized".  However, this shouldn't be necessary:  it shouldn't
> get optimised away because:
>  1) we don't use link-time optimisation with gcc, and the object file for this
> file must include test_call_from_gdb();
>  2) we build with -O0.
> 
> But also this wouldn't be sufficient in the case of LTO (e.g. with PNaCl),
> because the function could get inlined away.
> 
> I'm just saying.  You don't necessarily need to change this.

Done.

Powered by Google App Engine
This is Rietveld 408576698