custom attributes in gcc and dwarf
Lets check if we can add our own attributes (if Google can afford it, then why is it forbidden to mere mortals?). For example I want to have in gcc and dwarf flag about functions/methods parameters...
View Articleestimation of maximum clique size
definition 1.1 from really cool book"The Design of Approximation Algorithms":An α-approximation algorithm for an optimization problem is a polynomial-time algorithm that for all instances of the...
View Articleyet another maximal clique algorithm
It seems that most of known algorithms for maximal clique try to add as much vertices as possibly and evolving towards more complex heuristics for vertices ordering. But there is opposite way - we can...
View Articlectf-like task based on maximal clique problem
SourcesThere is undirected graph with 1024 vertices and 100909 edges (so average degree is 98.5). It is known that the graph contains clique with size 16. You can pass indexes of clique`s vertices in...
View Articlegcc plugin to collect cross-references, part 1
Every user of IDA Pro likes cross-references - they are very useful but applicable for objects in global memory only. What if I want to have cross-references for virtual methods and class/record fields...
View Articlegcc plugin to collect cross-references, part 2
Part 1Because I still fighting with endless variants of unnamed types while processing linux kernel lets talk about persistence The final goal of this plugin is to make from sources database of...
View Articlegcc plugin to collect cross-references, part 3
Part 1& 2Lets start walk climb on TREEs. Main sources for reference are tree.h, tree-core.h& print-tree.cc Caution: bcs we traveling during RTL pass some of tree types already was removed so it...
View Articlegcc plugin to collect cross-references, part 4
Let`s apply priceless knowledge from previous part - for example to extract string literals and insert polymorphic decryptionTypical call to printf/printk in RTL looks usually like(insn 57 56 58 9 (set...
View Articlegcc plugin to collect cross-references, part 5
Part 1, 2, 3& 4Lets check how RTL describes jump tables. I made simple test and output of gcc -fdump-final-insns looks like:(jump_insn # 0 0 8 (parallel [ (set (pc)...
View Articlegcc plugin to collect cross-references, part 6
Part 1, 2, 3, 4& 5Finally I was able to compile and collect cross-references for enough big open-source projects like linux kernel and botan:wc -l botan.db 2108274 botan.dbgrep Err: botan.db | wc...
View Articledwarf5 from clang 14
It seems that clang in version 14 utilize more advanced features from DWARF5, so I add their support to my dwarfdump. IMHO most exciting features are:Section .debug_line_strIn old versions of dwarf...
View Articlegcc plugin to collect cross-references, part 7
Part 1, 2, 3, 4, 5& 6Lets check if we can extract other kind of constants - numerical. Theoretically there are no problems - they have types INTEGER_CST, REAL_CST, COMPLEX_CST and so on. And you...
View Articlelocation lists from dwarf5
I added during past weekend support for var location lists from DWARF5 (located in separate section .debug_loclists) in my dwarfdump. As usually lots of bugs were foundFirst - they presents only for...
View Articlekssp library
I`ve tried to solve CSES task"visiting cities"Looks like you can use kind of brute-force - get 1st shortest paths, then all remained with the same cost and make union of cities in each path - nor...
View Articlekssp library, part 2
Previous part I was struck by the idea of how to reduce size of graph before enumerating all K-th shortest paths. We can use cut-points. By definition if we have cut-point in some shortest path it must...
View Articlemy solutions for couple CSES tasks
CSES has two very similar by description tasks but with completely different solutions: "Critical Cities" (218 accepted solutions at time when I writing this) and "Visiting Cities" (381 accepted...
View ArticleFilling Trominos
IMHO this is very hard task - only 104 accepted solutions. My solution is hereGoogle gives lots of links for trominos but they all for totally different task from Euler Project - in our case we have...
View ArticleArchitecture and Design of the Linux Storage Stack
Not perfect but suitable book considering the small number of books about linux internals. IMHO most useful is chapter 10, so below is brief summary of the presented toolsvfsstat, VFS,...
View ArticleDistinct Colors
I`ve solved yet another very funny CSES task - it looks very similar to another task called "Reachable Nodes" (my solution for it). The only difference is that we asked to count not unique nodes but...
View Articlefailed attempts to draw graphs
CSES has several really hard graph-related tasks, for exampleNew Flight Routes with directed graph (btw this task was borrowed from russian olympiad contest)Forbidden Cities with undirected graph It...
View Article