{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":114388596,"defaultBranch":"master","name":"cxxd","ownerLogin":"JBakamovic","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-12-15T16:09:24.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/7620680?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1679066039.5278091","currentOid":""},"activityList":{"items":[{"before":"5b0253dfc051b5f1c864c4207fbc401c004dd084","after":"ef021d03d1c353f5a1a58838e6d199cf41332fb1","ref":"refs/heads/improve-compiler-handling","pushedAt":"2023-03-30T12:33:23.334Z","pushType":"push","commitsCount":1,"pusher":{"login":"JBakamovic","name":"Jusufadis Bakamovic","path":"/JBakamovic","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7620680?s=80&v=4"},"commit":{"message":"WIP: fixes","shortMessageHtmlLink":"WIP: fixes"}},{"before":null,"after":"5b0253dfc051b5f1c864c4207fbc401c004dd084","ref":"refs/heads/improve-compiler-handling","pushedAt":"2023-03-17T15:13:59.527Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"JBakamovic","name":"Jusufadis Bakamovic","path":"/JBakamovic","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/7620680?s=80&v=4"},"commit":{"message":"Implement a disassembler service.\n\nIt is inspired by the idea of Godbolt but with the difference of having\na capability to be used on the actual projects (e.g. on a whole bunch of\ndifferent source-code files) and not only on the excerpts of your code\nthat you have copy-pasted into the Godbolt editor.\n\nThis means that this disassembler service does not operate on chunks of\nan exemplary code but it operates on an actual binaries your code is\ngoing to produce. What it will do is that it will try to match the symbol\nyou expressed the interest in on a source-code level, e.g. some function,\nagainst the actual symbols that are present in the resulting binary. It\nwill do so by disassembling the binary and jumping to the symbol of\ninterest in the resulting disassembly.\n\nSometimes a symbol of interest won't even be present in the resulting\nbinary because it was either optimized out or inlined or sometimes even\nmerged with some other symbol. This normally happens because of the\ncompiler and/or linker optimizations and it is inevitable. What can also\nhappen is that the symbol of interest is not an actual symbol but rather\na meta-symbol such as function template or a class template, and therefore\ncannot be present in such a form in a resulting binary.\n\nIn both of these cases, disassembly service will instead offer a list\nwhich contains all of the similar symbols that we can jump to. In case\nof function/class templates this approach works quite well. But in case\nwhen the symbol is completely missing, we will need to fallback onto\nmanual heuristics of finding the interesting part of the disassembly.\n\nNot having all the code isolated into a single translation-unit, like we\ndo in a Godbolt, this service gives us an ability to examine the codegen\non a project level rather than on a single source-code file level. This\nis a much tougher challenge for your compiler and linker to solve, and\nhence it may/will impact the resulting codegen. Service also provides\nflexibility to pick any target (binary) available to your project you\nmight be interested in (e.g. unit-tests, google-benchmarks, etc.).\n\nWhole service is implemented natively through nm + objdump + libclang\ncombination, and has no dependencies or whatsoever on Godbolt. It runs\ncompletely locally within the cxxd server.\n\nIt also provides the convenience not having to c/p the excerpts into a\nGodbolt editor, which may or may not be a sensitive content, or cutting\nloose the project-specific dependencies so that you can successfully\ncompile the excerpt. This is sometimes time-consuming, especially in\nlarge codebases.\n\nTo understand the disassembly better, service also provides a documentation\nof x86-64 assembly instructions and which can be retrieved by the client\napplication (e.g. on hovering the mouse over some assembly instruction).\nThis part is implemented with the help of the script which Godbolt uses\nto scrape the documentation from https://www.felixcloutier.com/x86/index.html.\nI have tweaked the script to fit the purposes of cxxd better.\n\nThere're some disassembly-related knobs that can be tweaked through the\n.cxxd_config.json configuration file. These include:\n (1) \"targets-filter\" - to filter out the uninteresting targets from\n your build directory. E.g. \"targets-filter\" : [\".so\", \".a\", \"CMake\"]\n (2) \"intermix-with-src-code\" - to mix the disassembly with the source\n code. By default it is turned off.\n (3) \"syntax\" - to select the disassembly syntax. By default it is set\n to intel syntax but can be changed to AT&T if someone wants to.\n (4) \"visualize-jumps\" - to visualize the branches in disassembled code.\n By default this setting is turned on.\n (5) \"binary\" - Both nm and objdump custom binaries can be provided\n should there be a reason for it.\n\nE.g.\n \"disassembly\" : {\n \"objdump\" : {\n \"binary\" : \"\",\n \"intermix-with-src-code\" : false,\n \"visualize-jumps\" : true,\n \"syntax\" : \"intel\"\n },\n \"nm\" : {\n \"binary\" : \"\"\n },\n \"targets-filter\" : [\".so\", \".a\", \"CMake\"]\n }","shortMessageHtmlLink":"Implement a disassembler service."}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAADDqGFMQA","startCursor":null,"endCursor":null}},"title":"Activity ยท JBakamovic/cxxd"}