Skip to content

Commit ea763e3

Browse files
authored
configure.js: Allow npm install to work in git clone
* Allow npm install to work in git clone. * Use PRIx64 to avoid compiler warnings on Linux. PR-URL: #110 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
1 parent 5d63284 commit ea763e3

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

scripts/configure.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ console.log(`Installing llnode for ${lldbExe}, lldb version ${lldbVersion}`);
7070
// should stop using the mirror.
7171
if (lldbHeadersBranch != undefined) {
7272
console.log('Cloning lldb from ' + lldbHeadersBranch);
73+
child_process.execSync(`rm -rf ${lldbIncludeDir}`);
7374
child_process.execFileSync('git',
7475
['clone', '--depth=1', '-b', lldbHeadersBranch,
7576
'https://github.com/llvm-mirror/lldb.git', lldbIncludeDir],
@@ -79,6 +80,11 @@ if (lldbHeadersBranch != undefined) {
7980
// Link to the headers file so we can run gyp_llnode directly and don't need to
8081
// setup parameters to pass it.
8182
console.log(`Linking lldb to include directory ${lldbIncludeDir}`);
83+
try {
84+
fs.unlinkSync('lldb');
85+
} catch (error) {
86+
// File does not exist, no need to handle.
87+
}
8288
fs.symlinkSync(lldbIncludeDir, 'lldb');
8389

8490
// npm explore has a different root folder when using -g
@@ -96,6 +102,7 @@ if (process.env.npm_config_global) {
96102
var gypDir = child_process.execFileSync('npm',
97103
['-g', 'explore', 'npm', 'npm', 'explore', gypSubDir, 'pwd'],
98104
{cwd: buildDir}).toString().trim();
105+
child_process.execSync('rm -rf tools');
99106
fs.mkdirSync('tools');
100107
console.log(`Linking tools/gyp to ${gypDir}/gyp`);
101108
fs.symlinkSync(`${gypDir}/gyp`, 'tools/gyp');

src/llnode.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <stdlib.h>
44
#include <string.h>
55

6+
#include <cinttypes>
7+
68
#include <lldb/API/SBExpressionOptions.h>
79

810
#include "src/llnode.h"
@@ -121,7 +123,7 @@ bool BacktraceCmd::DoExecute(SBDebugger d, char** cmd,
121123
v8::JSFrame v8_frame(&llv8, static_cast<int64_t>(frame.GetFP()));
122124
std::string res = v8_frame.Inspect(true, err);
123125
if (err.Success()) {
124-
result.Printf(" %c frame #%u: 0x%016llx %s\n", star, i, pc,
126+
result.Printf(" %c frame #%u: 0x%016" PRIx64 " %s\n", star, i, pc,
125127
res.c_str());
126128
continue;
127129
}
@@ -134,7 +136,7 @@ bool BacktraceCmd::DoExecute(SBDebugger d, char** cmd,
134136
lldb::SBMemoryRegionInfo info;
135137
if (target.GetProcess().GetMemoryRegionInfo(pc, info).Success() &&
136138
info.IsExecutable() && info.IsWritable()) {
137-
result.Printf(" %c frame #%u: 0x%016llx <builtin>\n", star, i, pc);
139+
result.Printf(" %c frame #%u: 0x%016" PRIx64 " <builtin>\n", star, i, pc);
138140
continue;
139141
}
140142
}

0 commit comments

Comments
 (0)