Skip to content

Commit

Permalink
fix: elf guids
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyg603 committed Feb 29, 2024
1 parent 45af5f8 commit a2c3e72
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@bugsplat/elfy": "^1.0.0",
"@bugsplat/elfy": "^1.0.1",
"@bugsplat/js-api-client": "^8.0.1",
"archiver": "^5.3.1",
"command-line-args": "^5.2.0",
Expand Down
8 changes: 4 additions & 4 deletions spec/dsym.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ describe('dsym', () => {
it('should return path, relativePath, dbgIds, module names for macho files', () => {
return expectAsync(getDSymFileInfos('spec/support/bugsplat.app.dSYM')).toBeResolvedTo(jasmine.arrayContaining([
{
path: jasmine.stringMatching('/tmp/2dd1bd2706fa384da5a3a8265921cf9a/BugsplatTester'),
relativePath: '2dd1bd2706fa384da5a3a8265921cf9a/BugsplatTester',
path: jasmine.stringMatching(/tmp[\/\\]2dd1bd2706fa384da5a3a8265921cf9a[\/\\]BugsplatTester/),
relativePath: jasmine.stringMatching(/2dd1bd2706fa384da5a3a8265921cf9a[\/\\]BugsplatTester/),
dbgId: '2dd1bd2706fa384da5a3a8265921cf9a',
moduleName: 'BugsplatTester',
},
{
path: jasmine.stringMatching('/tmp/2ce192f6c5963e66b06aa22bde5756a0/BugsplatTester'),
relativePath: '2ce192f6c5963e66b06aa22bde5756a0/BugsplatTester',
path: jasmine.stringMatching(/tmp[\/\\]2ce192f6c5963e66b06aa22bde5756a0[\/\\]BugsplatTester/),
relativePath: jasmine.stringMatching(/2ce192f6c5963e66b06aa22bde5756a0[\/\\]BugsplatTester/),
dbgId: '2ce192f6c5963e66b06aa22bde5756a0',
moduleName: 'BugsplatTester',
}
Expand Down
2 changes: 1 addition & 1 deletion spec/elf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { tryGetElfUUID } from "../src/elf";
describe('elf', () => {
describe('tryGetElfUUID', () => {
it('should return uuid for elf file', async () => {
return expectAsync(tryGetElfUUID('spec/support/bugsplat.elf')).toBeResolvedTo('005f5f676d6f6e5f73746172745f5f006c696263');
return expectAsync(tryGetElfUUID('spec/support/bugsplat.elf')).toBeResolvedTo('85fe216fc7dd441f04c237310a56081fbf23c082');
});
});
});
6 changes: 3 additions & 3 deletions src/elf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function tryGetElfUUID(path: string) {
}

if (success) {
return getUUID(section!);
return getUUID(section!, 16);
}

elfFile = await ElfFile.create(path);
Expand All @@ -29,6 +29,6 @@ export async function tryGetElfUUID(path: string) {
return '';
}

function getUUID(section: Buffer) {
return section.subarray(0, 20).toString('hex');
function getUUID(section: Buffer, offset = 0) {
return section.subarray(offset, offset + 20).toString('hex');
}

0 comments on commit a2c3e72

Please sign in to comment.