Page MenuHomePhabricator
Feed Advanced Search

Thu, Sep 8

namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

Thank you both for the review! Please commit with 'Namhyung Kim <namhyung@google.com>'.

Thu, Sep 8, 12:34 AM · Restricted Project, Restricted Project
namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.

v7 update.

Thu, Sep 8, 12:31 AM · Restricted Project, Restricted Project

Wed, Sep 7

namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Wed, Sep 7, 10:10 AM · Restricted Project, Restricted Project
namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Wed, Sep 7, 7:35 AM · Restricted Project, Restricted Project

Sep 7 2022

namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.

v6 update.

Sep 7 2022, 1:47 AM · Restricted Project, Restricted Project
namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

I don't think you can rely on the behaviour of what happens to the strings when vectors are resized - I don't believe there's anything in the C++ standard or the existing type's definition that will guarantee the behaviour will remain the same.

Sep 7 2022, 1:01 AM · Restricted Project, Restricted Project
namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Sep 7 2022, 12:37 AM · Restricted Project, Restricted Project
namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.
SmallVector<std::string, 0> SecNames; 
...
SecNames.push_back(("PT_LOAD#" + Twine(Idx)).str());

This makes the test failing again.

Please see the second half of my previous comment re. vector resizing (can apply to SmallVector too potentially). I would expect that to be a problem.

I think we should switch to what I originally suggested, drop StringTableBuilder and use a string with \0 terminators:)

I'm actually inclined to agree - the "simplification" is turning out to be more complicated than I expected.

Sep 7 2022, 12:29 AM · Restricted Project, Restricted Project

Sep 5 2022

namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

This makes the test failing again.

Sep 5 2022, 11:51 PM · Restricted Project, Restricted Project

Sep 3 2022

namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.

v5 update. Now it passes the test!

Sep 3 2022, 1:51 PM · Restricted Project, Restricted Project
namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

Sorry for the delay. I think I found the reason - it passed a stack-allocate string to the string table builder which keeps the cached string ref. So each section name pointed to the same place in stack and got overwritten. Will add a vector to hold the local strings.

Sep 3 2022, 1:49 PM · Restricted Project, Restricted Project

Aug 22 2022

namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

I suspect the StringTableBuilder does something wrong, or my understanding is incorrect. I checked with a debugger that the sh_name offset set correctly, but the first string was "PT_LOAD#3" instead of "PT_LOAD#1". Investigating...

Aug 22 2022, 10:21 PM · Restricted Project, Restricted Project

Aug 21 2022

namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.

v4 updates. But the test still fails..

Aug 21 2022, 11:10 PM · Restricted Project, Restricted Project

Aug 17 2022

namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.

v3 updates. But the test still fails.

Aug 17 2022, 12:23 AM · Restricted Project, Restricted Project

Aug 16 2022

namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Aug 16 2022, 11:50 PM · Restricted Project, Restricted Project

Aug 15 2022

namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.
  • remove unnecessary llvm:: prefix
    • convert disassemble-no-section.test to use yaml2obj
Aug 15 2022, 11:26 PM · Restricted Project, Restricted Project
namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Aug 15 2022, 10:18 PM · Restricted Project, Restricted Project

Aug 11 2022

namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

If this is available in GNU objdump, could you post the version it was added to, please?

Aug 11 2022, 11:20 PM · Restricted Project, Restricted Project

Aug 10 2022

namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Aug 10 2022, 2:56 PM · Restricted Project, Restricted Project
namhyung updated the diff for D131290: [llvm-objdump] Create name for fake sections.
  • use StringTableBuilder and SmallString
  • fix bug in the p_type check
Aug 10 2022, 2:53 PM · Restricted Project, Restricted Project

Aug 9 2022

namhyung added inline comments to D131290: [llvm-objdump] Create name for fake sections.
Aug 9 2022, 2:26 PM · Restricted Project, Restricted Project
namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.

Not sure what happened with the input data. But at least it worked with my test case and linux perf kcore image.

Aug 9 2022, 2:22 PM · Restricted Project, Restricted Project

Aug 8 2022

namhyung added a comment to D131290: [llvm-objdump] Create name for fake sections.
  1. Have you looked into using StringTableBuilder at all?
Aug 8 2022, 10:02 AM · Restricted Project, Restricted Project

Aug 5 2022

namhyung requested review of D131290: [llvm-objdump] Create name for fake sections.
Aug 5 2022, 1:36 PM · Restricted Project, Restricted Project

Jul 13 2022

namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Hi, I've addressed all the comments from the previous one. Could you please review it again and commit with "Namhyung Kim <namhyung@google.com>"?

Jul 13 2022, 7:55 PM · Restricted Project, Restricted Project

Jul 8 2022

namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Do you need assistance merging this patch into the main branch?

Jul 8 2022, 1:28 AM · Restricted Project, Restricted Project
namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

Updates:

  • address reviews on test formatting
Jul 8 2022, 1:24 AM · Restricted Project, Restricted Project

Jul 7 2022

namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

Updates:

  • drop tools/llvm-objdump/no-section-header.test
  • fix test failure in Object/objdump-no-sectionheaders.test
  • rebase onto main branch
  • a few formatting changes
Jul 7 2022, 3:21 PM · Restricted Project, Restricted Project
namhyung added inline comments to D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jul 7 2022, 2:54 PM · Restricted Project, Restricted Project
namhyung added inline comments to D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jul 7 2022, 2:27 PM · Restricted Project, Restricted Project
namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

Updated, please take a look!

Jul 7 2022, 10:07 AM · Restricted Project, Restricted Project

Jul 5 2022

namhyung added inline comments to D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jul 5 2022, 1:42 PM · Restricted Project, Restricted Project
namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

Updates:

  • small formatting issues on the test files
Jul 5 2022, 1:41 PM · Restricted Project, Restricted Project

Jul 4 2022

namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

Updates:

  • split test cases and improve comments
  • remove unnecessary info in the test yaml
  • remove const from obj to remove the const_cast
Jul 4 2022, 12:24 PM · Restricted Project, Restricted Project
namhyung added inline comments to D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jul 4 2022, 11:24 AM · Restricted Project, Restricted Project

Jul 1 2022

namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

perf annotate --stdio --objdump=/path/to/llvm-objdump

This command does not say how perf finds core

Jul 1 2022, 3:13 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Thanks for your detailed review! Really appreciated!

Jul 1 2022, 3:10 PM · Restricted Project, Restricted Project

Jun 30 2022

namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

Updates:

  • add a test case
  • remove a variable to check fake section
  • handle llvm-objdump -h use case
Jun 30 2022, 2:00 PM · Restricted Project, Restricted Project
namhyung added inline comments to D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jun 30 2022, 1:56 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Thanks for your review, now I can add a test case for this.

Jun 30 2022, 1:04 PM · Restricted Project, Restricted Project
namhyung abandoned D128883: [yaml2obj] Add optional ProgramHeader.Content.

Cool. I didn't know I can use that. With SectionHeaderTable.NoHeaders = true, it'll do all I need. Thanks for the info!

Jun 30 2022, 12:34 PM · Restricted Project, Restricted Project
namhyung updated the summary of D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jun 30 2022, 1:07 AM · Restricted Project, Restricted Project
namhyung updated the diff for D128705: [llvm-objdump] Create fake sections for a ELF core file.

I've changed it to use std::vector and call createFakeSections() in the llvm-objdump. I'm waiting for D128883 to update the test using yaml2obj.

Jun 30 2022, 12:49 AM · Restricted Project, Restricted Project
namhyung requested review of D128883: [yaml2obj] Add optional ProgramHeader.Content.
Jun 30 2022, 12:12 AM · Restricted Project, Restricted Project

Jun 29 2022

namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

it seems obj2yaml doesn't show size info in the phdr and because of that yaml2obj sets them to 0. So there's no output... I think it should be fixed first.

Jun 29 2022, 8:47 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Also there's no way to specify contents of segment without sections.

Jun 29 2022, 2:55 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Most tests are created from yaml using yaml2obj. Run ninja obj2yaml. You can use obj2yaml bin to get a yaml from a binary, then manually scrub it to have just the needed details.

Jun 29 2022, 1:50 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Consider adding a -h test too just to show the effect.

Jun 29 2022, 1:21 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

This needs a test. I suggest llvm/test/tools/llvm-objdump/X86/disassemble-no-section.test.

Jun 29 2022, 10:21 AM · Restricted Project, Restricted Project

Jun 28 2022

namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

Thanks for the detailed review! I'll address your comments in the next spin.

Jun 28 2022, 2:36 PM · Restricted Project, Restricted Project
namhyung added a comment to D128705: [llvm-objdump] Create fake sections for a ELF core file.

I'm new to the project and not familiar with the code base and C++. Please advise me for improvements.

Jun 28 2022, 12:23 AM · Restricted Project, Restricted Project
namhyung requested review of D128705: [llvm-objdump] Create fake sections for a ELF core file.
Jun 28 2022, 12:19 AM · Restricted Project, Restricted Project