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

Issue 6287015: Added gdb-jit interface support for ARM. Compressed .debug_line table by 1)... (Closed)

Created:
9 years, 10 months ago by shasank.chavan
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Made changes corresponding to the most recent code review. Added gdb-jit interface support for ARM. Compressed .debug_line table by 1) removing duplicate adjacent entries having the same line number, and 2) using special opcodes to encode multiple machine register state changes in one byte. Also made a fix involving the order in which static initializers are performed. BUG=none TEST=Try enabling gdbjit for ARM and debugging.

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 11

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -27 lines) Patch
M SConstruct View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/flag-definitions.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/gdb-jit.cc View 1 2 12 chunks +95 lines, -25 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
shasank.chavan
Hi. I added a few lines to support the gdb-jit interface on ARM. I also ...
9 years, 10 months ago (2011-01-31 07:44:45 UTC) #1
Vyacheslav Egorov (Chromium)
9 years, 10 months ago (2011-02-01 12:49:51 UTC) #2
Hi Shasank,

Thanks for fixing this.

Please see review comments.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc
File src/gdb-jit.cc (right):

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode397
src/gdb-jit.cc:397: #if defined(V8_TARGET_ARCH_IA32) ||
defined(V8_TARGET_ARCH_ARM)
I think that you need to change SConstruct to enable building with gdbjit=on on
arm but I do not see it in this changelist. 

Did you accidentally omit it?

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode866
src/gdb-jit.cc:866: // <file, line, column> entries (per dwarf 2.0 standard).
Comment is slightly confusing as we do not track column information.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode890
src/gdb-jit.cc:890: intptr_t line_diff = desc_->GetScriptLineNumber(info->pos_)
- line;
I think desc_->GetScriptLineNumber(info->pos_) is already in new_line variable.
You can use it here to avoid recalculation (it has linear complexity, not O(1)
one AFAIK).

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode896
src/gdb-jit.cc:896: // If the special opcode is < 255, it can be used as a
special opcode.
I prefer to write "less than" instead of "<". 

BTW you probably meant less than or equal.

This sentence is also slightly confusing: can you please change first "special
opcode" to special_opcode.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode910
src/gdb-jit.cc:910: if (line_diff != 0) {
line_diff is guaranteed to be non-zero now.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode922
src/gdb-jit.cc:922: if (!special_opcode_used && (line_diff != 0)) {
line_diff is guaranteed to be non-zero now. 

So you can move DW_LNS_COPY emittance to the end of the else branch and remove
special_opcode_used variable.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode926
src/gdb-jit.cc:926: // Need to advance the pc to the end of the routine before
an end sequence
Empty line before comment.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode1046
src/gdb-jit.cc:1046: fwrite(entry->symfile_addr_, entry->symfile_size_, 1,
file);
I think you can use WriteBytes() utility function (see v8utils.h).

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode1060
src/gdb-jit.cc:1060: fileNum++;
it's not clear why you close the file after calling __jit_debug_register_code().

I think code will be much more compact and readable if you close the file
immediately after fwrite.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode1115
src/gdb-jit.cc:1115: static HashMap entries(&SameCodeObjects);
Google C++ Style Guide explicitly forbid non POD static variable
(http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Static...)
and recommends to use pointers. We somehow managed to overlook this point.

Can you change GetEntries so it will use pointer?

Something like:

static HashMap* GetEntries() {
  if (entries == NULL) {
    entries = new HashMap(&SameCodeObjects); 
  }
  return entries;
}

should be fine.

http://codereview.chromium.org/6287015/diff/4001/src/gdb-jit.cc#newcode1234
src/gdb-jit.cc:1234: HashMap::Entry* e =GetEntries()->Lookup(code,
HashForCodeObject(code), false);
after = add space

Powered by Google App Engine
This is Rietveld 408576698