From d588033a56e6a351efc195b141600f40ec78eb51 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Wed, 2 Jun 2021 15:56:32 +0200 Subject: [PATCH 1/8] Fix BIT instruction description. Flag handling for the BIT instruction did not follow the datasheet. This fixes #2558. --- Ghidra/Processors/6502/data/languages/6502.slaspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ghidra/Processors/6502/data/languages/6502.slaspec b/Ghidra/Processors/6502/data/languages/6502.slaspec index 7775ef3f0d..ba7a70ddc7 100644 --- a/Ghidra/Processors/6502/data/languages/6502.slaspec +++ b/Ghidra/Processors/6502/data/languages/6502.slaspec @@ -168,8 +168,10 @@ ADDRI: imm16 is imm16 { tmp:2 = imm16; export *:2 tmp; } :BIT OP2 is (op=0x24 | op=0x2C) ... & OP2 { + N = (OP2 & 0x80) == 0x80; + V = (OP2 & 0x40) == 0x40; local value = A & OP2; - resultFlags(value); + Z = (value == 0); } :BMI REL is op=0x30; REL From 81ef5ee065261adc7c7f61553107dfdaa0e4a37a Mon Sep 17 00:00:00 2001 From: VGKintsugi <7758500+VGKintsugi@users.noreply.github.com> Date: Sat, 6 Nov 2021 23:43:54 -0400 Subject: [PATCH 2/8] SuperH: Fix trapa to use call instead of goto Fix by waterfuell --- Ghidra/Processors/SuperH/data/languages/superh.sinc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Ghidra/Processors/SuperH/data/languages/superh.sinc b/Ghidra/Processors/SuperH/data/languages/superh.sinc index dde2cdb13b..b5bbd982fa 100644 --- a/Ghidra/Processors/SuperH/data/languages/superh.sinc +++ b/Ghidra/Processors/SuperH/data/languages/superh.sinc @@ -1979,14 +1979,13 @@ define pcodeop Sleep_Standby; :trapa imm_00_07 is opcode_08_15=0b11000011 & imm_00_07 { - r15 = r15 -4; + r15 = r15 - 4; *r15 = sr; - r15 = r15- 4; + r15 = r15 - 4; *r15 = pc + 2; - pc = *(vbr + (imm_00_07 * 4)); - goto [pc]; + call [vbr + (imm_00_07 * 4)]; } @if defined(FPU) From 1b5384c00c905bad329a9fe48369f58186db92c5 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Mon, 29 Nov 2021 11:34:28 -0500 Subject: [PATCH 3/8] GP-1214: Adding copy-into-progarm actions (plugin). Moving export action. --- Ghidra/Debug/Debugger/certification.manifest | 2 + .../src/main/help/help/TOC_Source.xml | 165 ++-- .../DebuggerCopyActionsPlugin.html | 178 ++++ .../images/DebuggerCopyIntoProgramDialog.png | Bin 0 -> 38319 bytes .../DebuggerListingPlugin.html | 29 +- .../DebuggerMemoryBytesPlugin.html | 29 +- .../core/debug/gui/DebuggerResources.java | 57 +- .../gui/action/DebuggerReadsMemoryTrait.java | 28 +- .../copying/DebuggerCopyActionsPlugin.java | 153 ++++ .../DebuggerCopyIntoProgramDialog.java | 844 ++++++++++++++++++ .../debug/gui/copying/DebuggerCopyPlan.java | 449 ++++++++++ .../gui/listing/DebuggerListingProvider.java | 26 +- .../memory/DebuggerMemoryBytesProvider.java | 4 +- .../breakpoint/LogicalBreakpointInternal.java | 2 +- .../ReadsTargetMemoryPcodeExecutorState.java | 57 +- .../DebuggerStaticMappingServicePlugin.java | 40 +- .../DebuggerStaticMappingService.java | 151 +++- .../DebuggerCopyActionsPluginScreenShots.java | 157 ++++ .../AbstractGhidraHeadedDebuggerGUITest.java | 26 +- .../DebuggerCopyActionsPluginTest.java | 505 +++++++++++ .../gui/copying/DebuggerCopyPlanTests.java | 743 +++++++++++++++ .../listing/DebuggerListingProviderTest.java | 24 +- .../DebuggerMemoryBytesProviderTest.java | 26 +- .../DebuggerStaticMappingServiceTest.java | 69 +- .../database/data/DBTraceDataTypeManager.java | 4 +- .../database/listing/DBTraceInstruction.java | 19 +- .../listing/DBTraceInstructionsView.java | 49 +- .../AbstractDBTraceProgramViewListing.java | 24 +- ...actDBTraceProgramViewReferenceManager.java | 12 +- .../trace/database/ToyDBTraceBuilder.java | 9 +- .../app/merge/ProgramMergeManagerPlugin.java | 56 +- .../core/progmgr/ProgramManagerPlugin.java | 44 +- .../ghidra/app/services/ProgramManager.java | 177 ++-- .../app/services/TestDummyProgramManager.java | 24 +- .../plugin/core/diff/DiffProgramManager.java | 24 +- .../assembler/sleigh/SleighAssembler.java | 11 +- .../sem/AssemblyConstructorSemantic.java | 59 +- .../program/database/mem/MemoryMapDB.java | 84 +- 38 files changed, 3855 insertions(+), 505 deletions(-) create mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.html create mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/images/DebuggerCopyIntoProgramDialog.png create mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPlugin.java create mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyIntoProgramDialog.java create mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java create mode 100644 Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginScreenShots.java create mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginTest.java create mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java diff --git a/Ghidra/Debug/Debugger/certification.manifest b/Ghidra/Debug/Debugger/certification.manifest index 2b87be0f13..c0fbb2759e 100644 --- a/Ghidra/Debug/Debugger/certification.manifest +++ b/Ghidra/Debug/Debugger/certification.manifest @@ -41,6 +41,8 @@ src/main/help/help/topics/DebuggerBreakpointsPlugin/images/breakpoints-enable-al src/main/help/help/topics/DebuggerBreakpointsPlugin/images/breakpoints-make-effective.png||GHIDRA||||END| src/main/help/help/topics/DebuggerConsolePlugin/DebuggerConsolePlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerConsolePlugin/images/DebuggerConsolePlugin.png||GHIDRA||||END| +src/main/help/help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.html||GHIDRA||||END| +src/main/help/help/topics/DebuggerCopyActionsPlugin/images/DebuggerCopyIntoProgramDialog.png||GHIDRA||||END| src/main/help/help/topics/DebuggerEmulationServicePlugin/DebuggerEmulationServicePlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerInterpreterPlugin/DebuggerInterpreterPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerListingPlugin/DebuggerListingPlugin.html||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml b/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml index df323e28ae..9e57f22ea4 100644 --- a/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml +++ b/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml @@ -52,109 +52,114 @@ - - - - - + - + + - - + + + + + + + sortgroup="c1" + target="help/topics/DebuggerConsolePlugin/DebuggerConsolePlugin.html" /> - + - + - + + + + sortgroup="g" + target="help/topics/DebuggerTraceManagerServicePlugin/DebuggerTraceManagerServicePlugin.html" /> - + - + - + - + - - - - + - - - - - - - + - + + + + + + + + + + - + sortgroup="n" + target="help/topics/DebuggerWatchesPlugin/DebuggerWatchesPlugin.html" /> + - + sortgroup="o" + target="help/topics/DebuggerMemviewPlugin/DebuggerMemviewPlugin.html" /> + - - - + sortgroup="p" + target="help/topics/DebuggerPcodeStepperPlugin/DebuggerPcodeStepperPlugin.html" /> + + + diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.html new file mode 100644 index 0000000000..759f297caf --- /dev/null +++ b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.html @@ -0,0 +1,178 @@ + + + + + + + Debugger: Copy Actions + + + + + +

Debugger: Copy Actions

+ +

In the course of debugging, the user may want to capture certain state and annotations from + the dynamic context into the static. This might include the contents of the stack, the heap, or + example data stored in uninitialized memory. The copy actions allow for the easy movement of + data and annotations from traces into programs. The actions are all accessed via the Debugger menu.

+ +

Actions

+ +

Copy Into Current Program

+ +

This action requires a selection of memory in a dynamic view. It copies selected contents + from the current trace (at the current time) into the current program. The Copy Dialog is presented with the current program set as the destination.

+ +

Copy Into New Program

+ +

This action requires a selection of memory in a dynamic view. It copies selected contents + from the current trace (at the current time) into a new program. The Copy + Dialog is presented with <New Program> set as the destination.

+ +

Export Trace View

+ +

This action is available whenever a trace is open. The Export Dialog is presented for + the current trace at the current time. This provides a mechanism for capturing a particular + point in time from a trace to a file. The exported image can be analyzed in Ghidra or another + tool.

+ +

Copy Dialog

+ +

The Copy Into... actions both present the same dialog: (The Export Trace View + action uses a different dialog.)

+ + + + + + + +
+ +

The dialog consists of several options, followed by a table that displays the proposed + ranges to copy. For selected ranges not contained in the destination program's memory, new + blocks are proposed. The source selection is always broken apart by regions defined in the + trace's memory manager.

+ +

Options

+ + + +

Table Columns

+ +

The table displays the proposal and allows for some adjustments. It has the following + columns:

+ + + +

The Copy button confirms the dialog and copies all proposed ranges in the + table. If successful, the dialog is closed. The Cancel button dismisses the dialog + without performing any operation. The Reset button resets the proposal, in case entries + were accidentally removed or modified.

+ + diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/images/DebuggerCopyIntoProgramDialog.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerCopyActionsPlugin/images/DebuggerCopyIntoProgramDialog.png new file mode 100644 index 0000000000000000000000000000000000000000..f3c51f59ff382ec0c0d7b4a98c088d05945f44a1 GIT binary patch literal 38319 zcmd43bwHKd);+ut1tmmOKoLZxK|tx=Gy>An-QC?thk(-E9nu|J>28olx;NeRE!2DN zx%a(q{Qmp?IHG6oXYci_XRa~F9CJ+kCBy{LQE*Wp5D2=^J3c80YW*b29~lgB6SFvK=9$D9y{#dI&mtXwv1JD4#GWk_Y^k$Vg1 zU%OmV7fNTrt#WJPYI{{g^N>_kRpB$dU=5HmbDMoebBhgB@OKH)$LQck^4$QWn}6Nr zM+85}JW>(BkH_2t;LjbYokP5$?{0jJtKaH&rQ53|KVn`H=7fcWd)~Z@>$-lH=7k+k zf6up^hr>d(C-y-S^x(2p77EmWDobvz+Q*~lWVjIAnQt$(ez=vLudXegh_GbQXba$r zqbcC_`Z82`3ic5zS2yeqxm-~D7u0H!?KPpZov7Go3TpHcspL7>b}>~sqAe04B$I=+ zyl`&)%%;(q#Hst_+UfcvnG?lT{9`IY^2eaWH-V9ZR#8?s1!F&lwmFinwnbwxOEkBz zIZM7X=ni}f=2;rpEhR6jHoRoyd2#CDf9 zaZ+7Ad^Q4Ro#%%`ALj2N3W#O)fSXO+7KVz2KSnoh)G^{5Z&*Q%-O)GR>#pv~x$ZCC zZxp<g!=-12qAq*|>e$wx1-9+^#r)K! zx6#-s+A|LR1@=Z#yn`tyG=`bRy1-oc;BmIw+ImkCKKoOA#`7vKh!`95~(y>lxYAc_~RaD0_m1R7~j`tHMALbU9ycHf8gH zS1yWU329%3q*Ld4%DfOnm7;p#`he0O0~uZKl9C^*sb|8BZ%>OD1SEZW2OV|^7Nz>4 zw(GVRxz!^>Ia50`=tO#X{2dGewrOxTQYS~eiwz59)f9EhTGuWE7Q>09tGtS|A+03R zarc}13XApC?H0=@O103Rag2CV;+7>vN2Z}YVHexm@Snw~`Pv&Jh}_UO@!@^{*O!Eb zoZLAaP0#=&jpz3q74*$cNS($>C~;R0Q;rTWB8vzcq|Z?&rhOaUXOk;1?uJ3?h??CD zQpwEM>#i8=?h{p+aivu0KM4ULXkl=j{?h)t;e-wATThcg6=u}Ly(`VA*{F`ErBNmI zo4w}?eW}W>YIoO;&gzSY#?ZFy4NvA%T2nO)w-(`?uAB1t_s7mwQn}Cl4cJkvNXXgN zo4vie2)$@{0x)u2mY-ThN)o~~u_s6LzL{5uDAV8Fmnbh&A3tkqd!+fO)GJL|rRAt3 z_2V7np8T9iv83xQzkGf98b`Xx+xGW}Kiz*!;rSVX0jtRohPh$nCSII;{YC@Fl>?!F z?CM0UsmQsR1a;qd#``B^*u`F`8L1+-bk~ZHKy*`*&=`G6&j55=8TGTb=W7IYY(^W72JlQ zH+z-a^owV(W2G(FK~u*EzGs5k|rnU`b_LtAF}H@Yt`1-HlC z*csn$?Cg4-rWlPsEh+Rghb6AU3@v9bcNUs}ItOVB-xxH5Tt1K9Lf z7nYR88~r(66R@z3?LkEFz{Imp`30!2<%AHDuMDrAuFYPPlXmE#p->{>fZG!FJxWbU zx?UZ^q3u)cghTCL!zyE9Ywfqfk8zyN?yqe_VK@!1<6heydeCDT+%5S`eQYe%Tr5r00s;$;v##Z#9Q>*B_!7==`2% zy>j4n$ix5PV?0v1JvVZlgih@q?Sr?fVwddY3)9M`EoI2*{_}CC7ht8yEECmChUZ^-llY!bRhi7zP&w&+ zy(kkal{GtmF|XeKl}HiAfO}C+h#>$80ZX<^JhuXm)rx`eeBejO^=^pT)qc`7NXz|r zm*=zBr)|*d%LVc4i!0xx=hue@7CMK0u#4R3Fap=qqQ2nxOLZ-JDnDGP8P~v0T+c4n z22{MGyYuoGcKr;jMByAm_m4KI^`5`}63Opcz&9X4 zC~o66?q3pO+vdE#Wp}^>zMtL*dX*r924z24?npqM%~X|>aXa_qA^#zg^>s$5>lIaS z=+Z-e-XM`vyS0&1`^iLt#4Emxr{F=A9#v)mfRLNLI6U$+qlB~9eOCBjyIst42kW?v z#xGgt3$|c~rGILQ0FSBYK+$O!{s(&c$B2lC4UfQ@F`bWpWMRNgH>L}-HBWM@O3n@< zrZ%uJ9(PjJGC3aMDqKn!OLN;S`&C0qztCO+h=ZV?d4jXk4aYX)1;|XD zaBUnJd{(DJP1Ov`Cf(P0W&I+~fqZoI~YG>*^yU1mmWWWkqS6;-;o3^oq6a+*>o8{%ReI|O*@8X5+=x{U2+ z=BnKOM-Csb>@vmT3`|UhS|?(0%W_;?5h!sRM@<}04j)lHXLqhMKFtlr-=cc`x>Yzav5Y&FZFT{Vyvju@S(}z)h z;4`2HH8w`0s@1IBLtUf{9JR^s7@V84pVE0MK&b-Q?6zsBUqW-``tgEw>lk>8 zNs(W883fx?iNAg|&4(HNVA2dupdhccSwq7MK(;*o4N2-o#Bl6vFGpW`{UwH zU|Amxnl^vadJ*~uY<eWdAw1t-P(E*4r!DhuMf2yJ6?&-FD;3VApN;ltLu$DC5(X1?d7Tb8pnF$ zzMQUI1&Z$-T|Z_mj?K?52R87JA9Xm)Ltq`K&+_$?W$O3?vGcbU7oFFHS&dc}vBt-3 z)J-Ojwwgu-w6#@!(1uj$xA#(NZ#|5dXl~}iYkiC@S5{g+!WmLu-_#L$2LKUc|~-UUovyfT*{Cl@{~G2I|5|0PzgW?$PH?*|0^z`Xah3j!EoVDed!4d|lY~NH(`d&h6 zT>7K77PXz714gFGH`y+CBLbA`ii<4_PR*|Oh#B;yo$B1N&_(3Drt7cEu`j}OF0Efs zpb~wzejF4xuMRS`Hi#lF4w(T_OC1~6j)HEFJxUg0wqRnH7}-~E4Msf}O(s6wb4;2Y zv73rVqQvEi`ub#%DY~4^&Q`dqea`odOeFyx^J5belO{%k6s+xnQvD)3^NYnHd~29$ zN`st4`opuO<$*mR&sKYI2za6js#PxEp*ohVDL6R8w6c1wm4!(0`4>nMv~OxGkSIZFXwMlf64nA^7(qfqr^f|mX*PAqgrMiYgshzKlx z;Y=(hqPPzxo8xxxWGqOR))}t9Bk;hc*sYemFLo1<#J8*Wc|k1G%MTR2v0f^u#VF5q zDRI&7prNY8!by79_vLWNXmGNLj)8-Xv`~L=kvu<)1SbTGab+}KJE?oqd46q;!|aOZ ziVL98q2$*FwGXzWmD%ftiR)6MqCxzKERN(!+e9;jdLw!IZ?Z49AXL}9w|t0|t6p#B z*4aRfO}xUwO8s*TLY{LRZ}UW#HNO zCc)L^2A!_Rt*y;fvYY$(kak-%VFnlXPvlJXaXIz@W4;RPd&l^A zc%pG%W%hH;OYj^e$kmM|XEIGD{elQe#bTA&Wyf9@=6=1Te9nOJ7v5yoUCLNE93E=g z2)Ldu84+ib^E&ZF{VH^FM9uB;1Q}qO?$%5ism#diV>ym?%IYvx ziRz6H!t;l0C?F=+8OxT#kS=B)#TH*L?RgTEX`&v~5_HR|#)JhiviL(*)v@awrYHSlO+%i91exnhETn7;lh ze@RwY=IEv@AlyOdO+qt6|8ny#Rp5o9f9f1lj`s+l0=iV^(d#~`^PS+TlVi6lu;65t zv&oR_v$KxbZO${L@o6(uiUwADM#}n&Vq2X3Jo4B2yFRW%vNUWdsXAZOC?)AHULH+s zEs=h(;^gGCxmx#^_CzG@1542lZbcG%#$wvpKfvuuNOJTHd#q)np4H|Me~Hs@W^6>V zD>zU84>7q%ko}#gSa5AN}N^>g8%jSQb=--TA`Bh>{W!(Nns3_wj=#4|_vQ zuvf`Tkq`t zutsUZJ7&Yd&+)$8JInA^7BUE=ZV{}A&{HmA_BwcFd5)h_c6gV$f`!(e7#c}LM50t~ zP^veZ(l{T`oF4uXp$YI0>q=I};cj$>5ZfEFnY>F*h3g}xrYLbJ@d_@LnUbPGV~3IA z3+`8Y=X1&&X58u3VmKNA25js|U0q$z3#1jS@FG{mJ3qY5$|~)O%8WT!^c5ABR7T0! zz258^&tC<_Re}tXF_hNRsdS7(r8=6zD`;gEIH1*rlb73^c2fLdevFM-cG~ruV>Y*5 zsQH{_!v2n4_R_t8J_!Ir=28#52R^R)qc$--{{ju@XZ|-Ll65lW^)9x^WYTtYl=1vN zpEtD%H*&ej?A4gRJeA-F+RurN!v=H)X3va_0Jy)Au+J<|s>D|PxR+}<(cMF{EdCHg zJV^$>r(1vO!Mx%8+GJAXN0k9JDW}F^bwk1DoE^59C<|>56}@N+m-a7JY8x=EHa`fB z7d&I?^2~hyjEVE};ZWI4z8^pJ!bQdQLAjitvy2;l@}{4LGRxfrK+^KsQdn%FibOgt zr{?gdnD6tF7xHKOJ#Y?v1YM4Sx1=?8+o$>aZxj=gPtaC+F?L-l2}~X)aW*s(Sqg^Z z@vCbM*{;AZGnOjDsMYX~X6|yjBZjz^D^QtImwsrK_l#g(J^ z;C_~ZDN5Hx<(N+uew?Z_e!FOtve`mLoM)`(e$CZ|S&osO^`cJ4-_5nlOHa7`ofBK_ zUT*Al4u`o^|55vNJ^^@Qcfb?dj>ga&5{dbyfQp8W-gbM$xx2{VSTZH)BzVAlzaSEb z64X~7zFC#k)!y7&X*a|tX~Md;dt&$vBO~@%OVbi#&dUqSkI~W5W!WxIo<1Fj8A|&7 zYy>37^9mbc`}w<1LyQj86;{52a*3 z;pAeM&{FEaWT;ppZ?D&x*IS1&t4{{23=dV8N(+rsrQ9r=6D)gW=cz@^Qg=?7Cfm7K z*^|2INx@ZZvQGqgU+Wb@#!lYOiXW#XIoEiaDp3v}qXc|tMBxicU!)(+JeQlRh;TvV z;-ZxH7w(xDckrH{n}4I2G)QaN%)#!u3217*{OQ~tmeI^JPN`G&P`cs0+t-gt_JusB zFo^}fBom*0OVKwndgdC{dZ;=T$(GuxZlTmgiazh4*%!Zk8rjt`q$e2iloXB(anBSt z82E|(z?$@}#CbAeoOCNAD?1w>-?VR;7v8qT8?iZSN z7YXekQ2br$GZzY6W8;ZE1l%7^7D{kGT+bF0M-=eR??X=TiwB(17A|c)^_7C%IHbgv zphRs3_@<0>r&TvnjiRpb&K-#-(8v^>PnT@yg|L~!Qk8T06+j&HHB84#bU@sJ7@cRZ zQ8{V-U7e7M#lCX3hFRJ~$5dB85IFShnyi2SUNj-T)_5G3ypl+6rbaxBjfF*8`!`2< zxE+CpiE9m;0hss7x#p|(^Ny#64j%K8W!>U;zL-1Ud8o5yJH-t4!Y< z<1Pxyv^}+8g5p`ZKw01|5K!lMClSj_U(DxdBknuHX6}ZJUAXSxHQdA@a|VA?#bulF zB}oIEjt3Pb`HkzQmHoXyAA=!1ofRzAp6=L(OWfPprzGx zbHf7Pil6aIy{}vRKj+srfj;9#75oBi z99LIuNp7bynk~5__k)9*1cQIA33N2vpM#wG9_?PC>%n5jP!jQT&Z~y3guN4VYquvBQEci%Baf(Ev5d0}qi8>#_xkk}GOgdr_e!N<6R~M0IU#?U77T*cD=E z=umU5lYe@c(HR-QI*6T&e3>IPQGDT zeVlDvfH4Xh47{PWmpQ%Mwl{sQYMt_l^?4hkAX4FCTP{D&&<2z6a*x`HEsY$ffR?kT z{@8f9x{;FiSz`Z!tMN@39 z5d5Sq%rgZH22k8Hn$GZS0TPb0o!WNgIS{HIWK!Keb)o5mESQUxt=vUP*3m(knxw~c zJk!Y1p7QkUz(LNk0xX%rGuIUQ^Be(k5Hgsmv3ihkM+Sp~VN7x&2W_<`dMEMD!) zM8jo8-@liy-5b5+4~!bXPpPhMSuI`&l#vOwSJe8uw9s*8z>zuc3AZqa+JTXfWNDvZ z+%GCBqNk&K2C6jK`-~Ag{jL%|ra1;%n2`vE{RP^M-d&C6K>!_p#*}iNSWoI1?|(~K z{U*e1)60c$puB1x8CgJzEJ~SIr=$n#A1h%PtnM-*$;_lSI~IN~tZ{i@IbgBIMIWjA zU_JzogWHI)9#yPYrNVT!gLR3|_{0zCh~SOiL|WUY(qaP=Qp#Ff!c*T0TBcxqW3I_V1cS{1>3|fP$`cW zNMmH9<1g2?hE~iEa9;mh-K9A{$~!INwY1h4;#%%;$vnObNwxq-=E4&@14r(W`0SN+ z%p}$&aXIOG^i12uxiDj#lsB&Viq`(!G_Mobpy?}0)W%jz>u$NNs7AtXKJ>Uih{-e(Su}>x)Hzw3 zaSIu%Kb9}bcr-YeWuV@vXJzh&%3!9c$6lBJP}OTe=9o?IlG}*?c*`)+*p@S;)x$f* z<_I(ln8Zi> zK#GyQJSUFhST!V59#4pmr%@5o+lsGy#a4Tthux?jKe~uyU@N)alhBBbnHA-D2p8*@ z=%QoNai|DS_5gGW?cS5t2~S@%oh0pdBpS_vm|EYh3B`W6ILe%#9Ldmne$+>3c;Q&0 zc;=0SC7!R6Duv3ld$2wb+B9LjrT0&HM=#FCaJq&eNQI!-|7xmyo(ObN{O>emw2)r>@+}7k4nk&1}y_Fk)qCpAp(gAQa#gHk=uny1q^E(SG@bE#L`i zaB$A4*C}AxW4ZH2I-L1U-*)AL$f8>-iYsn1 zKag8{26F)eZpl3|>p^?6O6oPhCc-gEXeaHoag;EeIg+rY*%yv$4V}*Fs~yfn;Vs!X z>0mZ23h+AgJ05*1)IwH1M7KYdshy9_(>>p>LpOWPHAQ&5kY!O-CAzY_IF(VKkRVYe z)XO(U|JlJR>5$_VME|yMAX48P-8^kqjI=?E?NP$2=CQ3AK}y)oX+7(cdtZ~Uq%_$- z!MoL)kU;O6_`11kdVL@w{5t*Pk?Y=C@I~Vw${|P17c7#LPA)tWJBebA?I8K$y{09~ z(K;q)qK(sqaP8n%B-VqS+++3j33NaQVY_pX-;zYuekg()Dq1a$`-C+Q(KmIi{(+rg z8K61bTb_paqfM^k+!!@Ux*P`;gB#tf-pGeVGVvxQ?`pEH3$M>;SSvwgM_ikoxC+!5 zixB0w5Ij2DTjgu;coX6I@&}s2ou&hQBO~3)DT44e@da~>$@#v=wxuZqlWSSFfOS(XP!iAn6G8S|;n)R0-7_rBnj67->`Uc-t0H?!s_nwfo znh5H{>13mLzSp40;NIdT!_;Td<|x+dElniuk{!%EsoX~3olQ&3=#ne$XxYcud-gsK zD9TZr5APElw3na0JG+;%qN%G}!C`5qVQ~kG(o&1K`7+7${8K02uYEFQHX`7-BEH;_ z;D480B2;A_!>Xb(&4W!vE-RCfsaHz#8HJa=p&EAl22i z+yMcctql)x||)O~Z*aLGhz4MhkWode2NTGc6O*?3d1;l~iRooZud|6&2PT zSe&bz_9u5$@|7x#$7gzjGeIyt)1kAn(vXHHYg+sMxM8vvjjB(m?H<3~O0cARGVJ=L zK}*mH6;&kHs~MIUweiEAc{h*grFm#|^_?JM7%t*{?y3VGwrNqtrnyD}I;5(u7k= z<-9hec;VJ$g~^XpepJV{weZ$Y3CR}u(N#$^@IppHlnA{g0Wy7U1)1_^iF<_+CPZwU(x>Na4e~NAeL1;RbT$+3 zjf~64{?|H&sGb@m;NM~2Qu2lr4X#Wu=i{&$#9K8(l3 z49GS>rq;*ldGXX{dCD8Gk%D_lg^>>D%_lh0v~i6q#7r0*IYMDsQqcOt4MN5NV@tEh zlYIK;Eufb)w@M@bZD2v|Xp6}`;rYf~QqITKmx*`~E;Uf>j^2)Tmc0Uda1@#kmDR6x_cw3RG&+fq8 zKfH$dj58I9N*9Qjn9qzTC=A787(MY#f4;ab`-G=h44}=z#zrgcabkgT^b_JT>$-Rt4jTOvX11qcFg#ZLvz1d{Oj?^wyx%5;-*&1}0dvgePNp zw}71UoZVC7FoyYg8hd-kxHzRJ!<_mrHjWAKicH$5aR;kQA5HJ&f<54RTSfu&UwsPJ zM<8=h+y~v}_EzE1XByITk0#UnK1x#5 z6nkjai}zhH1x-uA@zU+jVOBU4%%Rk3IvkB&xJfxhIFO$@KzElf(swxYG~3_g|P!m zZ7e;9^VC|Mb627ik)4X$&QaXv)|4mYc#eZl%i>t`D5*>4-F(Xh!TODPG8*5%8c%HDVbfcaw z9PcL1SgrULU9CnxDkGARd<965DPy%xT;%PVg%2`QLe-8zrt&QsU#-{cIW!xXI~W-f z>z+_Sf$~o&>+;ToLMI!)f|19Pxg)c&Gy*lOdmPZ=O*ZroRd>}C9%P0(p|4HnoQgG# z7+u)mmRO>!E}^T`c-V}dqO{jXJ9~a{0!Otw4klqAOfS(DC$l0M{QNpJ5f_U%edF1* zd<^CL?A;he1%-RWs1WxVX+`?(Gj;AmxmnKB$=UMc8__A(2=-mf25~wa7nBD{f!H)@ z8?=+i z8hvLhOFO70kueBTTGD>^4)v3njkm9wKyonPsmR$~Y@yE59W<}F0PPg%b5O1rvv6#8~~M6B=ycTv>X(iI_5axBX+Y8g(^haQ(^iVg=d&ihHCh)CWGfSar87X-H<( z7ZX7!AEe(Ry)$yLb|EBJ1~Qs=5-KHV|`1_k)!x1Pt-=EGB^SB{^pZ7)BJb z?Bzzbke@NS?450>h>9w)u&@-Wz_?G63R^V52PYE(r;I=_u2ovL@lEMwYYA_(^)3iX z7Bx%aT#Io4HjSLSKih!dWEjt=J@C*_Jb^JRGvnjD3P`h(PR;EDK-uU^AmG{ZLnqj! z1E1&~Je;Sme!Xq(AXCo0;|WP0GR~|oKB`L;#mWr)Fw{w`l9y%ZLZ$c3PkvJ zRrS6g=-xu`4Ng)&Zk`y6_f;yZx*Wu;8k`AT@XeF|19ssNGHXEQ(-R20STM)?=zQ@PDcblRkE1x zq64*7l0VFx@ud*7ISB>`?9S9lL`F<%OG2c*;;KP)7JpKt>m1C;-Y4~=5B?eZ^6=V; z7ittumUeo^igHi4XkX_L2IxQ?HZuUh)EgGeAb!y~_zb_UF?8ADZB#OhrPFgM~wY z{>4am^FHFgc7OtsjRv-0Za8X}T&@u7aZWZ|9m~_6=H^|GWSRPZ-{l7+pj$}N#|MkN z>uRsID6Pxiqt4?#K?Lt|cU3pypgJo%kVfFrakn?a=jYvw*_WfULJjQdqTHSjy9vL` zqe(L|itWKc@jH+Rg!y_KEOfm`KmtJ#q4;&MSL>kxKA|W#i+Qlk|Er#X{So*7lr^|% z`pH+6a)tP8F1pt%Z?)BiF(LZc^1V`fQYc--%%S*P7-a8l6L8Rn9Vp;a-izU84VQ4W z>#M_A*cH?1Aq+SWMe(|1g_VR=g*Ak=gII#Kk@ex>q_w?)K9p-edP!AooQZcJJ-EcQ z8FWbt?`$C)X~g3;poX!aIGXYFy(wcL{rQrwq*?cGF7BsO3{_d-Z-OIAx}DFpU9Yqy zAtWoL@nu>sTj6!wPu43Vy7_E;r=y`c1TGATKUYC5JHGCx&JDFs&t4vq)4Ko&btZLx z^7|_}hV-Lu&2a_U@=1tM|N8DSs=c_jS>6Ro@`5L9rgfr|6@{@ehieN?>jzIc1wQRX zZs&(ZN|xox(a3p!?|=RKTg>KFPcq!shI6b|dc|;khgq<3laxy~>h#A>Iw}NbFR*Zv z3e9FQbo(f&3$kluT;@OISBew-{o~ALubhqvq#mO6-1@b$BNDi`8cKV$S75J7&1bKD zp^FDwT65l?MQ(O{gUMy@=YW>JbAe)c?uXf>^KF;Ip1~zbHrukwqM|2EFN^kM88))& zMxIN!Tn{wzr`X!!gQlG6)WO?luh>rzC08Pbt!rwlthQ4YA5`YSVp%Aomy0VZQjkng z5ZE{;4?*Q07aM!Dz9ihF0GlG`CQSRa$1~0KJ0b`%^bVb!GDfob%D`F>&`*B5E64-q z-S6Fd(y%roH_NkNwY~M$qdS7T#MmXPw?u{hUoG5c+)hhC{`r_vUJNL0bW z&Ov8;XBW+D^jKO^+JH9OJ7V#86^zOc@k-tdx3w`b!TjtU9cYxx`0noP6NE;DsY%+{ z?S|?AXe@QDmi7=3SnFP44z2fhnv1%1n1CD^8TopaN~tnawBrGl)*SzrU)z;8Dlk=l zjZWVHG-y)M#EGv71u-$>KvTCYoYlSr%>k*w60hhRs~qD}!4U-L`a)5K0T?fzw`kRl zp)rZ%HGe-ky5B+mG+)$;m6;iZcMnBazBYgFtH1v}qppO9^t8fyoNZq=MW;|hZUNfm4SN5>-pG-bKX;0S4 z9eCpumhd|k8_5!jD6KmzYXmWm{jyS#OoV;jF)oSS!+rWYK$hqERZz~3Hee=gVxu!P zm!+4U>%SVng6&G5)CO>Gi0h8W3{fz9cUg-BI| zPu>Yc7o~4v2i3>MP#%m;vMJYvcTUh})qAFC`)NzV!;`-li0f@RrI71ih;WOkVn*O2 zr6QY1Whq*}5Sr(eei7BnN`s5-MZLn7f(a@NH`m1zP=kO99R$0T)ppO>53hpby(1xE zF-pmtgU}(|g+hVkt@FX1(jRIAoGk&*YrmPp7AP z7ylK2-IV=!pdJ#unh9qk*4LgGQaD$&msH)%P+wXv8qjL>cM=G}hZ&0YsJssF$$U?p z06?T0UBPk#&a3Y%7@W9suy@*}cE!`N31xmkxWT%SRY`8F@|SzfY>Vwd%Ne;@Ir4|> z?Vgz0Z=)6UL86m8=mf=L!mc-38_=@CTp!LjcJZ%D%1p)3+6Vyq3J?0kqOTv*-yR7G zyhRnI#@1y4cwH@v?U45)L31s!LIrW zuTOyn<#q+TzDT+z01atj8DaT+#&bEZ(2nU{x+Gd|pKjJS7NGdqWs&3T$zy9Ax&HhJ<`)5LpZ-t-N*>beb<_n#y z@xUMPt>-StU)yVS`qA~eO4`;_3)^lNr%`IeviXWzKUbNZ7s+l~@UJ2Cgdi=|XYHqI zXuh*QOd}Ofyn4O6vwK`nkdKCjCf3p_&87a18Crob@bRSACv~U;AvTaCbn~GoBL|Mx z>!W>w#$#xhkE1Q{a|v{k5-_(z0i|sqh`kR`Tx-Q=+UX)3r~3H8B~kSsW0}m4tFmIj zJlO(v_IjXS0Yg~$^)M%Lg4q3jW%@7LQTm?`@~uKy5sALek`$ELuP(WV-fv zQ7c^HO8Oknnw5piYJe|PCDmeZUm>K#uxDcT5y{?V-?~BwWmd}az-kN$Xb?D$)u1~= ze|`FYcBZXEugj)i7tk^?>Y4yslc55 zTRcHPcTT9S)73Ow-?J?QfCwyd^7095+iOc!C;MrQnNuAya2WVWP)1f?6>EQXltqy6U;Syh{7@5q;s}w*0&ADHAd}uWSpVPTyPuVF zmY2qfm&j=a`T0k1=xb|WAd4_HVst5M87`9n&h>n%sd?+IGXYR86YEr(PQA{m2WEB@ zL}avsN1Teo%+&y(5^9g5B4@>FoNdOO2<1ut?12er94lH#50#<@d}tE<6#JGg`p~FD zmLV!}Sivf#y_a-YzUWQ(p%KizsP!B7mBCY%5BXlN73bH_+Js7wr1j2*Iu=!7$pIfkP|-cnAb@38kCs)s^Ijz-iN0lgYjF&Z`G>Xa|woZF}PksIUH8zzZP>1&~*P%)OdM6694wXPl2o=+3 zwN|A+2|j(nSRZ~bzWiH%zxjKKo`g1FbN6VpH)jUS-}&W=)9t*G9SsD9}w^|0Q9EGN@kdoR)IutKXuJ(pLO zmzIU0M-@{B&xRLJ{Kau&nE`YpHt99%MABsq25fDz4Pf+7*1LF#`P{f+px5cxdAVLS zs$W$jH?kanM-ud~snv=F78Y?Q=`X^>?Ic`O{@C7Iz8i-n#i#sO{Ov*$g1TP~+?=8U zE4?hB0J~O28ZQlnv3kQ2xaH7@aUKZqmUOr}(4-Jwa@0Em1MI7Rjghj-C9ycSh?9<| zS2=TR=%Vqxfk>6^$@|rnx1ZUyNZ6XN;Zeegw$bj*1J4W8*?Pa2#MlK`t4e!V_Ia*O zdg8N=r%qo^oR70Bu-vh3xu;UYLtCvJ=Nf*z$(Ej56=r!Dd;JqaMV_)uLIBL1z)5fD z(1`%_w0V0-eR`U9RQj{6RJ^Q+l7G7D3ptcdr?!VyRE}gIim6^|TOjKFo`s51Qc~{D zViwR{$`vTE>2BTz&9udh_!WgDKV{fd9uen**+@2%pu*5bN}~GLAPAeAQiN{K{J*vI z)+dq}kCG?v%gI%OF2<-h)R0>`tFpL)WcY#G&&*=Alb5}{l-8E;5_5~5<4T6ik5!_T zw+^IdN_4u8Y;6y$@;Qiy-4dOTXFOGAR|T>}e>4EqzIpc_ky0}(LCea*5*HnNv^rol z`;lx^O|L@u2F(6uf4d;|V5NCsS^dWZSEK+A@N{*Cj*;Tp_`e{Skn@WMD!U2GLa79~ zcaGevI^<+h{=U3nsr#wlIbM*FSua%M*%+?yYqF| zC)EcRfuC=ltdGfgNcEYh^R%AVAODxWK&)g5lQ)<@Wf^q%kB+okTy%qNt$cB(SFibbz0ep@%4Ff%6V<*6r6EamDg<)T8{so~Qe9%9gW8ohq z+ZM)_+kZxY<`J0)Y9QrJ8)l}S6d2!byW^xLb|ij|HXh0BNp$fg8-Elg<#QWtK}+?u zvNi-@9a=&|S@L=c-&DqX;P_C5Kj*=?0c*G3!MF?=Yt&FR`H32vjXIBqqYA1rqH&GL z4|&)V`u_LfGdDhnJ?G*3qwl;vK7z)}=Q95~U)FI(K2F{SS|ozCNBDjyDm7pdX0XEL zT#Hl_3#na&SpVnW$JTIU-sDSLe)-;VTa^ben18ya!i{TFVd+O+Ip2qa*_}hTUfpzu z0t0+fLpwo>zoub9U@Mt?=ghczO$)wN;-Ws-ctB;!fyMcT60VF%b zk%WzE2B?pxR}T9)j=%#;{l~N2WH135ec0G?#%KD0IR=z9uZt>n9JCV~EZ`;TkhF0t2Z zD)L(X$~*9Sj~@D(t$)zWs$ z{VZFrgp`N`q=1>)Yja5hCKT?ob3_oy{Nh!YnppwBh zU=l=gbt?Bi&)pQFhX)T+VwYrAq-((+Pq87+^WxLXpDfN$NZo@P5nG7O?`)bwASk*oaOgLY@eB%3n#Ywy5Z~wEtz~@bfqc{*Kn?LWY3yLSQUn_( zDLj4hBt9T0%l+GD^M9!+H>Zl6LX!4g9Y0SE^vhE+s}KThQB8?+{ee_|P$2>6X0y9` zNYI2a$A-Z50~b2}?DO76t5tl~9;h>Kc;MeAi~Jwkum_t2qp5a;$Xq8HFUgF6Y8wng zzM*4+TETA-v|=E*3yhw0T=B5CIn1ZtcH{*s?Ozi?&3!K1tkOwOPrtbYe|d0Yj_e_x z4Ar3om4?>Vf0!+@pGzS|11&1*P!3p8na##1&%~gVXdD=Gdt9eulx`LE132(iX5bOg z;f=Qz_Y&rBW{fIK*nr`~1vyo}IP1ypA}<23{x72inI$ODcFBcaJyj0>nQ_BNp!$-I z77V)wTjDIGlxHG_;?cP8x7wRX$EkV19x+5E0ne*-hx*o6m03R)+uZcc(V(~`Zt2XR zX9U?6e#%cE^shnGWtgmnF6GlvoXO9+BFgXlE_cAV!)JaGWtC}pcjX4@i}Vg@kVSu2 zURYb2Tfj^q9Nh5RSZjT-S=ZTMb(9 z6vs7}^oR=h*D~SC_-|!`Tc5Zv6~)T9UDW)e&@pNdLLBG!b12~H%Jl+FuXyGqN0P$h zNxEPBxj!-GSqq>%WA3*ISrlpKD{{^QL9Y~gnLtf%s-yKl&6hkSlm;=D=em>@65{u#V=P|>JS+8c+D5!+n$g$ zHDDomt3KtwXWXo!wu&$?g5GqD$fX5nbdkyRTRE72;rXZje<)Xe@X*WFo;|SyRz2O7 z{aQ%!TaY@kKg{;^N@wU|XKGLN0}t7a4-O&uDJbWjJ$V8=y9O6_k&xss;GH+L`_lbi zx_|#?AKU+{^!5jT!Fhhk$zn89)BcpQLZAEB9HzVOZP2ng2G5{dwUmmM6~226y}IZs zd`Kx<}%Gz6oQARl&$w&3Ol zut{h2q__X_%89<@nsd0d8sj5u%WWy_1FB&lnbFaea=Uu&qX>Jw>y!W@7qAJ1d1iuc zFqovrQY^Dq@V$@U(?bOma<%;2(C$z4x3ftBid}IB4hH7=XPLPPPyYw`>ROo|?e}k2 z!14Hlmau=9oQTrAdO&v>_(&FyN?L)ISpWaE_m)vrc3s;r7AT6SASm4>0+Q0wx#>>n z2BjNm0qGKuZs~3ikj_mvNH+qTu6J$ly6)?~pLe|P_dGwoF}^Xrf3Wwt*SXd@=bH1F za~^Y^PEHwVdN=WW0Vldh%zw6BXo$aJh$sKVWt63h`EQXe)L446spEHq#bjrH2xfX0 z0OB|}o}^_MV4`RH1ixU?(J$21Pa}NC2_*Rc%I#lCaUZc9p#i)t4fis$$qH0e>`;*T zU!c(12VAhIy4+u&=YccbkDW-<0rg&Z7X?V_CN7RQ!qUovBuOl)aV9G2d_x11SNzE1 zc03U-5)!>2TU=s$!#E>MU<&a;I7kDB*sdF?Xf0iQF87{~kB^Rr@iqtZ78ex^ZT3yW zG@9_|0K~uxICYEN>4v%m3X$6H1@r~Zc3}a^o%KVanRL3Zp!)`=#sYY%;qa$=L!`H| zdU(^B#7j7ET!_grV8S;v^eJxqWyIf)@82Ro(zhG_E?QKOVx+TP1)TA`JhL&fvuzJG zI(2PPIpYx!ia#;~kGmDth zlS5qM+1bRti7~caq<2s}o z;9LLvnFbiDIzjQ;@i!p4D-a?s`q7~#+All%4->f#KqpX33ZB21V)*aRJrkKJ8xnvl zX_lM!fXNG0EOCwF7EI(KT>U&L;lCIMQ~IonNi967840?8d zDiG(D?-<>el7#yq{~Le}LL?p_)9nPl{!dynQ0F`#HN*+dZshvexWo6M?xu(@*#8LE z{7F^(6F8^23N-)44UmR2g|74d^OpaIy#If<7V!UIJ^tUo)0<+9T1x@8x3w3g=IEG`)^dkX z6z^Zfgm-mN!C`edL#g~0+tK!Ue3BioY@&87ib1|5IWr2LZW*|vk{=8L1#5n@6jTd# zJPh)Ex_!N`aNby!mX-B@I_34XB{WqXMV>08hXsL%%c*wrv&J!W%;%SFHUlz_Y-tFUr@pSX>aqfWWuFp%5cWYL8a#9S^QTu?_JH!= zR)oUAUtXSC$-cd%u<%bp#;PB${6BI3DX5grayGIs5USt@hRm21-*R!)4-_P34g$Vc zvCWyp2&JH%oG&*wmFWPFQ3BvsLlPAweyX^YNtC!ukqc4 z^-(2RONQH%_!a+6yo6DK=KPDEBHQ@ty}em62DN}-mS#DC739X>c9_G z7{WtYs)-oQmTl8R+e4|`Wzo5_pvA#r>(N22F%3|)|n*YZQ1P_OTAtMP96y@+Wi2`Jj2E9LUMlAt-(07!+0G0(Di5QolJVYUbVcDVBe`)tHsib z3}Y01gAnZ5(W?c_`zjpPZ}n;Azr%LJX>uU}nNrD3VGToy!NDatHCQaw_X^9SD;i*g zLPhf}=`2Q`p8YlT7wEnW=9tefpS`5lO^UWK8YEjAp5k76%|Fxo^$oGr6WsRqZ7Bi) z7aynm$|ynmEq^iG^b#IBB}Y~5UF+=$GiccJZkl8RxOk{Ph88lKah+{4oE-m15n0yG zJP{uxcDuX{OPMW}$6m{()Eq+2qR(Klj5kk-BoZn*U2GR(uJpH=L4#3acs}04j#yn) z;+hM85BlSo*W7Ya&u3se!i}X-ueP1Oblm@1rX8S5zFt1Ki#K=GcRMw7?IP7O@;d;^ zI<}6~dcrcNur(v`Q^jqIej&W?cq|=4^)ZyPWZzGhYG98n=jQNX$O#Mv`SUGe=jB=@ zDba2NHIJvEX^;~hn{ol9fi-H2u4a&$6@9!{0!=g8_YQ~-PuJ~`fpwCOqdX?E3ujLE z>DAi(uB%64RV3Cw>9)glkpn^uW>os4^|QgQnyCtho2;f`{3bmA`8XR}QrdXxNd*3u zcqWyDnH9(Iq77IXuYg#8*m1d|Sw}koOMSsr8_R9X(T5Iui*@r$VrGtq!ij93&xen* z!2ONZ_AH*K@Vv0rAGur>Zrrai9?GpVzaTS`b(M-YgSuO@bxk^Im@F=APPoQ-qZZ&nF>x!Iynk4e7P8D>q?PHG(?_{DUw3{GfNx)w|c%NdOX?riks z;X7*Ce0}4K6~37X&dS-C-=N0K<=JDL?AfHJI|Z#mb#bLeEXJFf+zr-TudYtg4MPx7 zu&-QKU(^ZqBlpFzBs#xq^%9YtDBJmoFEE6GE1X$Ud(kzgb#;kQCYZ;==d;`UrBnX< zfY{7(9{Y3K15e>NOLlH*QgiMWo|&ggj2&v5jH%4#6Rsznfe)i=5g*}*4|*D{YYq*vIIrtn)Xig(vQR_7bGW?Uq)4q z$xg1zJ^(@?2ZTbYQeSncRlRe>JP*kd$T6+3!>Vx;z{4ENWi z?p=pL5wdRId@ctX4Z}bG{_Z-9h9G}~!9LwkI}zSJ@1Vl6-MYMp*dG^DtgUk~KSR8m zdhPk=zHsaxTu8t>g{@}Z{?v(ZqH#x{d1T8eDAD@kQRT8t^Hqi>K@MpAh=A}uvfncS z?+DhPDFj%za)^c$Sl{|8@i{D;4sv~0Sa>0Aptms@5)-M9x58%r{Xls#jdwAhj+C8;h*Ho&N;uvBN^=ExH^~$NVWnZ?<)Unp876I3Pg8r7o5L^0keW$)FIbN<@_0H_`kW8*GwdYBxEgUq4t&n z7#RVf=>v2Qf#=Cx9;w*q?Am=>3K=qi|fp z?#hytNfKSp??YmE4|iweE5&9Xl5V=KFkSk7L1(ruiFd#bT52_ZB;*s;t=A*kp|3n9Wj{mC?CW4n&?U%Iav{MM6sCbh14^-W@M7;I`fT+9X6H zFqUl~p>i#m?nl?mmx`;j?bd;=efEC|LU`vn>`) zqbCTNm+gvW%3-WmOL?(9RmEUBR>=E7+_0#!L!b|MN=i(9`5fis7+AQhy zd)dzVYLJO}gm&o6je=^u2hzoa;`Y^uun%y;8Qelm%THX3<7iLL`yGTa&zMY0`fAmg zRF23}OBIc+V`|yl{0g}GzNL?i$_rU=wc!V4S}p{!UqV9&`C?%){ll(XKc`3SC4EkF z1b4gR*(=_;-;Piz%nxXBhKcJN7_8{`#6r`0qF$?plR@$|>O@;X5xeP3Z4B$?L|KmO z#c6K5^KQ0CXb44{cnm$|W{L=@XcSWr4lA#Pzig(2UK}L>R~euz3A^7TXASXAcxUYf zItXbC8uwrPKHgnOxtCS>(~$;eIHJmONn0_*`s~nbLU&8oUlQUvEWFSfXfl-b)MP(k zLXd1(C)G}(6Ps-Zn@kQlvsJU~{XR8|yg;*=1UiL@y`$qmo_}Xz@R12xyqdQF3waR-w%u9U@woE$XlB`{dLwB;{~u)E4O1le zpkNPpXvd`lq#Mwe1ov1>Rq`CsQaP~OZVI{03<@LF_iHOOLrU1Q#CL#snPGj(ieZZoBf7(N>|>gty$8kUp-S(b-*?#vB%8I%1+%{rIK=Qnqb2$Ytp>>7QtdY!y=xA zE&*AQXK1rzs5cDZA0Nn8bTka@4bQPUmq{0m=WqxsGvXY~K`@c!fn)}kWfzzK%DA6X zsT?=F5Oyc9d4ka?t6#?qei&gEo`@)h{<-Qk<>u4XVY}sTC5+p*oIU&@*@SF5_a0(= zqu294uTPbCHr{+JMyn;aUT!=rTKy7qveu}5yVNuh#{bf<_sc3W897hA;fsdZ0+k$% z@qP5}bAdxqlnF8U+qf<;3EGaH@(&$a*nO0z6C{!Ma!JSaYnoPw!QLv^D9H00L;qsrE* zn6#R_M8e6SCWCDn9nTVD1I3j~^f~Q+C+QlXK+~R)vYSnmI-l&}zWwm7sA~!+kgso2 zgM))hJGg|B5e3F-9jx@zj(XPyGiNbq-?fmAxcyrFD1f`R%V!o#Cl*C5U5!P`#U$_o zhTa`Qc*kTzZ3x+|oH90i&!_jy=Rsssc8A``QpR^fDOZl&zBXze9v;}+0+li<(j-_v z5mIB@+w)^|e7Cr*vDDV%R7}Gkv&m_D6uaj z%#Dc|H{HqE;oH?lT76$kv;T=bzU~S>3vFZ>&Qq{nGKDx zH}@oZk4Sy8)gX!JuOWWLp2aQzj*`xaezs}$|Ni~EJ&uJo@6EWYndK8_EiVx+E{FmZ z>ea!S5X}GG(mfM)c6PDpbVSyW__DPrXq;CQ&x-zDI(Zpwxb@MtdX+RfIaAhv!4^<9 zVwcu-H8vXsF_O$^_m-P%DR7%Dq_2Ae&{h z*N18HEIhNGtG`cakUTj3C8ngfyr*r}pj$OK7&IDy9p7j37t0n+MB*^A^cJ@eh{GDE2LNUrh#S=n`kI1u}y zii%8v>_+O8dlV|{DG%)y+e0lHE)M4!J#pD>&nr~-erAFx0U!X0V~$is4^Xjg>t`iD z0kRNI;Vp}%&J<1ytc2&DB2A^{z2ukTTEIpz(;}%i#1hR$v?jjM5uC2JnVy(cqMYMJ{(>xhGLl%q!=z&W4jefEJTH4ZBC|%C@cFy;N!&jxU|M- z82{riH=z9ic@ZQfh0~wMqi}tMzD(_K1PV1)L#|@ED?0cklb>YZ?U_0!mg#sGXJ??4 z1;Zo91>T5%rE?cu2*9KrIFss2;EZ`=w>>pb&^oR7@y1rLeQ2;$&No)CiEN;?daP`@ zE>WUkt5=`XvdN5p)ucPwC|mzs&8fH1BtYWs`B;5{1ip8u#p)EgbgDzNsuK_ zI*^arHX76y;V}|5Kp`6%QXHg^c5fm*#-UKJhSfP8t#0$tio?1uv#jXBsTANX5Mq4r zN-is@Fn}yFL3iyj->&4hx1ld(1)Yri4pUK;wys-9ldaXKAJdC5_1PS->$ z^FNd-wYAoGo3TEeGZ-^oVUegSl5spV_RG+*AG*dd*u_HHWxJ*}l)~<#76zXuqo2%M zrg+63oSXBo@OUcmR`R%VwhXDa`q1*ykBg^|pvR%1p;pV?l(HG(QPj#=%jx@FIIC$u zpYWY7dBCyTc>2foWVfqJhj4Hr<=(DNiPt~M$e{C|e}syLUiw&jbo1srYO!=c$^gB$mB9K2^qzgp%IUUeOP4TaC=&-be# zm{f8U09!|(GYp^vxiqyhqa?h9!g1Q;DSW%w!eyzGb#4%;PBg9BlQS7JUfYf9mhcU) zF{{TJuHG@6JomO-?wEBN(2nOqCZ6rDqV%}2vD0b&B=Ve>!SsFU5VuLcofHYi5az|F#1t?{yw`FDTBC85NOC{K~Asbv6yRy)3z zx)Q}Om&uWCNCaNp>CO&M<0hV#M!g`T4Legkl9vVESvGkY==Ko!;tj76#79Qbm@K+1 z18!k1eV>DoC@*z_3Hf{gx^EjDJ!->u!(p?|vOFRW6Oj>%FWw$HzFO~KE4=X(WkigB z{rUx?!G7{2X)5$lde~4m;kEOYbYAcV@)}9@95dx11~r9R<%gMC2Y~bTk9T#Jwk1iz z)1uh)rn7givP*5=Pb)%4+Hr;cf$3{m#4gh>k`+M5MbRbuCneeNYsm+Z;|q%E%1ZB`#NWD0VU_y^^Dgj^*bP}p z2-ui@O00QVzoXutcQ@1X!DKY~TN?4Hn%z8K*@(L7GOn$i^An`mfTUX|p9avGnVD;$ zxoPK5d9V!5wmrR(F}2VnA=qgz9%2+YpC6BJj21Z(z=LKUa-R($eiN<9$%Y@kvR`f2 z36rv1>;%RAHaTL+zMudJ)_n8Y9C}=d=F}tv+sEmrTs=k6YjX;P zFC!Sb_Hr6JRhiJBa@tia`SYp&rezurW3s+(_Oznej^cCW;j4t zoqWd|lb<5evdAZZ^ ziREpU4~C23Zj0M6!H|BFZLj=PvXhFK08Ly*)|Ok2?Q*4X?_Yy zar=P;Eoyl5QY67)e<>4W9FXX5UoLJu8t}-ErNEON&yg>vIyzd&g#_-H42@WT#f6A# zUmaO~N8|PonM2hIdmvKATk}}ma8z=O{cPs(3a$*REbcPb=P%6nt9D&_d<}a8Hu*ms zqg6xI50OJO$^L%AZYiWpCu;JaKYj5mU-vlaSl0KMf`l7a+xDHzto*!$ z$7?4|9|KK%**b#=e_hKXQJu0C=7m%Np}dkcGrP?im+rA4eYN`U6r^9xnY*yGTv(4? z!l=bAuIz&fKD_1j&~RRtF!W#G^-j<&pQKi=j=`8Juu3L8bdr2o={NXw+Aw$XyR;lICCQ>24VsF_ zHjTwXeP|GqzNpt{@ioCpXSRmu>S{N_^mMX4IpNi$Oa97nlS>ElR7B)3&> z(|7|79+%~}-k@x+NE2Muime|L=)YQC)#ti24rc0h41}p0_Y)_U5vOPv^oDuk^IP+Z zMxDxBc6eRh5{sZ972vH)6aLcLnUA%=W1ZWjEcv|@5v7bFj}v%RxpzsjLJ9d0FKok` zeRZj7R((i~;~rRvx6@2Jif|_+G4F(QCM$X;h1~aqCkLHBFW0tjFRn|26BDdi>$11o z^6bQ-xGU1|+{TRZUllbQ87pebjlMiD7YQ;WX1QIOx8$_`KPZ<~9EL6pj9w{!zI+r$X=2*#NLV z9HnVXahg#l>(!d~cNA)RgS!;+u7H#!)*L~{-!Q$CCsd!CBt#u2Q|AuOam|I$p0aTp zh1eOy`Sb9Tr^&6+gMa(0jP@k4a@W37CXIGFpFI3JlE3d8;rMS$$+hRj>gj)~bBB-U z5wE$k=00KUK2Z${`NgHm78$?w{ZRFougOCsNReg>{ZfpN@R<_aexIq=uXEN~9QSj* zK`IwKTK}EpG}+MUou7wqZG4g>J2^VZd~&q?p;~Mj8Ot^3^M5m=XzE?68h+`9T*p({~t$E{Ynz?#eEj zQx%Qm2ul5+G2o=M_YZvblFqQwXe%Hp4|-x_7^-fKNjD!v0F=G0w0%nXgQEEdM$Zr* z9xlEB(o@I45Ut z`#JSTM+~eo1r9ba##1*2$7MAw#?kv1GQ-Vs)W$2~cLdLIx}((P=g46=_r* z^TirU2wHOQgH$gf)PXmF#D(CE@#Z40cfca8R0vs2!mUJ-3t^A#J)q9Xvl_3|_)tb1 zhd;-k1vx9GW8Kp%)-|FkOxxF?asqG;v;a^2=@*(x*6!x6nt8n|wSK(xk?QbO@&fsY z^{T()gXkm3&*hkZol7e?dD7z$svdMs50`WSwBgT`glt~zG(r⋘8X}f`Y~DfAtY_ zVfmM5^l5p`M1F5`$3jBBk|@78j!n7z^Gq6>g6-MHGX_MXD~3B!64?WKYSRU~wvey7 zPY~W=8T?3kDi&3M@-W!n6(bdGLf|oYAoq*_xNQE^NPLWMCo)yNZsRgtY;|WcVeQOJdNv@1T`==PjMVWmxnZKQedF+~;~`2qA1>bPmUax3&W? z@OrbmQ;&oEAfF|jE$$A5Ru2*|M!+;D!0iwS4pKqFjwp3u#B_|S+uRwfgxzLK@6T1} z_}5uTnb#BkKI9^90aV8tr4<(K={c@~?{KqgdK>KF9i%=DeObOqOB$hpXfx7%4}$w1 z1GQ3&*HAxA6#V#TXVz)DvTCP4v@A$f!D3AJuW2w+18?9iPqrpNFpk~$T(xZZ&R?oZrJ*EgcTI>h6^LAN{_ z-&efeiKXNlUn4d>*-)vGLgeY>lpw7Qh3NW_f-b(6m5Am+8;jS)&FTv3fzR? zzG%;Y6eG1#IXykq#D9F+ty+8Tx~M~VY1edwdq0Mr)xLf12Vuk1OKvLNquvj*2g{+co_%{vW~!MmS4sDAr?mo4Li*5l^t7~Le+A!} z)&nuZH$?{Ed(rR~swFFt6JmOo?+d(%YJe?FC6jhP4#9YWGBtuj;rp;h%PY`x`|#8z z7w(=!a3;%9LSvtm1%~^iG-_?1*BlXnFl__7c~j2xsq%(j82`1ooM>35VGh=T8RQ5;1Jcrj~ou5llg(N z43b+s4bxuFyuT0Ah`t6$X8;0$ua`!^vB5CSnR_cTZ9tK{*j%H%J*$G9<0>$AWgm?sW1!rR3srZ4V(V zFE5uf&QmTCROz{;8{!aGy5V5QB8mX}mBH5S^5mu2 z6HD1c#!P-I4c$@JU9Qg;06tN`fgmKigFFw*g)s#KXpjGmb0EP*BP%zmAn6Np{#Dsp z#)qrd7V-g0YMduJLo#tDOPW~4tCVa5M4j|hL1Gvr$7(@N^kjbp2LQ5p1pd+^`^ei*M_c4*eGxw#+CY3Nx{z<%uSm!i6--~E*kLUuv`qMYVqg@lpc zNYQhdkXe|K9ww*1G1!D z(X?)7hj|}uzjrM6#3>fO=W#rTZI17QBye{E$Oo^nf>DX9D^It`A}HkYY^9C&Ugcz% zk){9eN^8tkOA3->Q{sox8Fh9S{`N(TVH6k+oRE74H^+>-{BX<`@ekZ70kr4G@XYDQ z$g&>{q^`y;R2P;f>S9=hxoFUyqXZ+`x)ps46l=qB*1X=d)t(=HeZggGJxT_>v>LS( zK--vXSicXeaiIcX>})>Y$GMPX(d?7cQ<;oEu7ZxXcCl_p)5IPR;2_v-jJzIkJ^l?S z=`G4^k{eaU1VrzdXjTfAaTywqZq&k9J>Wsv;C#8xyj#7R}X{vE6C7V0r z!R&)MF~tk!tW;iK;WSr$vr(QToJh?>hWTwp7;Z}v|c+&)W zFb7koT=6R`f5-^|Y_2baBv#}mr=;#WL*j=h_f41b+4cFzFD#^sw;(j$1W6DJ#9Ro= zZAU%OS4b0=-68)Hf*Q;|(6{|LF*?o5lopQt}w&jH7v3R^aYUeDTfAjxVFCy`O9M_%^x4DmyB zilox-C8OE0Le(FJ;AtR}jdQ|uyqcIavU{QG5wX{fpojtoVc^K$ZpO{(0yb0rq3X*r z{$AYw(93Y3u*?~rAlz6MT3vFSKH+v^BRaq%yinFb*19^=ycjTId5)ZFK@Mj>pS zEL&S!z{Tjt9*&@ddl-6oih=y-+5#{Hgy+U0{5*07kuywdk7Pq4dVl|F4lDuO58I8A ztpZ8xa4w6@!A#VW0$^2FMw10>q3S8I(i>Edk-Cbx~BR$*iH^^V+t5tz_`4GC4tO0roAW(G0q&-0Uy$zdUFE!(L_PtEgvB(S+hbccg5w>6|mW-ssW2w)_H>!oXm84(g`Zp}ST%QD8>B}?l>aML8TcV zVR7KV|9-;?9ZpJR~PTayRS*Dt6q2!=YtHa;Kv{4e4U zC(8arV?Mpc50iJH53w~K=7t-6{A(L>!*^bl^p^bUYvoV7QM}qZXKt-SKc@v2dr|eVLgN6$ zxM0$k0w^V*dKWJHFkv@nzinunr@_b3=2=G}5{+Pcv0+aGB@d?$wfkEv$nyvNz zkS~rHgVv|4*$=T5_@F=VBWH7Fd*qUCP7UXPCS$3FwZqTQEDa?5Q!abIg)0nZeL5H8=4&H7u7#DYPTYL&vEcEHtm zb~m;nagp2Vuof`L)5M~K@J9$Ju;9m2I2eYGlE9VRGwS_?Yqzp*+xIeb2N5R_&yDRg z`c81~jNj4yiyZS0Rr|}ZJeEEU^3tyxga_KqvBidS)2))F1=1zu;aydL2CZ6VK3OB_ z){)24+-kl;ySAzK1RVwb7}JDOQnXU73=3vc1##VmEJm9jx<9DEt8aMnZOq_GGitjA zKi}GM`6J6O=ii#M7WR8=zuc_Cq#4`cyDA6}e{iC;*492|K01}0lBJccP4pCc-J`#E zTaFPnb@YCqW0i(|yJpsL?drG7kLDw=ip$E~m!Sz~(W)p9o0mdnVgb92h84_=NpVU-X(KYyQDiMw{wj&AMszMRZn zi4D&spEsZUIL1@GEViC_QosIl(Bx=Flc97VuvmoMQwB1 z?ZAl}ct_w4JQT7Pnq^2pGkZUqh4}rC!!z|L-;*h~(dpgGB+k&f5uch_zoY7-!}Yp~ z=p8Z*WU((0dqs;d5jQ6fS}apDv*7r*uUW;56BSAn%!=(D&UV;8q`7(uvIz~cR^t6N z<26dG&pxuWhZ-L%mQrfsgIda!tqLyBoy^?a2DgKi<}*`^%)&nVxv4sRi5v1pF_}-% zI_Ez#9WN1!15$G+i}P;<2s|r>Y)GS^O~_y8gU{v6>X)Rp&^M=wr4e7qEqvx;%;1skcCH> z{W+DpJ&gXB{O087M+>ysdNcaNFJMUlHwQ5navI?C{4C!tZb`%LXN)nQ#8uB+Ll)cE z8Z9F0@C)1Ot}j+ON1D;qg<8_rL9~!E5jW`jyQWGva;s~`3;j*|*D;Y|JbxJfkfj2& zj|Y9eAKb9qow2T~IYC9hf0!a~_Z0UnANT>guRWm7NKtqFr|ABGG~;i4QTPxD|DU#n z6am*f0feVl7%2GHYx97u@1(e25x{f#2=D%<-{CFCd&}zZ%f~$&^B}JB z2T>AuQ8{v)#|p#zZq0Mcfs@U0&a+YQ?g+7OV~krVnplfPcP|LGnmC`1Sxh0jz+g**m~Sv{d5hkX9Ye2etair}27R+Q9Ovcie|mmp0S$t8|Mjhb zu}b?>gf37SQpn4^b7i$Xp{^Aw`5GNLL1u10%xYk1^Op{}X1#xr6otL0d*7?PrTd@s zu5XIAoX6=j%uRP*JD?JTpoBqz_38P5UZv+~{QUqQ_#8^$qzN)* z#)#XAiYi@y&6Vv@!u&66W2hAT#>=$IyK`FB>mb_e!?FkeC@L&f^wIKPQ#C^px86r) z403qI96_T>qthx*+Ca_ja%nk3sFwupyx6T=NpkKQfdyXkcychh#Guy+ldrNg8OdA0 z6@UC3r8d+T%!Hms$mg#rhQPimr{7$Hsq~ch5UuY1C7L|$RL9K6YK5P#PspzW^C_}rK#FqRBrfKqWLZ$v*e8&-%do&Y{30}QYw&KNZ z_11A4(QNMymKS`F8O%ls2(^w-_8Kr=8}!7qO{%N)v6##dfq)a>IGIe8o|J8HbxXW_ ztx;Vo9#gDbtb4Lu(@7q$_LY4~#g&aLWxfsVxmDvJS^6Qr|K`7(R! zZ@CW;oIiD-xW`3HY#9-PKiYO>3kn95Rnb?1)SbGb3*MP)x+?3B`^!6iOYftT%OKPG z*E$ExjzjlZ0tqzTdE*`@EN{g-UF|`Ju}TB7l&Tz8W<0;f;}MG38hBu-pFJki2{=@* zLB(mr!NDlVQQ1dwedl>CAY_t>&(X28o;V&?IjQ~HTI#&8Ys+`3zr{0Zfe2e2&y-!s z2diT;AL!ny^$nhl4^3^A%T@u+6M|n}xdg@bm%f}9Sjclx!68%~y0%PIXCH0zynMskm8o;!Dr=gDuBpT^6BFxmURMZK`A ze^$LNaBjbkVf*9W;?~JS4CVSI0u$P4>!f$dDY+2TXC3vX`#atBwxhcoC&-)ZE|C)u zRXZFe8$9kL9{8rRqGi0DdhnPx9%aM>zZ}0Hj&bf)cbN21ViJ>IONCuLh#Mu!y zBNmrKFHL5Sw?D?L<0jEx6V@S6H^f&OP z7f^dA()+E-KboS-bphj|_ur09_H_B|VYuR#B*$q%7a{TGtrKL7gbG)DldEcT$$Ad~ zr8qp2{i~vIPhC5u`gEA$Qs(QAxs#Qo+_6~KJ5Ah%b$oy86?o8Epu7<|rzkD`VBti^ktV#pJp^qKWn0^u(e|K9|F22J4c- z_*&CFD#Px=c6f}-8p_$ABL$0CuqUOCApK#=q^Gv#))(DpDWV2P&V*kzlACu6g=+7Zp#lN=}I ziLgb~+W=S6H7I>z|u7>pP}jZkF^RV^HaG54%6p zvdvB&gYBZ8>h<^EzK1-}Y;*dBwOe>+b*MrvdmyGnH(M%sV7(06`Z1BmAH_dkiOphm zRqgDJ@bQ}*Gc=~-8|%JX15Jb8q`5vitK?TkQq{vvD%o(lufzyZ01m$Qb{Ae@efi>g^^ zvuPPpm240up;HZ8Lkf;-+>v>3PqRY`+MhF<^tpYtU8wJmkry@j`=^8Xo-8;Y?W$e- zc$4QS;hKfGO?5~iU)|*cXN~8W-pLk5g_i5U2br<5l&_aoE{KB^rF^yId6$*5Y z^dBpcBbI+`^Bs?^R`FPNH<2G( zb6>~2j(;BgjZ$dAFavNCi)N9?zMxN?dnB7!T&5bC4{iDfSgQJEWdJQ6_Vf*0AIOu; z%&()qjU0J9qtJo?7){`;{V;~Zsgq6=%!-HP@lz7t*up!L2`J@|zcwvfJ$1*C#cl=Q tCjCDH1^*Wy+cNtnFv0U5SlR#TPO+MDF~(;?dN^hj5s=`|=Y8+-zW~Z{i@*Q? literal 0 HcmV?d00001 diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/DebuggerListingPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/DebuggerListingPlugin.html index 372c54f55f..b0850cb8aa 100644 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/DebuggerListingPlugin.html +++ b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerListingPlugin/DebuggerListingPlugin.html @@ -49,7 +49,7 @@ surprising. For example, disassembling some instructions and then stepping back in time will cause that disassembly to disappear.

-

Because not all memory is captured, some background coloring is used to indicate the state +

Because not all memory is recorded, some background coloring is used to indicate the state of attempted memory reads. Regardless of state, the most-recent contents, as recorded in the trace, are displayed in the listing, defaulting to 00. "Stale" memory, that is ranges of memory which have not been read at the current time, are displayed with a darker background. Where @@ -142,33 +142,32 @@ and/or needs a version upgrade. It will attempt to open the program, allowing Ghidra to prompt you about the situation.

-

Capture Memory

+

Read Memory

This action is available when the current trace is "at the present" with a live target, and - there is a selection of addresses in the dynamic listing. It will instruct the recorder to - capture the contents of memory for the selected range(s). Typically, the viewable addresses are - automatically captured — see the Auto-Read action.

+ there is a selection of addresses in the dynamic listing. It will instruct the recorder to read + and record the contents of memory for the selected range(s). Typically, the viewable addresses + are automatically read, anyway — see the Auto-Read action.

Auto-Read Memory

This action is always available on all dynamic listings. It configures whether or not the - memory range(s) displayed in the listing are automatically captured. Like the Capture Memory - action, capture can only occur when the current trace is "at the present" with a live target. - It occurs when the user scrolls the listing, or when the listing is otherwise navigated to a - new location. Note that other components may capture memory, regardless of this listing's - configuration. For example, the recorder typically captures the page of memory pointed to by - the program counter. In other words, this action cannot "disable all memory captures." - The options are pluggable, but currently consist of:

+ memory range(s) displayed in the listing are automatically read and recorded. Like the Read + Memory action, it is only permitted when the current trace is "at the present" with a live + target. It occurs when the user scrolls the listing, or when the listing is otherwise navigated + to a new location. Note that other components may read memory, regardless of this listing's + configuration. For example, the recorder typically reads the page of memory pointed to by the + program counter. In other words, this action cannot "disable all memory reads." The + options are pluggable, but currently consist of:

    -
  • Do Not Read Memory - disables automatic memory capture for this listing - only.
  • +
  • Do Not Read Memory - disables automatic memory reads for this listing only.
  • Read Visible Memory - automatically reads stale ranges that enter this listing's view.
  • Read Visible Memory, RO Once - (default) behaves like Read Visible Memory, except it will - neglect to capture read-only ranges that have been captured previously.
  • + neglect read-only ranges that have been read previously.

Tool Options: Colors

diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerMemoryBytesPlugin/DebuggerMemoryBytesPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerMemoryBytesPlugin/DebuggerMemoryBytesPlugin.html index 79d4a7fc04..e03884984f 100644 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerMemoryBytesPlugin/DebuggerMemoryBytesPlugin.html +++ b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerMemoryBytesPlugin/DebuggerMemoryBytesPlugin.html @@ -36,7 +36,7 @@ limitation is that you cannot use snapshots to display different points in time for the same trace.

-

Because not all memory is captured, some background coloring is used to indicate the state +

Because not all memory is recorded, some background coloring is used to indicate the state of attempted memory reads. Regardless of state, the most-recent contents, as recorded in the trace, are displayed in the window, defaulting to 00. "Stale" memory, that is ranges of memory which have not been read at the current time, are displayed with a darker background. Where @@ -103,33 +103,32 @@ -

Capture Memory

+

Read Memory

This action is available when the current trace is "at the present" with a live target, and - there is a selection of addresses in the memory window. It will instruct the recorder to - capture the contents of memory for the selected range(s). Typically, the viewable addresses are - automatically captured — see the Auto-Read action.

+ there is a selection of addresses in the memory window. It will instruct the recorder to read + and record the contents of memory for the selected range(s). Typically, the viewable addresses + are automatically read — see the Auto-Read action.

Auto-Read Memory

This action is always available on all memory windows. It configures whether or not the - memory range(s) displayed in the window are automatically captured. Like the Capture Memory - action, capture can only occur when the current trace is "at the present" with a live target. - It occurs when the user scrolls the window, or when the window is otherwise navigated to a new - location. Note that other components may capture memory, regardless of this windows's - configuration. For example, the recorder typically captures the page of memory pointed to by - the program counter. In other words, this action cannot "disable all memory captures." - The options are pluggable, but currently consist of:

+ memory range(s) displayed in the window are automatically read and recorded. Like the Read + Memory action, it is only permitted when the current trace is "at the present" with a live + target. It occurs when the user scrolls the window, or when the window is otherwise navigated + to a new location. Note that other components may read memory, regardless of this windows's + configuration. For example, the recorder typically reads the page of memory pointed to by the + program counter. In other words, this action cannot "disable all memory reads." The + options are pluggable, but currently consist of:

    -
  • Do Not Read Memory - disables automatic memory capture for this window - only.
  • +
  • Do Not Read Memory - disables automatic memory reads for this window only.
  • Read Visible Memory - automatically reads stale ranges that enter this window's view.
  • Read Visible Memory, RO Once - (default) behaves like Read Visible Memory, except it will - neglect to capture read-only ranges that have been captured previously.
  • + neglect read-only ranges that have been read previously.

Byte Viewer Options

diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java index 4c2f68e243..e7b06c2a39 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java @@ -144,8 +144,8 @@ public interface DebuggerResources { ImageIcon ICON_AUTOREAD = ResourceManager.loadImage("images/autoread.png"); // TODO: Draw a real icon. - ImageIcon ICON_CAPTURE_MEMORY = ICON_REGIONS; - //ResourceManager.loadImage("images/capture-memory.png"); + ImageIcon ICON_READ_MEMORY = ICON_REGIONS; + //ResourceManager.loadImage("images/read-memory.png"); // TODO: Draw an icon ImageIcon ICON_MAP_IDENTICALLY = ResourceManager.loadImage("images/doubleArrow.png"); @@ -777,14 +777,15 @@ public interface DebuggerResources { } } - abstract class AbstractCaptureSelectedMemoryAction extends DockingAction { - public static final String NAME = "Capture Selected Memory"; - public static final Icon ICON = ICON_CAPTURE_MEMORY; - public static final String HELP_ANCHOR = "capture_memory"; + abstract class AbstractReadSelectedMemoryAction extends DockingAction { + public static final String NAME = "Read Selected Memory"; + public static final Icon ICON = ICON_READ_MEMORY; + public static final String HELP_ANCHOR = "read_memory"; - public AbstractCaptureSelectedMemoryAction(Plugin owner) { + public AbstractReadSelectedMemoryAction(Plugin owner) { super(NAME, owner.getName()); - setDescription("Capture memory for the selected addresses into the trace database"); + setDescription( + "(Re-)read and record memory for the selected addresses into the trace database"); setHelpLocation(new HelpLocation(owner.getName(), HELP_ANCHOR)); } } @@ -885,7 +886,7 @@ public interface DebuggerResources { interface AutoReadMemoryAction { String NAME = "Auto-Read Target Memory"; - String DESCRIPTION = "Automatically capture visible memory from the live target"; + String DESCRIPTION = "Automatically read and record visible memory from the live target"; String HELP_ANCHOR = "auto_memory"; String NAME_VIS_RO_ONCE = "Read Visible Memory, RO Once"; @@ -1081,7 +1082,43 @@ public interface DebuggerResources { return new ActionBuilder(NAME, ownerName) .description(DESCRIPTION) .menuGroup(GROUP) - .menuPath(NAME) + .menuPath(DebuggerPluginPackage.NAME, NAME) + .helpLocation(new HelpLocation(ownerName, HELP_ANCHOR)); + } + } + + interface CopyIntoProgramAction { + String NAME_PAT = "Copy Into %s Program"; + String DESC_PAT = "Copy the current selection into %s program"; + String GROUP = GROUP_MAINTENANCE; + } + + interface CopyIntoCurrentProgramAction extends CopyIntoProgramAction { + String NAME = String.format(NAME_PAT, "Current"); + String DESCRIPTION = String.format(DESC_PAT, "the current"); + String HELP_ANCHOR = "copy_into_current"; + + static ActionBuilder builder(Plugin owner) { + String ownerName = owner.getName(); + return new ActionBuilder(NAME, ownerName) + .description(DESCRIPTION) + .menuGroup(GROUP) + .menuPath(DebuggerPluginPackage.NAME, NAME) + .helpLocation(new HelpLocation(ownerName, HELP_ANCHOR)); + } + } + + interface CopyIntoNewProgramAction extends CopyIntoProgramAction { + String NAME = String.format(NAME_PAT, "New"); + String DESCRIPTION = String.format(DESC_PAT, "a new"); + String HELP_ANCHOR = "copy_into_new"; + + static ActionBuilder builder(Plugin owner) { + String ownerName = owner.getName(); + return new ActionBuilder(NAME, ownerName) + .description(DESCRIPTION) + .menuGroup(GROUP) + .menuPath(DebuggerPluginPackage.NAME, NAME) .helpLocation(new HelpLocation(ownerName, HELP_ANCHOR)); } } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerReadsMemoryTrait.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerReadsMemoryTrait.java index f79d67a87a..d7857f63da 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerReadsMemoryTrait.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerReadsMemoryTrait.java @@ -27,7 +27,7 @@ import docking.menu.MultiStateDockingAction; import docking.widgets.EventTrigger; import ghidra.app.plugin.core.debug.DebuggerCoordinates; import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractCaptureSelectedMemoryAction; +import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractReadSelectedMemoryAction; import ghidra.app.plugin.core.debug.gui.action.AutoReadMemorySpec.AutoReadMemorySpecConfigFieldCodec; import ghidra.app.plugin.core.debug.utils.BackgroundUtils; import ghidra.app.services.TraceRecorder; @@ -49,10 +49,10 @@ public abstract class DebuggerReadsMemoryTrait { protected static final AutoConfigState.ClassHandler CONFIG_STATE_HANDLER = AutoConfigState.wireHandler(DebuggerReadsMemoryTrait.class, MethodHandles.lookup()); - protected class CaptureSelectedMemoryAction extends AbstractCaptureSelectedMemoryAction { + protected class ReadSelectedMemoryAction extends AbstractReadSelectedMemoryAction { public static final String GROUP = DebuggerResources.GROUP_GENERAL; - public CaptureSelectedMemoryAction() { + public ReadSelectedMemoryAction() { super(plugin); setToolBarData(new ToolBarData(ICON, GROUP)); setEnabled(false); @@ -89,14 +89,14 @@ public abstract class DebuggerReadsMemoryTrait { } } - protected class ForCaptureTraceListener extends TraceDomainObjectListener { - public ForCaptureTraceListener() { + protected class ForReadsTraceListener extends TraceDomainObjectListener { + public ForReadsTraceListener() { listenFor(TraceSnapshotChangeType.ADDED, this::snapshotAdded); listenFor(TraceMemoryStateChangeType.CHANGED, this::memStateChanged); } private void snapshotAdded(TraceSnapshot snapshot) { - actionCaptureSelected.updateEnabled(null); + actionReadSelected.updateEnabled(null); } private void memStateChanged(TraceAddressSnapRange range, TraceMemoryState oldIsNull, @@ -120,7 +120,7 @@ public abstract class DebuggerReadsMemoryTrait { @Override public void processMemoryAccessibilityChanged(TraceRecorder recorder) { Swing.runIfSwingOrRunLater(() -> { - actionCaptureSelected.updateEnabled(null); + actionReadSelected.updateEnabled(null); }); } } @@ -137,7 +137,7 @@ public abstract class DebuggerReadsMemoryTrait { } protected MultiStateDockingAction actionAutoRead; - protected CaptureSelectedMemoryAction actionCaptureSelected; + protected ReadSelectedMemoryAction actionReadSelected; private final AutoReadMemorySpec defaultAutoSpec = AutoReadMemorySpec.fromConfigName(VisibleROOnceAutoReadMemorySpec.CONFIG_NAME); @@ -149,8 +149,8 @@ public abstract class DebuggerReadsMemoryTrait { protected final Plugin plugin; protected final ComponentProvider provider; - protected final ForCaptureTraceListener traceListener = - new ForCaptureTraceListener(); + protected final ForReadsTraceListener traceListener = + new ForReadsTraceListener(); protected final ForAccessRecorderListener recorderListener = new ForAccessRecorderListener(); protected final ForVisibilityListener displayListener = new ForVisibilityListener(); @@ -257,10 +257,10 @@ public abstract class DebuggerReadsMemoryTrait { } } - public DockingAction installCaptureSelectedAction() { - actionCaptureSelected = new CaptureSelectedMemoryAction(); - provider.addLocalAction(actionCaptureSelected); - return actionCaptureSelected; + public DockingAction installReadSelectedAction() { + actionReadSelected = new ReadSelectedMemoryAction(); + provider.addLocalAction(actionReadSelected); + return actionReadSelected; } public AddressSetDisplayListener getDisplayListener() { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPlugin.java new file mode 100644 index 0000000000..97053afc18 --- /dev/null +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPlugin.java @@ -0,0 +1,153 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.app.plugin.core.debug.gui.copying; + +import docking.ActionContext; +import docking.action.DockingAction; +import ghidra.app.context.ProgramLocationActionContext; +import ghidra.app.plugin.PluginCategoryNames; +import ghidra.app.plugin.core.debug.AbstractDebuggerPlugin; +import ghidra.app.plugin.core.debug.DebuggerPluginPackage; +import ghidra.app.plugin.core.debug.gui.DebuggerResources.*; +import ghidra.app.plugin.core.exporter.ExporterDialog; +import ghidra.app.services.*; +import ghidra.framework.plugintool.PluginInfo; +import ghidra.framework.plugintool.PluginTool; +import ghidra.framework.plugintool.annotation.AutoServiceConsumed; +import ghidra.framework.plugintool.util.PluginStatus; +import ghidra.program.util.ProgramSelection; +import ghidra.trace.model.program.TraceProgramView; +import ghidra.trace.model.program.TraceVariableSnapProgramView; + +@PluginInfo( + shortDescription = "Copy and export trace data", + description = "Provides tool actions for moving data from traces to various destinations.", + category = PluginCategoryNames.DEBUGGER, + packageName = DebuggerPluginPackage.NAME, + status = PluginStatus.RELEASED, + eventsConsumed = {}, + eventsProduced = {}, + servicesRequired = { + DebuggerStaticMappingService.class, + ProgramManager.class, + }, + servicesProvided = {}) +public class DebuggerCopyActionsPlugin extends AbstractDebuggerPlugin { + + protected static ProgramSelection getSelectionFromContext(ActionContext context) { + if (!(context instanceof ProgramLocationActionContext)) { + return null; + } + ProgramLocationActionContext ctx = (ProgramLocationActionContext) context; + return ctx.hasSelection() ? ctx.getSelection() : null; + } + + protected DebuggerCopyIntoProgramDialog copyDialog = new DebuggerCopyIntoProgramDialog(); + + protected DockingAction actionExportView; + protected DockingAction actionCopyIntoCurrentProgram; + protected DockingAction actionCopyIntoNewProgram; + + @AutoServiceConsumed + private ProgramManager programManager; + @AutoServiceConsumed + private DebuggerStaticMappingService mappingService; + @AutoServiceConsumed + private DebuggerModelService modelService; + + public DebuggerCopyActionsPlugin(PluginTool tool) { + super(tool); + + createActions(); + } + + protected void createActions() { + actionExportView = ExportTraceViewAction.builder(this) + .enabled(false) + .withContext(ProgramLocationActionContext.class) + .enabledWhen(this::checkTrace) + .onAction(this::activatedExportView) + .buildAndInstall(tool); + + // Using programManager here depends on it calling tool.updateContext() + actionCopyIntoCurrentProgram = CopyIntoCurrentProgramAction.builder(this) + .enabled(false) + .withContext(ProgramLocationActionContext.class) + .enabledWhen( + ctx -> checkTraceSelection(ctx) && programManager.getCurrentProgram() != null) + .onAction(this::activatedCopyIntoCurrentProgram) + .buildAndInstall(tool); + + actionCopyIntoNewProgram = CopyIntoNewProgramAction.builder(this) + .enabled(false) + .withContext(ProgramLocationActionContext.class) + .enabledWhen(this::checkTraceSelection) + .onAction(this::activatedCopyIntoNewProgram) + .buildAndInstall(tool); + } + + protected boolean checkTrace(ProgramLocationActionContext context) { + return context.getProgram() instanceof TraceProgramView; + } + + protected boolean checkTraceSelection(ProgramLocationActionContext context) { + return checkTrace(context) && context.hasSelection(); + } + + protected void activatedExportView(ProgramLocationActionContext context) { + if (!checkTrace(context)) { + return; + } + TraceProgramView view = (TraceProgramView) context.getProgram(); + // Avoid odd race conditions by fixing the snap + TraceProgramView fixed = view instanceof TraceVariableSnapProgramView + ? view.getTrace().getFixedProgramView(view.getSnap()) + : view; + + ExporterDialog dialog = + new ExporterDialog(tool, fixed.getDomainFile(), fixed, + getSelectionFromContext(context)); + tool.showDialog(dialog); + } + + protected void activatedCopyIntoCurrentProgram(ProgramLocationActionContext context) { + if (!checkTraceSelection(context)) { + return; + } + copyDialog.setSource((TraceProgramView) context.getProgram(), context.getSelection()); + copyDialog.setProgramManager(programManager); + copyDialog.setStaticMappingService(mappingService); + copyDialog.setModelService(modelService); + copyDialog.setDestination(programManager.getCurrentProgram()); + copyDialog.reset(); + copyDialog.setStatusText(""); + tool.showDialog(copyDialog); + } + + protected void activatedCopyIntoNewProgram(ProgramLocationActionContext context) { + if (!checkTraceSelection(context)) { + return; + } + copyDialog.setSource((TraceProgramView) context.getProgram(), context.getSelection()); + copyDialog.setProgramManager(programManager); + copyDialog.setStaticMappingService(mappingService); + copyDialog.setModelService(modelService); + copyDialog.setDestination(copyDialog.NEW_PROGRAM); + copyDialog.reset(); + copyDialog.setStatusText(""); + tool.showDialog(copyDialog); + } +} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyIntoProgramDialog.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyIntoProgramDialog.java new file mode 100644 index 0000000000..7313ace853 --- /dev/null +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyIntoProgramDialog.java @@ -0,0 +1,844 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.app.plugin.core.debug.gui.copying; + +import java.awt.*; +import java.io.IOException; +import java.util.*; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.*; +import java.util.stream.Collectors; + +import javax.swing.*; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; + +import com.google.common.collect.Range; + +import docking.DialogComponentProvider; +import docking.widgets.table.*; +import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn; +import ghidra.app.plugin.core.debug.DebuggerCoordinates; +import ghidra.app.plugin.core.debug.gui.DebuggerResources; +import ghidra.app.plugin.core.debug.gui.copying.DebuggerCopyPlan.Copier; +import ghidra.app.services.*; +import ghidra.app.services.DebuggerStaticMappingService.MappedAddressRange; +import ghidra.program.database.ProgramDB; +import ghidra.program.model.address.*; +import ghidra.program.model.listing.Program; +import ghidra.program.model.mem.Memory; +import ghidra.program.model.mem.MemoryBlock; +import ghidra.trace.model.memory.TraceMemoryManager; +import ghidra.trace.model.memory.TraceMemoryRegion; +import ghidra.trace.model.modules.*; +import ghidra.trace.model.program.TraceProgramView; +import ghidra.util.*; +import ghidra.util.database.UndoableTransaction; +import ghidra.util.exception.CancelledException; +import ghidra.util.table.GhidraTableFilterPanel; +import ghidra.util.task.*; + +public class DebuggerCopyIntoProgramDialog extends DialogComponentProvider { + static final int GAP = 5; + static final int BUTTON_SIZE = 32; + + protected static class RangeEntry { + private final String regionName; + private final String moduleNames; + private final String sectionNames; + private final AddressRange srcRange; + private String blockName; + private final boolean create; + private final boolean overlay; + private final AddressRange dstRange; + + protected RangeEntry(String regionName, String moduleNames, String sectionNames, + AddressRange srcRange, String blockName, boolean create, boolean overlay, + AddressRange dstRange) { + this.regionName = regionName; + this.moduleNames = moduleNames; + this.sectionNames = sectionNames; + this.srcRange = srcRange; + this.blockName = blockName; + this.create = create; + this.overlay = overlay; + this.dstRange = dstRange; + } + + public String getRegionName() { + return regionName; + } + + public String getModuleNames() { + return moduleNames; + } + + public String getSectionNames() { + return sectionNames; + } + + public AddressRange getSrcRange() { + return srcRange; + } + + public Address getSrcMinAddress() { + return srcRange.getMinAddress(); + } + + public Address getSrcMaxAddress() { + return srcRange.getMaxAddress(); + } + + public AddressRange getDstRange() { + return dstRange; + } + + public String getBlockName() { + return create ? blockName : (blockName + " *"); + } + + public void setBlockName(String blockName) { + if (!create) { + throw new IllegalStateException("Cannot modify name of existing block"); + } + this.blockName = blockName; + } + + public boolean isCreate() { + return create; + } + + public boolean isOverlay() { + return overlay; + } + + public Address getDstMinAddress() { + return dstRange.getMinAddress(); + } + + public Address getDstMaxAddress() { + return dstRange.getMaxAddress(); + } + } + + protected enum RangeTableColumns + implements EnumeratedTableColumn { + REMOVE("Remove", String.class, e -> "Remove Range", (e, v) -> nop(), null), + REGION("Region", String.class, RangeEntry::getRegionName), + MODULES("Modules", String.class, RangeEntry::getModuleNames), + SECTIONS("Sections", String.class, RangeEntry::getSectionNames), + SRC_MIN("SrcMin", Address.class, RangeEntry::getSrcMinAddress), + SRC_MAX("SrcMax", Address.class, RangeEntry::getSrcMaxAddress), + BLOCK("Block", String.class, RangeEntry::getBlockName, RangeEntry::setBlockName, // + RangeEntry::isCreate), + OVERLAY("Overlay", Boolean.class, RangeEntry::isOverlay), + DST_MIN("DstMin", Address.class, RangeEntry::getDstMinAddress), + DST_MAX("DstMax", Address.class, RangeEntry::getDstMaxAddress); + + private static void nop() { + } + + private final String header; + private final Class cls; + private final Function getter; + private final BiConsumer setter; + private final Predicate editable; + + @SuppressWarnings("unchecked") + RangeTableColumns(String header, Class cls, Function getter, + BiConsumer setter, Predicate editable) { + this.header = header; + this.cls = cls; + this.getter = getter; + this.setter = (BiConsumer) setter; + this.editable = editable; + } + + RangeTableColumns(String header, Class cls, Function getter) { + this(header, cls, getter, null, null); + } + + @Override + public String getHeader() { + return header; + } + + @Override + public Class getValueClass() { + return cls; + } + + @Override + public Object getValueOf(RangeEntry row) { + return getter.apply(row); + } + + @Override + public boolean isEditable(RangeEntry row) { + return setter != null && (editable == null || editable.test(row)); + } + + @Override + public void setValueOf(RangeEntry row, Object value) { + setter.accept(row, value); + } + } + + protected static class RangeTableModel + extends DefaultEnumeratedColumnTableModel { + public RangeTableModel() { + super("Ranges", RangeTableColumns.class); + } + + @Override + public List defaultSortOrder() { + return List.of(RangeTableColumns.SRC_MIN); + } + } + + protected interface CopyDestination { + default Program getExistingProgram() { + return null; + } + + default boolean isExisting() { + return getExistingProgram() != null; + } + + Program getOrCreateProgram(TraceProgramView source, Object consumer) throws IOException; + + default void saveIfApplicable(Program program) { + } + } + + protected static final CopyDestination TEMP_PROGRAM = new CopyDestination() { + @Override + public String toString() { + return ""; + } + + @Override + public Program getOrCreateProgram(TraceProgramView source, Object consumer) + throws IOException { + return new ProgramDB(source.getName(), source.getLanguage(), source.getCompilerSpec(), + consumer); + } + }; + + protected final CopyDestination NEW_PROGRAM = new CopyDestination() { + @Override + public String toString() { + return ""; + } + + @Override + public Program getOrCreateProgram(TraceProgramView source, Object consumer) + throws IOException { + return new ProgramDB(source.getName(), source.getLanguage(), source.getCompilerSpec(), + consumer); + } + + @Override + public void saveIfApplicable(Program program) { + programManager.saveProgramAs(program); + } + }; + + protected static class OpenProgramDestination implements CopyDestination { + private final Program program; + + public OpenProgramDestination(Program program) { + this.program = program; + } + + @Override + public String toString() { + return program.getName(); + } + + @Override + public Program getExistingProgram() { + return program; + } + + @Override + public Program getOrCreateProgram(TraceProgramView source, Object consumer) { + return program; + } + } + + protected DebuggerModelService modelService; + protected ProgramManager programManager; + protected DebuggerStaticMappingService staticMappingService; + + protected TraceProgramView source; + protected AddressSetView set; + + protected CompletableFuture lastTask; + protected CompletableFuture captureTask; + + protected final DefaultComboBoxModel comboDestinationModel = + new DefaultComboBoxModel<>(); + protected JComboBox comboDestination; + protected final Map programDestinations = new HashMap<>(); + + // TODO: Save these options to tool state? + protected JCheckBox cbCapture; + protected JCheckBox cbRelocate; + protected JCheckBox cbUseOverlays; + protected DebuggerCopyPlan plan = new DebuggerCopyPlan(); + + protected final RangeTableModel tableModel = new RangeTableModel(); + protected GTable table; + protected GhidraTableFilterPanel filterPanel; + + protected JButton resetButton; + + public DebuggerCopyIntoProgramDialog() { + super("Copy Into Program", true, true, true, true); + + populateComponents(); + } + + protected void populateComponents() { + plan.selectAll(); + JPanel panel = new JPanel(new BorderLayout()); + + { + JPanel opts = new JPanel(); + opts.setLayout(new BoxLayout(opts, BoxLayout.Y_AXIS)); + + { + Box progBox = Box.createHorizontalBox(); + progBox.setBorder(BorderFactory.createEmptyBorder(GAP, GAP, GAP, GAP)); + progBox.add(new JLabel("Destination:")); + comboDestination = new JComboBox<>(comboDestinationModel); + comboDestination.setBorder(BorderFactory.createEmptyBorder(0, GAP, 0, 0)); + comboDestination.addActionListener(e -> { + if (!isVisible()) { + return; + } + syncCbRelocateEnabled(getDestination()); + reset(); + }); + progBox.add(comboDestination); + opts.add(progBox); + } + + { + // Avoid Swing's automatic indentation + JPanel inner = new JPanel(new BorderLayout()); + inner.setBorder(BorderFactory.createEmptyBorder(0, GAP, GAP, GAP)); + cbCapture = + new JCheckBox("Read live target's memory"); + cbCapture.addActionListener(e -> { + if (!isVisible()) { + return; + } + reset(); + }); + inner.add(cbCapture); + opts.add(inner); + } + + { + // Avoid Swing's automatic indentation + JPanel inner = new JPanel(new BorderLayout()); + inner.setBorder(BorderFactory.createEmptyBorder(0, GAP, GAP, GAP)); + cbRelocate = + new JCheckBox("Relocate via Mappings. WARNING: No fixups"); + cbRelocate.addActionListener(e -> { + if (!isVisible()) { + return; + } + reset(); + }); + inner.add(cbRelocate); + opts.add(inner); + } + + { + // No swing indentation + JPanel inner = new JPanel(new BorderLayout()); + inner.setBorder(BorderFactory.createEmptyBorder(0, GAP, GAP, GAP)); + cbUseOverlays = new JCheckBox("Use overlays where blocks already exist"); + cbUseOverlays.addActionListener(e -> { + if (!isVisible()) { + return; + } + reset(); + }); + inner.add(cbUseOverlays); + opts.add(inner); + } + + { + JPanel panelInclude = new JPanel(new GridLayout(0, 2, GAP, GAP)); + panelInclude.setBorder(BorderFactory.createTitledBorder("Include:")); + JButton buttonSelectNone = new JButton("Select None"); + buttonSelectNone.addActionListener(e -> plan.selectNone()); + panelInclude.add(buttonSelectNone); + JButton buttonSelectAll = new JButton("Select All"); + buttonSelectAll.addActionListener(e -> plan.selectAll()); + panelInclude.add(buttonSelectAll); + for (Copier copier : plan.getAllCopiers()) { + panelInclude.add(plan.getCheckBox(copier)); + } + opts.add(panelInclude); + } + panel.add(opts, BorderLayout.NORTH); + } + + { + JPanel tablePanel = new JPanel(new BorderLayout()); + table = new GTable(tableModel); + table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + tablePanel.add(new JScrollPane(table)); + filterPanel = new GhidraTableFilterPanel<>(table, tableModel); + tablePanel.add(filterPanel, BorderLayout.SOUTH); + panel.add(tablePanel, BorderLayout.CENTER); + } + + panel.setMinimumSize(new Dimension(600, 600)); + addWorkPanel(panel); + + addOKButton(); + okButton.setText("Copy"); + addCancelButton(); + addResetButton(); + + TableColumnModel columnModel = table.getColumnModel(); + + TableColumn removeCol = columnModel.getColumn(RangeTableColumns.REMOVE.ordinal()); + CellEditorUtils.installButton(table, filterPanel, removeCol, DebuggerResources.ICON_DELETE, + BUTTON_SIZE, this::removeEntry); + } + + protected void addResetButton() { + resetButton = new JButton("Reset"); + resetButton.setMnemonic('R'); + resetButton.setName("Reset"); + resetButton.addActionListener(e -> resetCallback()); + addButton(resetButton); + } + + @Override + protected void cancelCallback() { + synchronized (this) { + if (captureTask != null) { + captureTask.cancel(false); + } + } + super.cancelCallback(); + } + + @Override + protected void okCallback() { + super.okCallback(); + + lastTask = new CompletableFuture<>(); + Task task = new Task("Copy Into Program", true, true, false) { + @Override + public void run(TaskMonitor monitor) throws CancelledException { + try { + executePlan(monitor); + Swing.runLater(() -> { + setStatusText(""); + close(); + }); + } + catch (Exception e) { + Msg.error(this, "Error copying into program", e); + setStatusText("Error: " + e.getMessage()); + } + } + }; + task.addTaskListener(new TaskListener() { + @Override + public void taskCancelled(Task task) { + lastTask.cancel(false); + } + + @Override + public void taskCompleted(Task task) { + lastTask.complete(null); + } + }); + executeProgressTask(task, 500); + } + + protected void resetCallback() { + reset(); + } + + protected void removeEntry(RangeEntry entry) { + tableModel.delete(entry); + } + + protected TraceRecorder getRecorderIfReadsPresent() { + if (modelService == null) { + return null; + } + TraceRecorder recorder = modelService.getRecorder(source.getTrace()); + if (recorder == null) { + return null; + } + if (!DebuggerCoordinates.view(source).withRecorder(recorder).isAliveAndReadsPresent()) { + return null; + } + return recorder; + } + + protected void checkCbCaptureEnabled() { + boolean en = getRecorderIfReadsPresent() != null; + cbCapture.setEnabled(en); + cbCapture.setSelected(en); + } + + public void setModelService(DebuggerModelService modelService) { + this.modelService = modelService; + checkCbCaptureEnabled(); + } + + public void setSource(TraceProgramView source, AddressSetView set) { + this.source = source; + this.set = set; + checkCbCaptureEnabled(); + } + + public void setProgramManager(ProgramManager programManager) { + this.programManager = programManager; + setSelectablePrograms(programManager.getAllOpenPrograms()); + } + + protected void setSelectablePrograms(Program[] programs) { + setSelectablePrograms(Arrays.asList(programs)); + } + + protected void setSelectablePrograms(Collection programs) { + programDestinations.clear(); + comboDestinationModel.removeAllElements(); + comboDestinationModel.addElement(NEW_PROGRAM); + comboDestinationModel.addElement(TEMP_PROGRAM); + for (Program program : new LinkedHashSet<>(programs)) { + OpenProgramDestination destination = new OpenProgramDestination(program); + programDestinations.put(program, destination); + comboDestinationModel.addElement(destination); + } + } + + public void setDestination(Program program) { + setDestination(programDestinations.get(program)); + } + + protected void syncCbRelocateEnabled(CopyDestination dest) { + cbRelocate.setEnabled(dest.getExistingProgram() != null); + } + + public void setDestination(CopyDestination dest) { + Objects.requireNonNull(dest); + syncCbRelocateEnabled(dest); + comboDestinationModel.setSelectedItem(dest); + } + + public CopyDestination getDestination() { + return (CopyDestination) comboDestinationModel.getSelectedItem(); + } + + public void setCapture(boolean capture) { + if (capture && getRecorderIfReadsPresent() == null) { + throw new IllegalStateException( + "Cannot enable capture unless live and reading the present"); + } + this.cbCapture.setSelected(capture); + } + + public boolean isCapture() { + return (cbCapture.isSelected() && getRecorderIfReadsPresent() != null); + } + + public void setRelocate(boolean relocate) { + if (relocate && !getDestination().isExisting()) { + throw new IllegalStateException("Cannot relocate when creating a new program"); + } + this.cbRelocate.setSelected(relocate); + } + + public boolean isRelocate() { + return cbRelocate.isSelected() && staticMappingService != null && + getDestination().isExisting(); + } + + public void setUseOverlays(boolean useOverlays) { + if (useOverlays && !getDestination().isExisting()) { + // Technically, you can, but why would you? + throw new IllegalStateException("Cannot use overlays when creating a new program"); + } + this.cbUseOverlays.setSelected(useOverlays); + } + + public boolean isUseOverlays() { + return cbUseOverlays.isSelected() && getDestination().isExisting(); + } + + public void setStaticMappingService(DebuggerStaticMappingService staticMappingService) { + this.staticMappingService = staticMappingService; + cbRelocate.setEnabled(staticMappingService != null); + } + + /** + * Re-populate the table based on destination and relocation settings + */ + public void reset() { + Program dest = getDestination().getExistingProgram(); + plan.syncCopiersEnabled(source, dest); + if (isRelocate()) { + resetWithRelocation(isUseOverlays(), dest); + } + else { + resetWithoutRelocation(isUseOverlays(), dest); + } + } + + protected String createName(String desired, Set taken) { + if (taken.add(desired)) { + return desired; + } + String candidate = desired; + for (int i = 2;; i++) { + candidate = desired + "_" + i; + if (taken.add(candidate)) { + return candidate; + } + } + } + + protected String computeRegionString(AddressRange rng) { + TraceMemoryManager mm = source.getTrace().getMemoryManager(); + Collection regions = + mm.getRegionsIntersecting(Range.singleton(source.getSnap()), rng); + return regions.isEmpty() ? "UNKNOWN" : regions.iterator().next().getName(); + } + + protected String computeModulesString(AddressRange rng) { + TraceModuleManager mm = source.getTrace().getModuleManager(); + Collection modules = + mm.getModulesIntersecting(Range.singleton(source.getSnap()), rng); + return modules.stream().map(m -> m.getName()).collect(Collectors.joining(",")); + } + + protected String computeSectionsString(AddressRange rng) { + TraceModuleManager mm = source.getTrace().getModuleManager(); + Collection sections = + mm.getSectionsIntersecting(Range.singleton(source.getSnap()), rng); + return sections.stream().map(s -> s.getName()).collect(Collectors.joining(",")); + } + + protected void createEntry(Collection result, AddressRange srcRange, + AddressRange dstRange, boolean overlay, Set taken, MemoryBlock dstBlock) { + String srcName = computeRegionString(srcRange); + String dstName = dstBlock != null ? dstBlock.getName() : createName(srcName, taken); + String srcModules = computeModulesString(srcRange); + String srcSections = computeSectionsString(srcRange); + result.add(new RangeEntry(srcName, srcModules, srcSections, srcRange, dstName, + dstBlock == null, overlay, dstRange)); + } + + protected void createEntries(Collection result, boolean useOverlays, + MappedAddressRange mappedRng, AddressRange srcRange, AddressRange dstRange, + Set taken, Program dest) { + if (dest == null) { + createEntry(result, srcRange, dstRange, false, taken, null); + return; + } + + Memory memory = dest.getMemory(); + AddressSetView hits = + memory.intersectRange(dstRange.getMinAddress(), dstRange.getMaxAddress()); + if (!hits.isEmpty() && useOverlays) { + createEntry(result, srcRange, dstRange, true, taken, null); + return; + } + + AddressSetView misses = new AddressSet(dstRange).subtract(hits); + for (AddressRange miss : misses) { + createEntry(result, mappedRng.mapDestinationToSource(miss), miss, false, taken, null); + } + for (AddressRange hit : hits) { + Address next = hit.getMinAddress(); + while (next != null && hit.contains(next)) { + MemoryBlock block = memory.getBlock(next); + AddressRange dr = hit.intersectRange(block.getStart(), block.getEnd()); + createEntry(result, mappedRng.mapDestinationToSource(dr), dr, false, taken, block); + next = block.getEnd().next(); + } + } + } + + protected void collectBlockNames(Collection result, Program program) { + if (program == null) { + return; + } + for (MemoryBlock b : program.getMemory().getBlocks()) { + result.add(b.getName()); + } + } + + protected List breakRangeByRegions(AddressRange srcRange) { + AddressSet remains = new AddressSet(srcRange); + List result = new ArrayList<>(); + for (TraceMemoryRegion region : source.getTrace() + .getMemoryManager() + .getRegionsIntersecting(Range.singleton(source.getSnap()), srcRange)) { + AddressRange range = region.getRange().intersect(srcRange); + result.add(range); + remains.delete(range); + } + remains.iterator().forEachRemaining(result::add); + return result; + } + + protected void resetWithRelocation(boolean useOverlays, Program dest) { + Objects.requireNonNull(dest); + tableModel.clear(); + List result = new ArrayList<>(); + Set taken = new HashSet<>(); + collectBlockNames(taken, dest); + Collection mappedSet = staticMappingService + .getOpenMappedViews(source.getTrace(), set, source.getSnap()) + .get(dest); + if (mappedSet == null) { + return; + } + for (MappedAddressRange mappedRng : mappedSet) { + for (AddressRange src : breakRangeByRegions(mappedRng.getSourceAddressRange())) { + AddressRange dst = mappedRng.mapSourceToDestination(src); + createEntries(result, useOverlays, mappedRng, src, dst, taken, dest); + } + } + tableModel.addAll(result); + } + + protected MappedAddressRange identityMapped(AddressRange srng, Program dest) { + if (dest == null) { // New program + return new MappedAddressRange(srng, srng); + } + AddressSpace srcSpace = srng.getAddressSpace(); + AddressSpace dstSpace = dest.getAddressFactory().getAddressSpace(srcSpace.getName()); + if (dstSpace == null) { + return null; + } + long minOff = MathUtilities.unsignedMax(srng.getMinAddress().getOffset(), + dstSpace.getMinAddress().getOffset()); + long maxOff = MathUtilities.unsignedMin(srng.getMaxAddress().getOffset(), + dstSpace.getMaxAddress().getOffset()); + if (Long.compareUnsigned(minOff, maxOff) > 0) { + return null; + } + return new MappedAddressRange( + new AddressRangeImpl(srcSpace.getAddress(minOff), srcSpace.getAddress(maxOff)), + new AddressRangeImpl(dstSpace.getAddress(minOff), dstSpace.getAddress(maxOff))); + } + + protected void resetWithoutRelocation(boolean useOverlays, Program dest) { + tableModel.clear(); + List result = new ArrayList<>(); + Set taken = new HashSet<>(); + collectBlockNames(taken, dest); + for (AddressRange rng : set) { + for (AddressRange src : breakRangeByRegions(rng)) { + MappedAddressRange id = identityMapped(src, dest); + if (id == null) { + continue; + } + createEntries(result, useOverlays, id, id.getSourceAddressRange(), + id.getDestinationAddressRange(), taken, dest); + } + } + tableModel.addAll(result); + } + + protected MemoryBlock executeEntryBlock(RangeEntry entry, Program dest, TaskMonitor monitor) + throws Exception { + if (entry.isCreate()) { + return dest.getMemory() + .createInitializedBlock(entry.getBlockName(), entry.getDstMinAddress(), + entry.getDstRange().getLength(), (byte) 0, monitor, entry.isOverlay()); + } + MemoryBlock block = dest.getMemory().getBlock(entry.getDstMinAddress()); + if (plan.isRequiresInitializedMemory(source, dest) && !block.isInitialized()) { + return dest.getMemory().convertToInitialized(block, (byte) 0); + } + return block; + } + + protected void executeEntry(RangeEntry entry, Program dest, TraceRecorder recorder, + TaskMonitor monitor) + throws Exception { + MemoryBlock block = executeEntryBlock(entry, dest, monitor); + Address dstMin = entry.getDstRange().getMinAddress(); + if (block.isOverlay()) { + dstMin = block.getStart().getAddressSpace().getAddress(dstMin.getOffset()); + } + if (recorder != null) { + executeCapture(entry.getSrcRange(), recorder, monitor); + } + plan.execute(source, entry.getSrcRange(), dest, dstMin, monitor); + } + + protected TraceRecorder getRecorderIfEnabledAndReadsPresent() { + if (!cbCapture.isSelected()) { + return null; + } + return getRecorderIfReadsPresent(); + } + + protected void executeCapture(AddressRange range, TraceRecorder recorder, TaskMonitor monitor) + throws Exception { + synchronized (this) { + monitor.checkCanceled(); + this.captureTask = recorder.captureProcessMemory(new AddressSet(range), monitor, false); + } + try { + captureTask.get(); // Not a fan, but whatever. + } + finally { + captureTask = null; + } + } + + protected void executePlan(TaskMonitor monitor) throws Exception { + Program dest = getDestination().getOrCreateProgram(source, this); + boolean doRelease = !Arrays.asList(programManager.getAllOpenPrograms()).contains(dest); + TraceRecorder recorder = getRecorderIfEnabledAndReadsPresent(); + try (UndoableTransaction tid = UndoableTransaction.start(dest, "Copy From Trace", true)) { + monitor.initialize(tableModel.getRowCount()); + for (RangeEntry entry : tableModel.getModelData()) { + monitor.setMessage("Copying into " + entry.getDstRange()); + executeEntry(entry, dest, recorder, monitor); + monitor.incrementProgress(1); + } + programManager.openProgram(dest); + } + finally { + if (doRelease) { + dest.release(this); + } + } + getDestination().saveIfApplicable(dest); + } +} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java new file mode 100644 index 0000000000..4c30b0aa37 --- /dev/null +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlan.java @@ -0,0 +1,449 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.app.plugin.core.debug.gui.copying; + +import java.util.*; + +import javax.swing.JCheckBox; + +import com.google.common.collect.Range; + +import ghidra.app.plugin.core.debug.gui.DebuggerResources; +import ghidra.app.plugin.core.debug.service.breakpoint.LogicalBreakpointInternal.ProgramBreakpoint; +import ghidra.app.util.viewer.listingpanel.PropertyBasedBackgroundColorModel; +import ghidra.program.database.IntRangeMap; +import ghidra.program.model.address.*; +import ghidra.program.model.data.*; +import ghidra.program.model.listing.*; +import ghidra.program.model.symbol.*; +import ghidra.trace.model.breakpoint.TraceBreakpoint; +import ghidra.trace.model.memory.TraceMemoryManager; +import ghidra.trace.model.memory.TraceMemoryState; +import ghidra.trace.model.program.TraceProgramView; +import ghidra.util.exception.InvalidInputException; +import ghidra.util.task.TaskMonitor; + +public class DebuggerCopyPlan { + public interface Copier { + String getName(); + + boolean isAvailable(TraceProgramView from, Program into); + + Collection getRequires(); + + Collection getRequiredBy(); + + boolean isRequiresInitializedMemory(); + + void copy(TraceProgramView from, AddressRange fromRange, Program into, Address intoAddress, + TaskMonitor monitor) throws Exception; + } + + public enum AllCopiers implements Copier { + BYTES("Bytes", List.of()) { + @Override + public boolean isRequiresInitializedMemory() { + return true; + } + + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + // This is perhaps too heavy handed.... + into.getListing() + .clearCodeUnits(intoAddress, intoAddress.add(fromRange.getLength() - 1), + false); + byte[] buf = new byte[4096]; + AddressRangeChunker chunker = new AddressRangeChunker(fromRange, buf.length); + for (AddressRange chunk : chunker) { + monitor.checkCanceled(); + Address addr = chunk.getMinAddress(); + int len = (int) chunk.getLength(); + from.getMemory().getBytes(addr, buf, 0, len); + long off = addr.subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + into.getMemory().setBytes(dest, buf, 0, len); + } + } + }, + STATE("State (as colors)", List.of()) { + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + IntRangeMap map = + into.getIntRangeMap(PropertyBasedBackgroundColorModel.COLOR_PROPERTY_NAME); + if (map == null) { + map = into.createIntRangeMap( + PropertyBasedBackgroundColorModel.COLOR_PROPERTY_NAME); + } + AddressSet rngAsSet = new AddressSet(fromRange); + TraceMemoryManager mm = from.getTrace().getMemoryManager(); + AddressSetView knownSet = mm.getAddressesWithState(from.getSnap(), rngAsSet, + s -> s == TraceMemoryState.KNOWN); + AddressSetView errorSet = mm.getAddressesWithState(from.getSnap(), rngAsSet, + s -> s == TraceMemoryState.ERROR); + AddressSetView staleSet = rngAsSet.subtract(knownSet).subtract(errorSet); + setShifted(map, fromRange.getMinAddress(), intoAddress, errorSet, + DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR.getRGB()); + setShifted(map, fromRange.getMinAddress(), intoAddress, staleSet, + DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE.getRGB()); + } + + public void setShifted(IntRangeMap map, Address src, Address dst, AddressSetView set, + int value) { + for (AddressRange rng : set) { + long offMin = rng.getMinAddress().subtract(src); + long offMax = rng.getMaxAddress().subtract(src); + Address dMin = dst.add(offMin); + Address dMax = dst.add(offMax); + map.setValue(dMin, dMax, value); + } + } + }, + INSTRUCTIONS("Instructions", List.of(BYTES)) { + @Override + protected boolean checkAvailable(TraceProgramView from, Program into) { + return into == null || from.getLanguage() == into.getLanguage(); + } + + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + Listing intoListing = into.getListing(); + for (Instruction ins : from.getListing() + .getInstructions(new AddressSet(fromRange), true)) { + monitor.checkCanceled(); + if (!ins.getPrototype().getLanguage().equals(into.getLanguage())) { + // Filter out "guest" instructions + continue; + } + long off = ins.getMinAddress().subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + intoListing.createInstruction(dest, ins.getPrototype(), ins, ins); + } + } + }, + DATA("Data", List.of()) { + @Override + protected boolean checkAvailable(TraceProgramView from, Program into) { + return into == null || sameDataOrganization(from, into); + } + + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) + throws Exception { + Listing intoListing = into.getListing(); + for (Data data : from.getListing() + .getDefinedData(new AddressSet(fromRange), true)) { + monitor.checkCanceled(); + long off = data.getMinAddress().subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + DataType dt = data.getDataType(); + if (!(dt instanceof DynamicDataType)) { + intoListing.createData(dest, dt, data.getLength()); + } + } + } + }, + DYNAMIC_DATA("Dynamic Data", List.of(BYTES)) { + @Override + protected boolean checkAvailable(TraceProgramView from, Program into) { + return into == null || sameDataOrganization(from, into); + } + + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + Listing intoListing = into.getListing(); + for (Data data : from.getListing() + .getDefinedData(new AddressSet(fromRange), true)) { + monitor.checkCanceled(); + long off = data.getMinAddress().subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + DataType dt = data.getDataType(); + if (dt instanceof DynamicDataType) { + intoListing.createData(dest, dt, data.getLength()); + } + } + } + }, + LABELS("Labels", List.of()) { + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + SymbolTable intoTable = into.getSymbolTable(); + for (Symbol label : from.getSymbolTable() + .getSymbols(new AddressSet(fromRange), SymbolType.LABEL, true)) { + monitor.checkCanceled(); + if (label.getSource() == SourceType.DEFAULT) { + continue; + } + long off = label.getAddress().subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + Namespace destNs = + findOrCopyNamespace(label.getParentNamespace(), intoTable, into); + try { + intoTable.createLabel(dest, label.getName(), destNs, label.getSource()); + } + catch (InvalidInputException e) { + throw new AssertionError(e); + } + } + } + + private Namespace findOrCopyNamespace(Namespace ns, SymbolTable intoTable, + Program into) throws Exception { + if (ns.isGlobal()) { + return into.getGlobalNamespace(); + } + Namespace destParent = + findOrCopyNamespace(ns.getParentNamespace(), intoTable, into); + return intoTable.getOrCreateNameSpace(destParent, ns.getName(), + ns.getSymbol().getSource()); + } + }, + BREAKPOINTS("Breakpoints (as bookmarks)", List.of()) { + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + for (TraceBreakpoint bpt : from.getTrace() + .getBreakpointManager() + .getBreakpointsIntersecting(Range.singleton(from.getSnap()), fromRange)) { + monitor.checkCanceled(); + long off = bpt.getMinAddress().subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + ProgramBreakpoint pb = + new ProgramBreakpoint(into, dest, bpt.getLength(), bpt.getKinds()); + if (bpt.isEnabled()) { + pb.enable(); + } + else { + pb.disable(); + } + } + } + }, + BOOKMARKS("Bookmarks", List.of()) { + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + BookmarkManager intoBookmarks = into.getBookmarkManager(); + Iterator bit = + from.getBookmarkManager().getBookmarksIterator(fromRange.getMinAddress(), true); + while (bit.hasNext()) { + monitor.checkCanceled(); + Bookmark bm = bit.next(); + if (bm.getAddress().compareTo(fromRange.getMaxAddress()) > 0) { + break; + } + BookmarkType type = bm.getType(); + long off = bm.getAddress().subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + BookmarkType destType = intoBookmarks.getBookmarkType(type.getTypeString()); + if (destType == null) { + destType = intoBookmarks.defineType(type.getTypeString(), type.getIcon(), + type.getMarkerColor(), type.getMarkerPriority()); + } + intoBookmarks.setBookmark(dest, destType.getTypeString(), bm.getCategory(), + bm.getComment()); + } + } + }, + REFERENCES("References (memory only)", List.of()) { + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + ReferenceManager intoRefs = into.getReferenceManager(); + for (Reference ref : from.getReferenceManager() + .getReferenceIterator(fromRange.getMinAddress())) { + monitor.checkCanceled(); + if (ref.getFromAddress().compareTo(fromRange.getMaxAddress()) > 0) { + break; + } + if (ref.getSource() == SourceType.DEFAULT) { + continue; + } + // TODO: Other kinds of references? + if (!ref.isMemoryReference()) { + continue; + } + // Requiring both ends to be in copied range + if (!fromRange.contains(ref.getToAddress())) { + continue; + } + + // NB. "from" is overloaded here + long offFrom = ref.getFromAddress().subtract(fromRange.getMinAddress()); + long offTo = ref.getToAddress().subtract(fromRange.getMinAddress()); + Address destFrom = intoAddress.add(offFrom); + Address destTo = intoAddress.add(offTo); + intoRefs.addMemoryReference(destFrom, destTo, ref.getReferenceType(), + ref.getSource(), ref.getOperandIndex()); + } + } + }, + COMMENTS("Comments", List.of()) { + @Override + public void copy(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + Listing fromListing = from.getListing(); + Listing intoListing = into.getListing(); + for (Address addr : fromListing.getCommentAddressIterator(new AddressSet(fromRange), + true)) { + monitor.checkCanceled(); + long off = addr.subtract(fromRange.getMinAddress()); + Address dest = intoAddress.add(off); + // Ugly, but there's not MAX/MIN_COMMENT_TYPE + for (int i = CodeUnit.EOL_COMMENT; i <= CodeUnit.REPEATABLE_COMMENT; i++) { + String comment = fromListing.getComment(i, addr); + if (comment == null) { + continue; + } + intoListing.setComment(dest, i, comment); + } + } + } + }; + + protected boolean sameDataOrganization(Program p1, Program p2) { + DataOrganization dataOrg1 = p1.getDataTypeManager().getDataOrganization(); + DataOrganization dataOrg2 = p2.getDataTypeManager().getDataOrganization(); + return dataOrg1.equals(dataOrg2); + } + + public static final List VALUES; + static { + List asList = Arrays.asList(values()); + Collections.sort(asList, Comparator.comparing(AllCopiers::getName)); + VALUES = Collections.unmodifiableList(asList); + } + + final String name; + final Collection requires; + final Collection requiredBy = new HashSet<>(); + + private AllCopiers(String name, Collection requires) { + this.name = name; + this.requires = Collections.unmodifiableCollection(requires); + for (AllCopiers req : requires) { + req.requiredBy.add(this); + } + } + + protected boolean checkAvailable(TraceProgramView from, Program into) { + return true; + } + + @Override + public boolean isAvailable(TraceProgramView from, Program into) { + return checkAvailable(from, into) && + getRequires().stream().allMatch(c -> c.isAvailable(from, into)); + } + + @Override + public String getName() { + return name; + } + + @Override + public Collection getRequires() { + return requires; + } + + @Override + public Collection getRequiredBy() { + return requiredBy; + } + + @Override + public boolean isRequiresInitializedMemory() { + return false; + } + } + + protected final Map checkBoxes = new LinkedHashMap<>(); + + public DebuggerCopyPlan() { + for (Copier copier : getAllCopiers()) { + JCheckBox cb = new JCheckBox(copier.getName()); + Collection requires = copier.getRequires(); + Collection requiredBy = copier.getRequiredBy(); + if (!requires.isEmpty() || !requiredBy.isEmpty()) { + cb.addActionListener(e -> { + if (cb.isSelected()) { + for (Copier req : requires) { + checkBoxes.get(req).setSelected(true); + } + } + else { + for (Copier dep : requiredBy) { + checkBoxes.get(dep).setSelected(false); + } + } + }); + } + checkBoxes.put(copier, cb); + } + } + + public Collection getAllCopiers() { + return AllCopiers.VALUES; + } + + public JCheckBox getCheckBox(Copier copier) { + return checkBoxes.get(copier); + } + + public void selectAll() { + for (JCheckBox cb : checkBoxes.values()) { + cb.setSelected(true); + } + } + + public void selectNone() { + for (JCheckBox cb : checkBoxes.values()) { + cb.setSelected(false); + } + } + + public void execute(TraceProgramView from, AddressRange fromRange, Program into, + Address intoAddress, TaskMonitor monitor) throws Exception { + for (Copier copier : getAllCopiers()) { + if (!copier.isAvailable(from, into)) { + continue; + } + if (!checkBoxes.get(copier).isSelected()) { + continue; + } + copier.copy(from, fromRange, into, intoAddress, monitor); + } + } + + public void syncCopiersEnabled(TraceProgramView from, Program dest) { + for (Map.Entry ent : checkBoxes.entrySet()) { + ent.getValue().setEnabled(ent.getKey().isAvailable(from, dest)); + } + } + + public boolean isRequiresInitializedMemory(TraceProgramView from, Program dest) { + return checkBoxes.entrySet().stream().anyMatch(ent -> { + Copier copier = ent.getKey(); + return copier.isRequiresInitializedMemory() && + copier.isAvailable(from, dest) && ent.getValue().isSelected(); + }); + } +} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java index 70c600d489..d63c9adf3d 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java @@ -52,7 +52,6 @@ import ghidra.app.plugin.core.debug.gui.action.*; import ghidra.app.plugin.core.debug.gui.modules.DebuggerMissingModuleActionContext; import ghidra.app.plugin.core.debug.utils.ProgramLocationUtils; import ghidra.app.plugin.core.debug.utils.ProgramURLUtils; -import ghidra.app.plugin.core.exporter.ExporterDialog; import ghidra.app.services.*; import ghidra.app.util.viewer.format.FormatManager; import ghidra.app.util.viewer.listingpanel.ListingPanel; @@ -72,7 +71,6 @@ import ghidra.program.util.ProgramSelection; import ghidra.trace.model.Trace; import ghidra.trace.model.modules.*; import ghidra.trace.model.program.TraceProgramView; -import ghidra.trace.model.program.TraceVariableSnapProgramView; import ghidra.util.HTMLUtilities; import ghidra.util.Swing; import ghidra.util.exception.CancelledException; @@ -239,8 +237,7 @@ public class DebuggerListingProvider extends CodeViewerProvider { protected SyncToStaticListingAction actionSyncToStaticListing; protected FollowsCurrentThreadAction actionFollowsCurrentThread; protected MultiStateDockingAction actionAutoReadMemory; - protected DockingAction actionCaptureSelectedMemory; - protected DockingAction actionExportView; + protected DockingAction actionReadSelectedMemory; protected DockingAction actionOpenProgram; protected MultiStateDockingAction actionTrackLocation; @@ -608,12 +605,7 @@ public class DebuggerListingProvider extends CodeViewerProvider { actionGoTo = goToTrait.installAction(); actionTrackLocation = trackingTrait.installAction(); actionAutoReadMemory = readsMemTrait.installAutoReadAction(); - actionCaptureSelectedMemory = readsMemTrait.installCaptureSelectedAction(); - - actionExportView = ExportTraceViewAction.builder(plugin) - .enabledWhen(ctx -> current.getView() != null) - .onAction(this::activatedExportView) - .buildAndInstallLocal(this); + actionReadSelectedMemory = readsMemTrait.installReadSelectedAction(); actionOpenProgram = OpenProgramAction.builder(plugin) .withContext(DebuggerOpenProgramActionContext.class) @@ -623,20 +615,6 @@ public class DebuggerListingProvider extends CodeViewerProvider { contextChanged(); } - private void activatedExportView(ActionContext context) { - if (current.getView() == null) { - return; - } - // Avoid odd race conditions by fixing the snap - TraceProgramView fixed = current.getView() instanceof TraceVariableSnapProgramView - ? current.getTrace().getFixedProgramView(current.getSnap()) - : current.getView(); - - ExporterDialog dialog = - new ExporterDialog(tool, fixed.getDomainFile(), fixed, getSelection()); - tool.showDialog(dialog); - } - private void activatedOpenProgram(DebuggerOpenProgramActionContext context) { programManager.openProgram(context.getDomainFile(), DomainFile.DEFAULT_VERSION, ProgramManager.OPEN_CURRENT); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProvider.java index 3d8050eaf1..222edf3693 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProvider.java @@ -148,7 +148,7 @@ public class DebuggerMemoryBytesProvider extends ProgramByteViewerComponentProvi protected DockingAction actionGoTo; protected FollowsCurrentThreadAction actionFollowsCurrentThread; protected MultiStateDockingAction actionAutoReadMemory; - protected DockingAction actionCaptureSelectedMemory; + protected DockingAction actionReadSelectedMemory; protected MultiStateDockingAction actionTrackLocation; protected ForMemoryBytesGoToTrait goToTrait; @@ -257,7 +257,7 @@ public class DebuggerMemoryBytesProvider extends ProgramByteViewerComponentProvi actionGoTo = goToTrait.installAction(); actionTrackLocation = trackingTrait.installAction(); actionAutoReadMemory = readsMemTrait.installAutoReadAction(); - actionCaptureSelectedMemory = readsMemTrait.installCaptureSelectedAction(); + actionReadSelectedMemory = readsMemTrait.installReadSelectedAction(); } @Override diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java index 9d17df1b79..40d542c548 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java @@ -37,7 +37,7 @@ import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; import utilities.util.IDHashed; -interface LogicalBreakpointInternal extends LogicalBreakpoint { +public interface LogicalBreakpointInternal extends LogicalBreakpoint { public static class ProgramBreakpoint { public static Set kindsFromBookmark(Bookmark mark) { String[] parts = mark.getCategory().split(";"); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/ReadsTargetMemoryPcodeExecutorState.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/ReadsTargetMemoryPcodeExecutorState.java index 8700bbdc66..020c0f46d1 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/ReadsTargetMemoryPcodeExecutorState.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/ReadsTargetMemoryPcodeExecutorState.java @@ -15,10 +15,11 @@ */ package ghidra.app.plugin.core.debug.service.emulation; +import java.util.Collection; import java.util.Map.Entry; import ghidra.app.services.DebuggerStaticMappingService; -import ghidra.app.services.DebuggerStaticMappingService.ShiftAndAddressSetView; +import ghidra.app.services.DebuggerStaticMappingService.MappedAddressRange; import ghidra.app.services.TraceRecorder; import ghidra.framework.plugintool.PluginTool; import ghidra.program.model.address.*; @@ -78,40 +79,44 @@ public class ReadsTargetMemoryPcodeExecutorState DebuggerStaticMappingService mappingService = tool.getService(DebuggerStaticMappingService.class); byte[] data = new byte[4096]; - for (Entry ent : mappingService + for (Entry> ent : mappingService .getOpenMappedViews(trace, unknown, snap) .entrySet()) { Program program = ent.getKey(); - ShiftAndAddressSetView shifted = ent.getValue(); - long shift = shifted.getShift(); Memory memory = program.getMemory(); AddressSetView initialized = memory.getLoadedAndInitializedAddressSet(); - AddressSetView toRead = shifted.getAddressSetView().intersect(initialized); - Msg.warn(this, - "Filling in unknown trace memory in emulator using mapped image: " + - program + ": " + toRead); - for (AddressRange rng : toRead) { - long lower = rng.getMinAddress().getOffset(); - long fullLen = rng.getLength(); - while (fullLen > 0) { - int len = MathUtilities.unsignedMin(data.length, fullLen); - try { - int read = - memory.getBytes(space.getAddress(lower), data, 0, len); - if (read < len) { - Msg.warn(this, - " Partial read of " + rng + ". Got " + read + " bytes"); + Collection mappedSet = ent.getValue(); + for (MappedAddressRange mappedRng : mappedSet) { + AddressRange srng = mappedRng.getSourceAddressRange(); + long shift = mappedRng.getShift(); + for (AddressRange subsrng : initialized.intersectRange(srng.getMinAddress(), + srng.getMaxAddress())) { + Msg.warn(this, + "Filling in unknown trace memory in emulator using mapped image: " + + program + ": " + subsrng); + long lower = subsrng.getMinAddress().getOffset(); + long fullLen = subsrng.getLength(); + while (fullLen > 0) { + int len = MathUtilities.unsignedMin(data.length, fullLen); + try { + int read = + memory.getBytes(space.getAddress(lower), data, 0, len); + if (read < len) { + Msg.warn(this, + " Partial read of " + subsrng + ". Got " + read + + " bytes"); + } + cache.putData(lower - shift, data, 0, read); } - cache.putData(lower - shift, data, 0, read); + catch (MemoryAccessException | AddressOutOfBoundsException e) { + throw new AssertionError(e); + } + lower += len; + fullLen -= len; } - catch (MemoryAccessException | AddressOutOfBoundsException e) { - throw new AssertionError(e); - } - lower += len; - fullLen -= len; + result = true; } - result = true; } } return result; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServicePlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServicePlugin.java index 9348c19b52..9a397b5d70 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServicePlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServicePlugin.java @@ -283,7 +283,6 @@ public class DebuggerStaticMappingServicePlugin extends Plugin private Program program; private AddressRange staticRange; - private Long shift; // from static image to trace public MappingEntry(TraceStaticMapping mapping) { this.mapping = mapping; @@ -309,8 +308,6 @@ public class DebuggerStaticMappingServicePlugin extends Plugin Address minAddr = opened.getAddressFactory().getAddress(mapping.getStaticAddress()); Address maxAddr = addOrMax(minAddr, mapping.getLength() - 1); this.staticRange = new AddressRangeImpl(minAddr, maxAddr); - this.shift = mapping.getMinTraceAddress().getOffset() - - staticRange.getMinAddress().getOffset(); return true; } return false; @@ -320,7 +317,6 @@ public class DebuggerStaticMappingServicePlugin extends Plugin if (this.program == closed) { this.program = null; this.staticRange = null; - this.shift = null; return true; } return false; @@ -565,7 +561,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin } protected void collectOpenMappedPrograms(AddressRange rng, Range span, - Map result) { + Map> result) { TraceAddressSnapRange tatr = new ImmutableTraceAddressSnapRange(rng, span); for (Entry out : outbound.entrySet()) { MappingEntry me = out.getValue(); @@ -575,16 +571,16 @@ public class DebuggerStaticMappingServicePlugin extends Plugin if (!out.getKey().intersects(tatr)) { continue; } - - ShiftAndAddressSetView set = result.computeIfAbsent(me.program, - p -> new ShiftAndAddressSetView(-me.shift, new AddressSet())); - ((AddressSet) set.getAddressSetView()).add(me.mapTraceRangeToProgram(rng)); + AddressRange srcRng = out.getKey().getRange().intersect(rng); + AddressRange dstRng = me.mapTraceRangeToProgram(rng); + result.computeIfAbsent(me.program, p -> new TreeSet<>()) + .add(new MappedAddressRange(srcRng, dstRng)); } } - public Map getOpenMappedViews(AddressSetView set, + public Map> getOpenMappedViews(AddressSetView set, Range span) { - Map result = new HashMap<>(); + Map> result = new HashMap<>(); for (AddressRange rng : set) { collectOpenMappedPrograms(rng, span, result); } @@ -715,7 +711,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin } protected void collectOpenMappedViews(AddressRange rng, - Map result) { + Map> result) { for (Entry inPreceeding : inbound.headMapByValue( rng.getMaxAddress(), true).entrySet()) { Address start = inPreceeding.getValue(); @@ -726,14 +722,17 @@ public class DebuggerStaticMappingServicePlugin extends Plugin if (!me.isInProgramRange(rng)) { continue; } - ShiftAndAddressSetView set = result.computeIfAbsent(me.getTraceSnap(), - p -> new ShiftAndAddressSetView(me.shift, new AddressSet())); - ((AddressSet) set.getAddressSetView()).add(me.mapProgramRangeToTrace(rng)); + + AddressRange srcRange = me.staticRange.intersect(rng); + AddressRange dstRange = me.mapProgramRangeToTrace(rng); + result.computeIfAbsent(me.getTraceSnap(), p -> new TreeSet<>()) + .add(new MappedAddressRange(srcRange, dstRange)); } } - public Map getOpenMappedViews(AddressSetView set) { - Map result = new HashMap<>(); + public Map> getOpenMappedViews( + AddressSetView set) { + Map> result = new HashMap<>(); for (AddressRange rng : set) { collectOpenMappedViews(rng, result); } @@ -1219,9 +1218,8 @@ public class DebuggerStaticMappingServicePlugin extends Plugin } @Override - public Map getOpenMappedViews(Trace trace, - AddressSetView set, - long snap) { + public Map> getOpenMappedViews(Trace trace, + AddressSetView set, long snap) { InfoPerTrace info = requireTrackedInfo(trace); if (info == null) { return null; @@ -1230,7 +1228,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin } @Override - public Map getOpenMappedViews(Program program, + public Map> getOpenMappedViews(Program program, AddressSetView set) { InfoPerProgram info = requireTrackedInfo(program); if (info == null) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/services/DebuggerStaticMappingService.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/services/DebuggerStaticMappingService.java index 264b55447c..4a5ed5a2e2 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/services/DebuggerStaticMappingService.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/services/DebuggerStaticMappingService.java @@ -487,27 +487,38 @@ public interface DebuggerStaticMappingService { } /** - * <<<<<<< HEAD A {@code (shift,view)} pair for describing sets of mapped addresses + * A pair for describing sets of mapped addresses + * + *

+ * Note, the natural order is by the destination address. */ - public class ShiftAndAddressSetView { - private final long shift; - private final AddressSetView view; + public class MappedAddressRange implements Comparable { - public ShiftAndAddressSetView(long shift, AddressSetView view) { - this.shift = shift; - this.view = view; + private final AddressRange srcRange; + private final AddressRange dstRange; + private final int hashCode; + private final long shift; + + public MappedAddressRange(AddressRange srcRange, AddressRange dstRange) { + this.srcRange = srcRange; + this.dstRange = dstRange; + this.hashCode = Objects.hash(dstRange, srcRange); + this.shift = dstRange.getMinAddress().getOffset() - + srcRange.getMinAddress().getOffset(); + } + + @Override + public String toString() { + return ""; } /** - * Get the shift from the source address set to this address set + * Get the shift from the source address range to this address range * *

- * The meaning depends on what returned this view. If this view is the "static" set, then + * The meaning depends on what returned this view. If this view is the "static" range, then * this shift describes what was added to the offset of the "dynamic" address to get a - * particular address in this set. Note that since not all addresses from the requested - * source set may have been mapped, you cannot simply compare min addresses to obtain this - * shift. To "map back" to the source address from a destination address in this set, - * subtract this shift. + * particular address in the "static" range. * * @return the shift */ @@ -516,12 +527,107 @@ public interface DebuggerStaticMappingService { } /** - * Get the destination address set view as mapped from the source address set + * Map an address in the source range to the corresponding address in the destination range * - * @return the address set + * @param saddr the source address (not validated) + * @return the destination address */ - public AddressSetView getAddressSetView() { - return view; + public Address mapSourceToDestination(Address saddr) { + return dstRange.getAddressSpace().getAddress(saddr.getOffset() + shift); + } + + /** + * Map an address in the destination range to the corresponding address in the source range + * + * @param daddr the destination address (not validated) + * @return the source address + */ + public Address mapDestinationToSource(Address daddr) { + return srcRange.getAddressSpace().getAddress(daddr.getOffset() - shift); + } + + /** + * Map a sub-range of the source to the corresponding sub-range of the destination + * + * @param srng the source sub-range + * @return the destination sub-range + */ + public AddressRange mapSourceToDestination(AddressRange srng) { + try { + return new AddressRangeImpl(mapSourceToDestination(srng.getMinAddress()), + srng.getLength()); + } + catch (AddressOverflowException e) { + throw new IllegalArgumentException(e); + } + } + + /** + * Map a sub-range of the destination to the corresponding sub-range of the source + * + * @param drng the destination sub-range + * @return the source sub-range + */ + public AddressRange mapDestinationToSource(AddressRange drng) { + try { + return new AddressRangeImpl(mapDestinationToSource(drng.getMinAddress()), + drng.getLength()); + } + catch (AddressOverflowException e) { + throw new IllegalArgumentException(e); + } + } + + /** + * Get the source address range + * + * @return the address range + */ + public AddressRange getSourceAddressRange() { + return srcRange; + } + + /** + * Get the destination address range + * + * @return the address range + */ + public AddressRange getDestinationAddressRange() { + return dstRange; + } + + @Override + public int compareTo(MappedAddressRange that) { + int c; + c = this.dstRange.compareTo(that.dstRange); + if (c != 0) { + return c; + } + c = this.srcRange.compareTo(that.srcRange); + if (c != 0) { + return c; + } + return 0; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof MappedAddressRange)) { + return false; + } + MappedAddressRange that = (MappedAddressRange) obj; + if (!this.dstRange.equals(that.dstRange)) { + return false; + } + if (!this.srcRange.equals(that.srcRange)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return hashCode; } } @@ -570,8 +676,7 @@ public interface DebuggerStaticMappingService { boolean truncateExisting) throws TraceConflictedMappingException; /** - * ======= >>>>>>> d694542c5 (GP-660: Put program filler back in. Need to performance test.) Add - * several static mappings (relocations) + * Add several static mappings (relocations) * *

* This will group the entries by trace and add each's entries in a single transaction. If any @@ -669,9 +774,9 @@ public interface DebuggerStaticMappingService { * @param trace the source trace * @param set the source address set * @param snap the source snap - * @return a map of destination programs to corresponding computed destination address sets + * @return a map of destination programs to corresponding computed destination address ranges */ - Map getOpenMappedViews(Trace trace, + Map> getOpenMappedViews(Trace trace, AddressSetView set, long snap); /** @@ -679,9 +784,9 @@ public interface DebuggerStaticMappingService { * * @param program the destination program, from which we are mapping back * @param set the destination address set, from which we are mapping back - * @return a map of source traces to corresponding computed source address sets + * @return a map of source traces to corresponding computed source address ranges */ - Map getOpenMappedViews(Program program, + Map> getOpenMappedViews(Program program, AddressSetView set); /** diff --git a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginScreenShots.java b/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginScreenShots.java new file mode 100644 index 0000000000..da6c33a62d --- /dev/null +++ b/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginScreenShots.java @@ -0,0 +1,157 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.app.plugin.core.debug.gui.copying; + +import java.util.Set; + +import org.junit.*; + +import com.google.common.collect.Range; + +import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest.TestDebuggerTargetTraceMapper; +import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin; +import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingProvider; +import ghidra.app.plugin.core.debug.service.model.DebuggerModelServicePlugin; +import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingServicePlugin; +import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin; +import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin; +import ghidra.app.services.*; +import ghidra.dbg.model.TestDebuggerModelBuilder; +import ghidra.framework.model.DomainFolder; +import ghidra.program.model.address.AddressSpace; +import ghidra.program.model.mem.Memory; +import ghidra.program.util.ProgramLocation; +import ghidra.program.util.ProgramSelection; +import ghidra.trace.database.ToyDBTraceBuilder; +import ghidra.trace.database.memory.DBTraceMemoryManager; +import ghidra.trace.database.module.DBTraceModuleManager; +import ghidra.trace.model.DefaultTraceLocation; +import ghidra.trace.model.memory.TraceMemoryFlag; +import ghidra.trace.model.modules.TraceModule; +import ghidra.util.database.UndoableTransaction; +import ghidra.util.task.TaskMonitor; +import help.screenshot.GhidraScreenShotGenerator; + +public class DebuggerCopyActionsPluginScreenShots extends GhidraScreenShotGenerator { + + ProgramManager programManager; + DebuggerTraceManagerService traceManager; + DebuggerModelService modelService; + DebuggerStaticMappingServicePlugin mappingService; + DebuggerListingPlugin listingPlugin; + DebuggerListingProvider listingProvider; + DebuggerCopyActionsPlugin copyPlugin; + TestDebuggerModelBuilder mb; + ToyDBTraceBuilder tb; + + @Before + public void setUpMine() throws Throwable { + programManager = addPlugin(tool, ProgramManagerPlugin.class); + traceManager = addPlugin(tool, DebuggerTraceManagerServicePlugin.class); + modelService = addPlugin(tool, DebuggerModelServicePlugin.class); + mappingService = addPlugin(tool, DebuggerStaticMappingServicePlugin.class); + listingPlugin = addPlugin(tool, DebuggerListingPlugin.class); + copyPlugin = addPlugin(tool, DebuggerCopyActionsPlugin.class); + + listingProvider = waitForComponentProvider(DebuggerListingProvider.class); + + mb = new TestDebuggerModelBuilder(); + mb.createTestModel(); + mb.createTestProcessesAndThreads(); + TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, + new TestDebuggerTargetTraceMapper(mb.testProcess1)); + tb = new ToyDBTraceBuilder(recorder.getTrace()); + } + + @After + public void tearDownMine() { + tb.close(); + + if (program != null) { + program.release(this); + } + } + + @Test + public void testCaptureDebuggerCopyIntoProgramDialog() throws Throwable { + long snap; + try (UndoableTransaction tid = tb.startTransaction()) { + snap = tb.trace.getTimeManager().createSnapshot("First").getKey(); + DBTraceMemoryManager mem = tb.trace.getMemoryManager(); + mem.createRegion(".text", snap, tb.range(0x55550000, 0x5555ffff), + Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE)); + mem.createRegion(".data", snap, tb.range(0x55560000, 0x5556ffff), + Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.WRITE)); + mem.createRegion("[stack]", snap, tb.range(0x00100000, 0x001fffff), + Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.WRITE)); + + DBTraceModuleManager mods = tb.trace.getModuleManager(); + + TraceModule modEcho = mods.addLoadedModule("Modules[/bin/echo]", "/bin/echo", + tb.range(0x55550000, 0x5556ffff), snap); + modEcho.addSection("Modules[/bin/echo].Sections[.text]", ".text", + tb.range(0x55550000, 0x5555ffff)); + modEcho.addSection("Modules[/bin/echo].Sections[.data]", ".data", + tb.range(0x55560000, 0x5556ffff)); + } + + program = createDefaultProgram("echo", "Toy:BE:64:default", this); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Add memory", true)) { + program.setImageBase(tb.addr(stSpace, 0x00400000), true); + Memory memory = program.getMemory(); + memory.createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000, (byte) 0, + TaskMonitor.DUMMY, false); + memory.createInitializedBlock(".data", tb.addr(stSpace, 0x00600000), 0x10000, (byte) 0, + TaskMonitor.DUMMY, false); + } + + DomainFolder root = tool.getProject().getProjectData().getRootFolder(); + root.createFile(tb.trace.getName(), tb.trace, TaskMonitor.DUMMY); + root.createFile(program.getName(), program, TaskMonitor.DUMMY); + + try (UndoableTransaction tid = tb.startTransaction()) { + mappingService.addMapping( + new DefaultTraceLocation(tb.trace, null, Range.atLeast(snap), tb.addr(0x55550000)), + new ProgramLocation(program, tb.addr(stSpace, 0x00400000)), 0x10000, true); + mappingService.addMapping( + new DefaultTraceLocation(tb.trace, null, Range.atLeast(snap), tb.addr(0x55560000)), + new ProgramLocation(program, tb.addr(stSpace, 0x00600000)), 0x10000, true); + } + + traceManager.openTrace(tb.trace); + traceManager.activateTrace(tb.trace); + + programManager.openProgram(program); + + listingProvider.requestFocus(); + waitForSwing(); + + listingProvider.setSelection( + new ProgramSelection(tb.trace.getMemoryManager().getRegionsAddressSet(snap))); + + waitForCondition(() -> copyPlugin.actionCopyIntoCurrentProgram.isEnabled()); + performAction(copyPlugin.actionCopyIntoCurrentProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + dialog.setRelocate(true); + dialog.reset(); + waitForSwing(); + + captureDialog(DebuggerCopyIntoProgramDialog.class, 700, 600); + } +} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java index 5d58809104..a8906486d3 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java @@ -495,8 +495,12 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest tool.getProject().getProjectData().getRootFolder().createFile(obj.getName(), obj, monitor); } + protected void createSnaplessTrace(String langID) throws IOException { + tb = new ToyDBTraceBuilder("dynamic-" + name.getMethodName(), langID); + } + protected void createSnaplessTrace() throws IOException { - tb = new ToyDBTraceBuilder("dynamic-" + name.getMethodName(), LANGID_TOYBE64); + createSnaplessTrace(LANGID_TOYBE64); } protected void addSnapshot(String desc) throws IOException { @@ -505,16 +509,28 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest } } - protected void createTrace() throws IOException { - createSnaplessTrace(); + protected void createTrace(String langID) throws IOException { + createSnaplessTrace(langID); addSnapshot("First snap"); } - protected void createAndOpenTrace() throws IOException { - createTrace(); + protected void createTrace() throws IOException { + createTrace(LANGID_TOYBE64); + } + + protected void useTrace(Trace trace) { + tb = new ToyDBTraceBuilder(trace); + } + + protected void createAndOpenTrace(String langID) throws IOException { + createTrace(langID); traceManager.openTrace(tb.trace); } + protected void createAndOpenTrace() throws IOException { + createAndOpenTrace(LANGID_TOYBE64); + } + protected String getProgramName() { return "static-" + getClass().getCanonicalName() + "." + name.getMethodName(); } diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginTest.java new file mode 100644 index 0000000000..8b532e3c18 --- /dev/null +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyActionsPluginTest.java @@ -0,0 +1,505 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.app.plugin.core.debug.gui.copying; + +import static org.junit.Assert.*; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.junit.Before; +import org.junit.Test; + +import com.google.common.collect.Range; + +import generic.Unique; +import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest; +import ghidra.app.plugin.core.debug.gui.action.AutoReadMemorySpec; +import ghidra.app.plugin.core.debug.gui.action.NoneAutoReadMemorySpec; +import ghidra.app.plugin.core.debug.gui.copying.DebuggerCopyIntoProgramDialog.RangeEntry; +import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin; +import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingProvider; +import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingServicePlugin; +import ghidra.app.services.DebuggerStaticMappingService; +import ghidra.app.services.TraceRecorder; +import ghidra.dbg.DebuggerModelListener; +import ghidra.dbg.target.TargetObject; +import ghidra.program.model.address.Address; +import ghidra.program.model.address.AddressSpace; +import ghidra.program.model.listing.Program; +import ghidra.program.model.mem.MemoryBlock; +import ghidra.program.util.ProgramLocation; +import ghidra.program.util.ProgramSelection; +import ghidra.test.ToyProgramBuilder; +import ghidra.trace.database.memory.DBTraceMemoryManager; +import ghidra.trace.model.DefaultTraceLocation; +import ghidra.trace.model.TraceLocation; +import ghidra.trace.model.memory.TraceMemoryFlag; +import ghidra.util.database.UndoableTransaction; + +public class DebuggerCopyActionsPluginTest extends AbstractGhidraHeadedDebuggerGUITest { + + DebuggerCopyActionsPlugin copyActionsPlugin; + DebuggerListingPlugin listingPlugin; + DebuggerStaticMappingService mappingService; + + DebuggerListingProvider listingProvider; + + @Before + public void setupCopyActionsPluginTest() throws Exception { + mappingService = addPlugin(tool, DebuggerStaticMappingServicePlugin.class); + copyActionsPlugin = addPlugin(tool, DebuggerCopyActionsPlugin.class); + listingPlugin = addPlugin(tool, DebuggerListingPlugin.class); + + listingProvider = waitForComponentProvider(DebuggerListingProvider.class); + } + + @Test + public void testActionCopyIntoCurrentProgramWithoutRelocationCreateBlocks() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + createProgram(); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + programManager.openProgram(program); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + createAndOpenTrace(); + try (UndoableTransaction tid = tb.startTransaction()) { + tb.trace.getMemoryManager() + .createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + } + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + listingProvider.requestFocus(); + listingProvider + .setSelection(new ProgramSelection(tb.addr(0x00400000), tb.addr(0x0040ffff))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoCurrentProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + dialog.setRelocate(false); + dialog.reset(); + + RangeEntry entry = Unique.assertOne(dialog.tableModel.getModelData()); + + assertEquals(tb.range(stSpace, 0x00400000, 0x0040ffff), entry.getSrcRange()); + assertEquals(tb.range(stSpace, 0x00400000, 0x0040ffff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text", entry.getBlockName()); + assertTrue(entry.isCreate()); + dialog.okCallback(); + dialog.lastTask.get(1000, TimeUnit.MILLISECONDS); + waitForSwing(); + + MemoryBlock text = Unique.assertOne(Arrays.asList(program.getMemory().getBlocks())); + assertEquals(".text", text.getName()); + } + + @Test + public void testActionCopyIntoCurrentProgramWithoutRelocationCrossLanguage() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + createProgram(getSLEIGH_X86_LANGUAGE()); + createAndOpenTrace(ToyProgramBuilder._X64); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Add blocks", true)) { + program.getMemory() + .createInitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x8000, + (byte) 0, monitor, false); + program.getMemory() + .createInitializedBlock(".text2", tb.addr(stSpace, 0x00408000), 0x8000, + (byte) 0, monitor, false); + } + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager mm = tb.trace.getMemoryManager(); + mm.createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + mm.putBytes(0, tb.addr(0x00401234), tb.buf(1, 2, 3, 4)); + + // This region should be excluded, since it cannot be mapped identically into 32-bits + mm.createRegion("lib:.text", 0, tb.range(0x7fff00400000L, 0x7fff0040ffffL), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + + // This region should be partially excluded, because 32-bits + // This is not likely to ever happen in practice, but be prepared + mm.createRegion(".straddle", 0, tb.range(0xfffff000L, 0x100000fffL), + TraceMemoryFlag.READ, TraceMemoryFlag.WRITE); + } + + programManager.openProgram(program); + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + listingProvider.requestFocus(); + listingProvider.setSelection(new ProgramSelection(tb.set( + tb.range(0x00400000, 0x0040ffff), + tb.range(0x7fff00400000L, 0x7fff0040ffffL), + tb.range(0xfffff000L, 0x100000fffL)))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoCurrentProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + dialog.setRelocate(false); + dialog.reset(); + + List entries = List.copyOf(dialog.tableModel.getModelData()); + assertEquals(3, entries.size()); + RangeEntry entry; + + entry = entries.get(0); + assertEquals(tb.range(0x00400000, 0x00407fff), entry.getSrcRange()); + assertEquals(tb.range(stSpace, 0x00400000, 0x00407fff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text *", entry.getBlockName()); + assertFalse(entry.isCreate()); + + entry = entries.get(1); + assertEquals(tb.range(0x00408000, 0x0040ffff), entry.getSrcRange()); + assertEquals(tb.range(stSpace, 0x00408000, 0x0040ffff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text2 *", entry.getBlockName()); + assertFalse(entry.isCreate()); + + entry = entries.get(2); + assertEquals(tb.range(0xfffff000L, 0xffffffffL), entry.getSrcRange()); + assertEquals(tb.range(stSpace, 0xfffff000L, 0xffffffffL), entry.getDstRange()); + assertEquals(".straddle", entry.getRegionName()); + assertEquals(".straddle", entry.getBlockName()); + assertTrue(entry.isCreate()); + + dialog.okCallback(); + dialog.lastTask.get(1000, TimeUnit.MILLISECONDS); + waitForSwing(); + + byte[] dest = new byte[4]; + program.getMemory().getBytes(tb.addr(stSpace, 0x00401234), dest); + assertArrayEquals(tb.arr(1, 2, 3, 4), dest); + } + + @Test + public void testActionCopyIntoCurrentProgramWithRelocationExistingBlocks() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + createAndOpenTrace(); + createProgramFromTrace(); + intoProject(program); + intoProject(tb.trace); + + try (UndoableTransaction tid = tb.startTransaction()) { + tb.trace.getMemoryManager() + .createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + } + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + programManager.openProgram(program); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + MemoryBlock block; + try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block", true)) { + block = program.getMemory() + .createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000, + false); + } + + TraceLocation tloc = + new DefaultTraceLocation(tb.trace, null, Range.atLeast(0L), tb.addr(0x55550000)); + ProgramLocation ploc = new ProgramLocation(program, tb.addr(stSpace, 0x00400000)); + try (UndoableTransaction tid = tb.startTransaction()) { + mappingService.addMapping(tloc, ploc, 0x10000, true); + } + + waitForValue(() -> mappingService + .getOpenMappedViews(tb.trace, tb.set(tb.range(0x55550000, 0x5555ffff)), 0) + .get(program)); + + listingProvider.requestFocus(); + listingProvider + .setSelection(new ProgramSelection(tb.addr(0x55550000), tb.addr(0x5555ffff))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoCurrentProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + dialog.setRelocate(true); + dialog.reset(); + + RangeEntry entry = Unique.assertOne(dialog.tableModel.getModelData()); + + assertEquals(tb.range(stSpace, 0x55550000, 0x5555ffff), entry.getSrcRange()); + assertEquals(tb.range(stSpace, 0x00400000, 0x0040ffff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text *", entry.getBlockName()); + assertFalse(entry.isCreate()); + dialog.okCallback(); + dialog.lastTask.get(1000, TimeUnit.MILLISECONDS); + waitForSwing(); + + MemoryBlock text = Unique.assertOne(Arrays.asList(program.getMemory().getBlocks())); + assertEquals(block, text); + } + + @Test + public void testActionCopyIntoCurrentProgramWithRelocationOverlayBlocks() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + createAndOpenTrace(); + createProgramFromTrace(); + intoProject(program); + intoProject(tb.trace); + + try (UndoableTransaction tid = tb.startTransaction()) { + tb.trace.getMemoryManager() + .createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + } + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + programManager.openProgram(program); + assertFalse(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled()); + + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + MemoryBlock block; + try (UndoableTransaction tid = UndoableTransaction.start(program, "Create block", true)) { + block = program.getMemory() + .createUninitializedBlock(".text", tb.addr(stSpace, 0x00400000), 0x10000, + false); + } + + TraceLocation tloc = + new DefaultTraceLocation(tb.trace, null, Range.atLeast(0L), tb.addr(0x55550000)); + ProgramLocation ploc = new ProgramLocation(program, tb.addr(stSpace, 0x00400000)); + try (UndoableTransaction tid = tb.startTransaction()) { + mappingService.addMapping(tloc, ploc, 0x10000, true); + } + + waitForValue(() -> mappingService + .getOpenMappedViews(tb.trace, tb.set(tb.range(0x55550000, 0x5555ffff)), 0) + .get(program)); + + listingProvider.requestFocus(); + listingProvider + .setSelection(new ProgramSelection(tb.addr(0x55550000), tb.addr(0x5555ffff))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoCurrentProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoCurrentProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + dialog.setRelocate(true); + dialog.setUseOverlays(true); + dialog.reset(); + + RangeEntry entry = Unique.assertOne(dialog.tableModel.getModelData()); + + assertEquals(tb.range(stSpace, 0x55550000, 0x5555ffff), entry.getSrcRange()); + assertEquals(tb.range(stSpace, 0x00400000, 0x0040ffff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text_2", entry.getBlockName()); + assertTrue(entry.isCreate()); + dialog.okCallback(); + dialog.lastTask.get(1000, TimeUnit.MILLISECONDS); + waitForSwing(); + + MemoryBlock text2 = + Unique.assertOne(Arrays.asList(program.getMemory().getBlock(".text_2"))); + assertNotEquals(block, text2); + assertTrue(text2.isOverlay()); + } + + @Test + public void testActionCopyIntoNewProgram() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled()); + + createAndOpenTrace(); + + try (UndoableTransaction tid = tb.startTransaction()) { + tb.trace.getMemoryManager() + .createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + } + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled()); + + listingProvider.requestFocus(); + listingProvider + .setSelection(new ProgramSelection(tb.addr(0x55550000), tb.addr(0x5555ffff))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoNewProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + dialog.setDestination(DebuggerCopyIntoProgramDialog.TEMP_PROGRAM); + + RangeEntry entry = Unique.assertOne(dialog.tableModel.getModelData()); + + assertEquals(tb.range(0x55550000, 0x5555ffff), entry.getSrcRange()); + assertEquals(tb.range(0x55550000, 0x5555ffff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text", entry.getBlockName()); + assertTrue(entry.isCreate()); + entry.setBlockName(".my_text"); + dialog.okCallback(); + dialog.lastTask.get(1000, TimeUnit.MILLISECONDS); + waitForSwing(); + + // Declare my own, or the @After will try to release it erroneously + Program program = waitForValue(() -> programManager.getCurrentProgram()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + MemoryBlock text = Unique.assertOne(Arrays.asList(program.getMemory().getBlocks())); + assertEquals(tb.addr(stSpace, 0x55550000), text.getStart()); + assertEquals(".my_text", text.getName()); + } + + @Test + public void testActionCopyIntoNewProgramAdjacentRegions() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled()); + + createAndOpenTrace(); + + try (UndoableTransaction tid = tb.startTransaction()) { + tb.trace.getMemoryManager() + .createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + tb.trace.getMemoryManager() + .createRegion(".data", 0, tb.range(0x55560000, 0x5556ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.WRITE); + } + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled()); + + listingProvider.requestFocus(); + listingProvider + .setSelection(new ProgramSelection(tb.addr(0x55550000), tb.addr(0x5556ffff))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoNewProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + assertFalse(dialog.cbCapture.isEnabled()); + assertFalse(dialog.cbCapture.isSelected()); + dialog.setDestination(DebuggerCopyIntoProgramDialog.TEMP_PROGRAM); + + assertEquals(2, dialog.tableModel.getRowCount()); + RangeEntry entry; + + entry = dialog.tableModel.getRowObject(0); + assertEquals(tb.range(0x55550000, 0x5555ffff), entry.getSrcRange()); + assertEquals(tb.range(0x55550000, 0x5555ffff), entry.getDstRange()); + assertEquals(".text", entry.getRegionName()); + assertEquals(".text", entry.getBlockName()); + assertTrue(entry.isCreate()); + + entry = dialog.tableModel.getRowObject(1); + assertEquals(tb.range(0x55560000, 0x5556ffff), entry.getSrcRange()); + assertEquals(tb.range(0x55560000, 0x5556ffff), entry.getDstRange()); + assertEquals(".data", entry.getRegionName()); + assertEquals(".data", entry.getBlockName()); + assertTrue(entry.isCreate()); + + dialog.okCallback(); + dialog.lastTask.get(1000, TimeUnit.MILLISECONDS); + waitForSwing(); + + // Declare my own, or the @After will try to release it erroneously + Program program = waitForValue(() -> programManager.getCurrentProgram()); + assertEquals(2, program.getMemory().getBlocks().length); + } + + @Test + public void testActionCopyIntoNewProgramCaptureLive() throws Exception { + assertFalse(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled()); + + createTestModel(); + + var listener = new DebuggerModelListener() { + int count = 0; + + @Override + public void memoryUpdated(TargetObject memory, Address address, byte[] data) { + count++; + } + }; + mb.testModel.addModelListener(listener); + + mb.createTestProcessesAndThreads(); + TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, + new TestDebuggerTargetTraceMapper(mb.testProcess1)); + useTrace(recorder.getTrace()); + mb.testProcess1.memory.addRegion(".text", mb.rng(0x55550000, 0x5555ffff), "rx"); + mb.testProcess1.memory.setMemory(mb.addr(0x55550000), mb.arr(1, 2, 3, 4, 5, 6, 7, 8)); + waitForPass(() -> { + assertEquals(1, tb.trace.getMemoryManager().getAllRegions().size()); + }); + + listingProvider.setAutoReadMemorySpec( + AutoReadMemorySpec.fromConfigName(NoneAutoReadMemorySpec.CONFIG_NAME)); + + traceManager.openTrace(tb.trace); + traceManager.activateTrace(tb.trace); + assertFalse(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled()); + + listingProvider.requestFocus(); + listingProvider + .setSelection(new ProgramSelection(tb.addr(0x55550000), tb.addr(0x5555ffff))); + + waitForPass(() -> assertTrue(copyActionsPlugin.actionCopyIntoNewProgram.isEnabled())); + performAction(copyActionsPlugin.actionCopyIntoNewProgram, false); + DebuggerCopyIntoProgramDialog dialog = + waitForDialogComponent(DebuggerCopyIntoProgramDialog.class); + assertTrue(dialog.cbCapture.isEnabled()); + assertTrue(dialog.cbCapture.isSelected()); + dialog.setDestination(DebuggerCopyIntoProgramDialog.TEMP_PROGRAM); + + RangeEntry entry = Unique.assertOne(dialog.tableModel.getModelData()); + + assertEquals(tb.range(0x55550000, 0x5555ffff), entry.getSrcRange()); + assertEquals(tb.range(0x55550000, 0x5555ffff), entry.getDstRange()); + assertEquals("[.text]", entry.getRegionName()); + assertEquals("[.text]", entry.getBlockName()); + assertTrue(entry.isCreate()); + entry.setBlockName(".my_text"); + + assertEquals(0, listener.count); + dialog.okCallback(); + dialog.lastTask.get(10000, TimeUnit.MILLISECONDS); + waitForSwing(); + assertEquals(16, listener.count); + + // Declare my own, or the @After will try to release it erroneously + Program program = waitForValue(() -> programManager.getCurrentProgram()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + MemoryBlock text = Unique.assertOne(Arrays.asList(program.getMemory().getBlocks())); + assertEquals(tb.addr(stSpace, 0x55550000), text.getStart()); + assertEquals(".my_text", text.getName()); + byte[] arr = new byte[8]; + text.getBytes(tb.addr(stSpace, 0x55550000), arr); + assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8), arr); + } +} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java new file mode 100644 index 0000000000..c2b21ee2ce --- /dev/null +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/copying/DebuggerCopyPlanTests.java @@ -0,0 +1,743 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.app.plugin.core.debug.gui.copying; + +import static org.junit.Assert.*; + +import java.awt.Color; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.util.*; + +import javax.swing.JCheckBox; + +import org.junit.Test; + +import com.google.common.collect.Range; + +import ghidra.app.plugin.assembler.Assembler; +import ghidra.app.plugin.assembler.Assemblers; +import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest; +import ghidra.app.plugin.core.debug.gui.DebuggerResources; +import ghidra.app.plugin.core.debug.gui.copying.DebuggerCopyPlan.AllCopiers; +import ghidra.app.util.viewer.listingpanel.PropertyBasedBackgroundColorModel; +import ghidra.program.database.IntRangeMap; +import ghidra.program.disassemble.Disassembler; +import ghidra.program.disassemble.DisassemblerMessageListener; +import ghidra.program.model.address.*; +import ghidra.program.model.data.*; +import ghidra.program.model.lang.Register; +import ghidra.program.model.lang.RegisterValue; +import ghidra.program.model.listing.*; +import ghidra.program.model.symbol.*; +import ghidra.trace.database.breakpoint.DBTraceBreakpointManager; +import ghidra.trace.database.memory.DBTraceMemoryManager; +import ghidra.trace.database.program.DBTraceVariableSnapProgramView; +import ghidra.trace.database.symbol.*; +import ghidra.trace.model.breakpoint.TraceBreakpointKind; +import ghidra.trace.model.memory.TraceMemoryFlag; +import ghidra.trace.model.memory.TraceMemoryState; +import ghidra.util.database.UndoableTransaction; +import ghidra.util.task.TaskMonitor; + +public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest { + public static class TestDynamicDataType extends CountedDynamicDataType { + public static final TestDynamicDataType dataType = new TestDynamicDataType(); + + public TestDynamicDataType() { + super("test_dyn", "A test dynamic type", ShortDataType.dataType, ByteDataType.dataType, + 0, 2, 0xffff); + } + } + + @Test + public void testBytes() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.BYTES.isAvailable(view, program)); + + Random r = new Random(); + byte src[] = new byte[0x10000]; + r.nextBytes(src); + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + memory.putBytes(0, tb.addr(0x55550000), ByteBuffer.wrap(src)); + } + + Address paddr = tb.addr(stSpace, 0x00400000); + assertTrue(AllCopiers.BYTES.isRequiresInitializedMemory()); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.BYTES.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + byte dst[] = new byte[0x10000]; + program.getMemory().getBytes(paddr, dst); + + assertArrayEquals(src, dst); + } + + @Test + public void testState() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.STATE.isAvailable(view, program)); + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + memory.putBytes(0, tb.addr(0x55550000), ByteBuffer.allocate(4096)); + memory.setState(0, tb.addr(0x55551000), TraceMemoryState.ERROR); + } + + Address paddr = tb.addr(stSpace, 0x00400000); + assertFalse(AllCopiers.STATE.isRequiresInitializedMemory()); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.STATE.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + IntRangeMap map = + program.getIntRangeMap(PropertyBasedBackgroundColorModel.COLOR_PROPERTY_NAME); + AddressSet staleSet = + map.getAddressSet(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE.getRGB()); + assertEquals(tb.set(tb.range(stSpace, 0x00401001, 0x0040ffff)), staleSet); + AddressSet errorSet = + map.getAddressSet(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR.getRGB()); + assertEquals(tb.set(tb.range(stSpace, 0x00401000, 0x00401000)), errorSet); + } + + @Test + public void testInstructionsMismatched() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + + assertFalse(AllCopiers.INSTRUCTIONS.isAvailable(tb.trace.getProgramView(), program)); + } + + @Test + public void testInstructionsDepBytes() throws Exception { + DebuggerCopyPlan plan = new DebuggerCopyPlan(); + JCheckBox cbInstructions = plan.getCheckBox(AllCopiers.INSTRUCTIONS); + JCheckBox cbBytes = plan.getCheckBox(AllCopiers.BYTES); + assertFalse(cbInstructions.isSelected()); + assertFalse(cbBytes.isSelected()); + + cbInstructions.doClick(); + assertTrue(cbInstructions.isSelected()); + assertTrue(cbBytes.isSelected()); + + cbInstructions.doClick(); + assertFalse(cbInstructions.isSelected()); + assertTrue(cbBytes.isSelected()); + + cbInstructions.doClick(); + assertTrue(cbInstructions.isSelected()); + assertTrue(cbBytes.isSelected()); + + cbBytes.doClick(); + assertFalse(cbInstructions.isSelected()); + assertFalse(cbBytes.isSelected()); + + cbBytes.doClick(); + assertFalse(cbInstructions.isSelected()); + assertTrue(cbBytes.isSelected()); + } + + @Test + public void testInstructions() throws Exception { + createTrace(); + createProgram(); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.BYTES.isAvailable(view, program)); + assertTrue(AllCopiers.INSTRUCTIONS.isAvailable(view, program)); + + AddressRange trng = tb.range(0x55550000, 0x5555ffff); + Assembler asm = Assemblers.getAssembler(view); + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + InstructionIterator iit = asm.assemble(tb.addr(0x55550000), + "imm r0, #1234", + "imm r1, #2045", + "add r0, r1"); + assertTrue(iit.hasNext()); + } + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + Address paddr = tb.addr(stSpace, 0x00400000); + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.BYTES.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + AllCopiers.INSTRUCTIONS.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + } + + List instructions = new ArrayList<>(); + program.getListing().getInstructions(true).forEachRemaining(instructions::add); + + assertEquals(3, instructions.size()); + Instruction ins; + + ins = instructions.get(0); + assertEquals(tb.addr(stSpace, 0x00400000), ins.getAddress()); + assertEquals("imm r0,#0x4d2", ins.toString()); + ins = instructions.get(1); + assertEquals(tb.addr(stSpace, 0x00400002), ins.getAddress()); + assertEquals("imm r1,#0x7fd", ins.toString()); + ins = instructions.get(2); + assertEquals(tb.addr(stSpace, 0x00400004), ins.getAddress()); + assertEquals("add r0,r1", ins.toString()); + } + + @Test + public void testInstructionsWithDefaultContext() throws Exception { + createTrace("x86:LE:64:default"); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.BYTES.isAvailable(view, program)); + assertTrue(AllCopiers.INSTRUCTIONS.isAvailable(view, program)); + + AddressRange trng = tb.range(0x55550000, 0x5555ffff); + Assembler asm = Assemblers.getAssembler(view); + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + InstructionIterator iit = asm.assemble(tb.addr(0x55550000), + "MOV RAX, 1234", + "MOV RCX, 2345", + "ADD RAX, RCX"); + assertTrue(iit.hasNext()); + } + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + Address paddr = tb.addr(stSpace, 0x00400000); + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.BYTES.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + AllCopiers.INSTRUCTIONS.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + } + + List instructions = new ArrayList<>(); + program.getListing().getInstructions(true).forEachRemaining(instructions::add); + + assertEquals(3, instructions.size()); + Instruction ins; + + ins = instructions.get(0); + assertEquals(tb.addr(stSpace, 0x00400000), ins.getAddress()); + assertEquals("MOV RAX,0x4d2", ins.toString()); + ins = instructions.get(1); + assertEquals(tb.addr(stSpace, 0x00400007), ins.getAddress()); + assertEquals("MOV RCX,0x929", ins.toString()); + ins = instructions.get(2); + assertEquals(tb.addr(stSpace, 0x0040000e), ins.getAddress()); + assertEquals("ADD RAX,RCX", ins.toString()); + } + + @Test + public void testInstructionsWithContext() throws Exception { + createTrace("x86:LE:64:default"); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.BYTES.isAvailable(view, program)); + assertTrue(AllCopiers.INSTRUCTIONS.isAvailable(view, program)); + + AddressRange trng = tb.range(0x55550000, 0x5555ffff); + // Assembler asm = Assemblers.getAssembler(view); + + Register contextReg = tb.language.getContextBaseRegister(); + Register longMode = tb.language.getRegister("longMode"); + RegisterValue rv = tb.trace.getRegisterContextManager() + .getValueWithDefault(tb.language, contextReg, 0, tb.addr(0x55550000)); + rv = rv.assign(longMode, BigInteger.ZERO); + Instruction checkCtx; + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + tb.trace.getRegisterContextManager().setValue(tb.language, rv, Range.atLeast(0L), trng); + + // TODO: Once GP-1426 is resolved, use the assembler + /* + InstructionIterator iit = asm.assemble(tb.addr(0x55550000), + "MOV EAX, 1234", + "MOV ECX, 2345", + "ADD EAX, ECX"); + checkCtx = iit.next(); + */ + memory.putBytes(0, tb.addr(0x55550000), tb.buf( + 0xb8, 0xd2, 0x04, 0x00, 0x00, // MOV EAX,1234 + 0xb9, 0x29, 0x09, 0x00, 0x00, // MOV ECX,2345 + 0x01, 0xc8 // ADD EAX,ECX + )); + Disassembler + .getDisassembler(view, TaskMonitor.DUMMY, DisassemblerMessageListener.IGNORE) + .disassemble(tb.addr(0x55550000), tb.set(tb.range(0x55550000, 0x5555000b))); + checkCtx = tb.trace.getCodeManager().instructions().getAt(0, tb.addr(0x55550000)); + } + // Sanity pre-check + RegisterValue insCtx = checkCtx.getRegisterValue(contextReg); + assertFalse(insCtx.equals(tb.trace.getRegisterContextManager() + .getDefaultValue(tb.language, contextReg, checkCtx.getAddress()))); + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + Address paddr = tb.addr(stSpace, 0x00400000); + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.BYTES.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + AllCopiers.INSTRUCTIONS.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + } + + List instructions = new ArrayList<>(); + program.getListing().getInstructions(true).forEachRemaining(instructions::add); + + assertEquals(3, instructions.size()); + Instruction ins; + + ins = instructions.get(0); + assertEquals(tb.addr(stSpace, 0x00400000), ins.getAddress()); + assertEquals("MOV EAX,0x4d2", ins.toString()); + ins = instructions.get(1); + assertEquals(tb.addr(stSpace, 0x00400005), ins.getAddress()); + assertEquals("MOV ECX,0x929", ins.toString()); + ins = instructions.get(2); + assertEquals(tb.addr(stSpace, 0x0040000a), ins.getAddress()); + assertEquals("ADD EAX,ECX", ins.toString()); + } + + @Test + public void testDataMismatched() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + + assertFalse(AllCopiers.DATA.isAvailable(tb.trace.getProgramView(), program)); + } + + @Test + public void testData() throws Exception { + createTrace(); + createProgram(); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.DATA.isAvailable(view, program)); + + AddressRange trng = tb.range(0x55560000, 0x5556ffff); + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".data", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.WRITE); + tb.addData(0, tb.addr(0x55560000), ByteDataType.dataType, tb.buf(0x12)); + tb.addData(0, tb.addr(0x55560001), ShortDataType.dataType, tb.buf(0x12, 0x34)); + tb.addData(0, tb.addr(0x55560003), IntegerDataType.dataType, + tb.buf(0x12, 0x34, 0x56, 0x78)); + tb.addData(0, tb.addr(0x55560007), LongLongDataType.dataType, + tb.buf(0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0)); + tb.addData(0, tb.addr(0x5556000f), TestDynamicDataType.dataType, + tb.buf(0x00, 0x03, 0x00, 0x01, 0x02)); + } + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + Address paddr = tb.addr(stSpace, 0x00600000); + program.getMemory() + .createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.DATA.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + } + + List data = new ArrayList<>(); + program.getListing().getDefinedData(true).forEachRemaining(data::add); + + // NB. Bytes were not copied. Dynamic omitted. + assertEquals(4, data.size()); + Data dat; + + dat = data.get(0); + assertEquals(tb.addr(stSpace, 0x00600000), dat.getAddress()); + assertEquals("db 0h", dat.toString()); + dat = data.get(1); + assertEquals(tb.addr(stSpace, 0x00600001), dat.getAddress()); + assertEquals("short 0h", dat.toString()); + dat = data.get(2); + assertEquals(tb.addr(stSpace, 0x00600003), dat.getAddress()); + assertEquals("int 0h", dat.toString()); + dat = data.get(3); + assertEquals(tb.addr(stSpace, 0x00600007), dat.getAddress()); + assertEquals("longlong 0h", dat.toString()); + } + + @Test + public void testDynamicDataMismatched() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + + assertFalse(AllCopiers.DYNAMIC_DATA.isAvailable(tb.trace.getProgramView(), program)); + } + + @Test + public void testDynamicData() throws Exception { + createTrace(); + createProgram(); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.DYNAMIC_DATA.isAvailable(view, program)); + + AddressRange trng = tb.range(0x55560000, 0x5556ffff); + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".data", 0, trng, TraceMemoryFlag.READ, TraceMemoryFlag.WRITE); + tb.addData(0, tb.addr(0x55560000), ByteDataType.dataType, tb.buf(0x12)); + tb.addData(0, tb.addr(0x55560001), ShortDataType.dataType, tb.buf(0x12, 0x34)); + tb.addData(0, tb.addr(0x55560003), IntegerDataType.dataType, + tb.buf(0x12, 0x34, 0x56, 0x78)); + tb.addData(0, tb.addr(0x55560007), LongLongDataType.dataType, + tb.buf(0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0)); + tb.addData(0, tb.addr(0x5556000f), TestDynamicDataType.dataType, + tb.buf(0x00, 0x03, 0x00, 0x01, 0x02)); + } + + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + Address paddr = tb.addr(stSpace, 0x00600000); + program.getMemory() + .createInitializedBlock(".data", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.BYTES.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + AllCopiers.DATA.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + AllCopiers.DYNAMIC_DATA.copy(view, trng, program, paddr, TaskMonitor.DUMMY); + } + + List data = new ArrayList<>(); + program.getListing().getDefinedData(true).forEachRemaining(data::add); + + // NB. Bytes were not copied. Dynamic omitted. + assertEquals(5, data.size()); + Data dat; + Data cmp; + + dat = data.get(0); + assertEquals(tb.addr(stSpace, 0x00600000), dat.getAddress()); + assertEquals("db 12h", dat.toString()); + dat = data.get(1); + assertEquals(tb.addr(stSpace, 0x00600001), dat.getAddress()); + assertEquals("short 1234h", dat.toString()); + dat = data.get(2); + assertEquals(tb.addr(stSpace, 0x00600003), dat.getAddress()); + assertEquals("int 12345678h", dat.toString()); + dat = data.get(3); + assertEquals(tb.addr(stSpace, 0x00600007), dat.getAddress()); + assertEquals("longlong 123456789ABCDEF0h", dat.toString()); + + dat = data.get(4); + assertEquals(tb.addr(stSpace, 0x0060000f), dat.getAddress()); + assertEquals("test_dyn ", dat.toString()); + assertEquals(4, dat.getNumComponents()); // count + 3 elements + cmp = dat.getComponent(0); + assertEquals("short 3h", cmp.toString()); + cmp = dat.getComponent(1); + assertEquals("db 0h", cmp.toString()); + cmp = dat.getComponent(2); + assertEquals("db 1h", cmp.toString()); + cmp = dat.getComponent(3); + assertEquals("db 2h", cmp.toString()); + } + + @Test + public void testLabels() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.LABELS.isAvailable(view, program)); + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + DBTraceNamespaceSymbol global = tb.trace.getSymbolManager().getGlobalNamespace(); + + DBTraceLabelSymbolView labels = tb.trace.getSymbolManager().labels(); + labels.create(0, null, tb.addr(0x55550000), "test_label1", global, SourceType.IMPORTED); + labels.create(0, null, tb.addr(0x55550005), "test_label2", global, + SourceType.USER_DEFINED); + DBTraceNamespaceSymbolView namespaces = tb.trace.getSymbolManager().namespaces(); + DBTraceNamespaceSymbol testNs = namespaces.add("test_ns", global, SourceType.ANALYSIS); + DBTraceNamespaceSymbol testNsChild = + namespaces.add("test_ns_child", testNs, SourceType.USER_DEFINED); + labels.create(0, null, tb.addr(0x55550800), "test_label3", testNsChild, + SourceType.ANALYSIS); + } + + Address paddr = tb.addr(stSpace, 0x00400000); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Copy", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, (byte) 0, TaskMonitor.DUMMY, + false); + AllCopiers.LABELS.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + List symbols = new ArrayList<>(); + program.getSymbolTable().getSymbolIterator(true).forEachRemaining(symbols::add); + + assertEquals(3, symbols.size()); + Symbol sym; + Namespace ns; + + sym = symbols.get(0); + assertEquals("test_label1", sym.getName()); + assertEquals(tb.addr(stSpace, 0x00400000), sym.getAddress()); + assertEquals(SourceType.IMPORTED, sym.getSource()); + assertTrue(sym.isGlobal()); + sym = symbols.get(1); + assertEquals("test_label2", sym.getName()); + assertEquals(tb.addr(stSpace, 0x00400005), sym.getAddress()); + assertEquals(SourceType.USER_DEFINED, sym.getSource()); + assertTrue(sym.isGlobal()); + + sym = symbols.get(2); + assertEquals("test_label3", sym.getName()); + assertEquals(tb.addr(stSpace, 0x00400800), sym.getAddress()); + assertEquals(SourceType.ANALYSIS, sym.getSource()); + assertFalse(sym.isGlobal()); + ns = sym.getParentNamespace(); + assertEquals("test_ns_child", ns.getName()); + assertEquals(SourceType.USER_DEFINED, ns.getSymbol().getSource()); + assertFalse(ns.isGlobal()); + ns = ns.getParentNamespace(); + assertEquals("test_ns", ns.getName()); + assertEquals(SourceType.ANALYSIS, ns.getSymbol().getSource()); + assertFalse(ns.isGlobal()); + ns = ns.getParentNamespace(); + assertTrue(ns.isGlobal()); + } + + @Test + public void testBreakpoints() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.BREAKPOINTS.isAvailable(view, program)); + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + + DBTraceBreakpointManager breakpoints = tb.trace.getBreakpointManager(); + breakpoints.placeBreakpoint("[1]", 0, tb.addr(0x55550123), List.of(), + Set.of(TraceBreakpointKind.SW_EXECUTE), true, "Test-1"); + breakpoints.placeBreakpoint("[2]", 0, tb.addr(0x55550321), List.of(), + Set.of(TraceBreakpointKind.SW_EXECUTE), false, "Test-2"); + } + + Address paddr = tb.addr(stSpace, 0x55550000); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, + (byte) 0, TaskMonitor.DUMMY, false); + // Set up a collision. This is normal with relocations + program.getBookmarkManager() + .setBookmark(tb.addr(stSpace, 0x55550123), "BreakpointDisabled", "SW_EXECUTE;1", + ""); + + AllCopiers.BREAKPOINTS.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + List bookmarks = new ArrayList<>(); + program.getBookmarkManager().getBookmarksIterator().forEachRemaining(bookmarks::add); + + assertEquals(2, bookmarks.size()); + Collections.sort(bookmarks, Comparator.comparing(Bookmark::getAddress)); + Bookmark bm; + + bm = bookmarks.get(0); + assertEquals(tb.addr(stSpace, 0x55550123), bm.getAddress()); + assertEquals("BreakpointEnabled", bm.getTypeString()); + assertEquals("SW_EXECUTE;1", bm.getCategory()); + + bm = bookmarks.get(1); + assertEquals(tb.addr(stSpace, 0x55550321), bm.getAddress()); + assertEquals("BreakpointDisabled", bm.getTypeString()); + assertEquals("SW_EXECUTE;1", bm.getCategory()); + } + + @Test + public void testBookmarks() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.BOOKMARKS.isAvailable(view, program)); + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + + BookmarkManager bookmarks = view.getBookmarkManager(); + bookmarks.defineType("TestType", DebuggerResources.ICON_DEBUGGER, Color.BLUE, 1); + bookmarks.setBookmark(tb.addr(0x55550123), "TestType", "TestCategory", "Test Comment"); + } + + Address paddr = tb.addr(stSpace, 0x55550000); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, + (byte) 0, TaskMonitor.DUMMY, false); + + AllCopiers.BOOKMARKS.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + List bookmarks = new ArrayList<>(); + program.getBookmarkManager().getBookmarksIterator().forEachRemaining(bookmarks::add); + + assertEquals(1, bookmarks.size()); + Bookmark bm; + + bm = bookmarks.get(0); + assertEquals(tb.addr(stSpace, 0x55550123), bm.getAddress()); + BookmarkType type = program.getBookmarkManager().getBookmarkType("TestType"); + assertNotNull(type); + assertEquals(type.getTypeString(), bm.getTypeString()); + assertEquals("TestCategory", bm.getCategory()); + assertEquals("Test Comment", bm.getComment()); + + assertEquals(DebuggerResources.ICON_DEBUGGER, type.getIcon()); + assertEquals(Color.BLUE, type.getMarkerColor()); + assertEquals(1, type.getMarkerPriority()); + } + + @Test + public void testReferences() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.REFERENCES.isAvailable(view, program)); + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + memory.createRegion(".data", 0, tb.range(0x55560000, 0x5556ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.WRITE); + + ReferenceManager references = view.getReferenceManager(); + references.addMemoryReference(tb.addr(0x55550123), + tb.addr(0x55550321), RefType.COMPUTED_CALL, SourceType.USER_DEFINED, -1); + references.addMemoryReference(tb.addr(0x55550123), + tb.addr(0x55560321), RefType.READ, SourceType.USER_DEFINED, -1); + references.addMemoryReference(tb.addr(0x55560123), + tb.addr(0x55550321), RefType.PARAM, SourceType.USER_DEFINED, -1); + references.addMemoryReference(tb.addr(0x55560123), + tb.addr(0x55560321), RefType.DATA, SourceType.USER_DEFINED, -1); + } + + Address paddr = tb.addr(stSpace, 0x55550000); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, + (byte) 0, TaskMonitor.DUMMY, false); + + AllCopiers.REFERENCES.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + List references = new ArrayList<>(); + program.getReferenceManager().getReferenceIterator(paddr).forEachRemaining(references::add); + + assertEquals(1, references.size()); + Reference ref; + + ref = references.get(0); + assertEquals(tb.addr(stSpace, 0x55550123), ref.getFromAddress()); + assertEquals(tb.addr(stSpace, 0x55550321), ref.getToAddress()); + assertEquals(RefType.COMPUTED_CALL, ref.getReferenceType()); + assertEquals(SourceType.USER_DEFINED, ref.getSource()); + assertEquals(-1, ref.getOperandIndex()); + } + + @Test + public void testComments() throws Exception { + createTrace(); + createProgram(getSLEIGH_X86_64_LANGUAGE()); + AddressSpace stSpace = program.getAddressFactory().getDefaultAddressSpace(); + + DBTraceVariableSnapProgramView view = tb.trace.getProgramView(); + assertTrue(AllCopiers.COMMENTS.isAvailable(view, program)); + + try (UndoableTransaction tid = tb.startTransaction()) { + DBTraceMemoryManager memory = tb.trace.getMemoryManager(); + memory.createRegion(".text", 0, tb.range(0x55550000, 0x5555ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + + Listing listing = view.getListing(); + listing.setComment(tb.addr(0x55550123), CodeUnit.EOL_COMMENT, "Test EOL Comment"); + listing.setComment(tb.addr(0x55550321), CodeUnit.PLATE_COMMENT, "Test Plate Comment"); + } + + Address paddr = tb.addr(stSpace, 0x55550000); + try (UndoableTransaction tid = UndoableTransaction.start(program, "Init", true)) { + program.getMemory() + .createInitializedBlock(".text", paddr, 0x10000, + (byte) 0, TaskMonitor.DUMMY, false); + + AllCopiers.COMMENTS.copy(view, tb.range(0x55550000, 0x5555ffff), program, paddr, + TaskMonitor.DUMMY); + } + + Set

addresses = new HashSet<>(); + Listing listing = program.getListing(); + listing.getCommentAddressIterator(program.getMemory(), true) + .forEachRemaining(addresses::add); + + assertEquals(Set.of(tb.addr(stSpace, 0x55550123), tb.addr(stSpace, 0x55550321)), addresses); + assertEquals("Test EOL Comment", + listing.getComment(CodeUnit.EOL_COMMENT, tb.addr(stSpace, 0x55550123))); + assertEquals("Test Plate Comment", + listing.getComment(CodeUnit.PLATE_COMMENT, tb.addr(stSpace, 0x55550321))); + } +} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java index 04fca7415d..ab4e610e18 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java @@ -983,11 +983,11 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI @Test @Ignore("TODO") // Needs attention, but low priority - public void testActionCaptureSelectedMemory() throws Exception { + public void testActionReadSelectedMemory() throws Exception { byte[] data = incBlock(); byte[] zero = new byte[data.length]; ByteBuffer buf = ByteBuffer.allocate(data.length); - assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(listingProvider.actionReadSelectedMemory.isEnabled()); listingProvider.setAutoReadMemorySpec(readNone); // To verify enabled requires live target @@ -1002,12 +1002,12 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI traceManager.activateTrace(tb.trace); waitForSwing(); // Still - assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(listingProvider.actionReadSelectedMemory.isEnabled()); listingProvider.setSelection(sel); waitForSwing(); // Still - assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(listingProvider.actionReadSelectedMemory.isEnabled()); // Now, simulate the sequence that typically enables the action createTestModel(); @@ -1024,12 +1024,12 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI // NOTE: recordTargetContainerAndOpenTrace has already activated the trace // Action is still disabled, because it requires a selection - assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(listingProvider.actionReadSelectedMemory.isEnabled()); listingProvider.setSelection(sel); waitForSwing(); // Now, it should be enabled - assertTrue(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertTrue(listingProvider.actionReadSelectedMemory.isEnabled()); // First check nothing captured yet buf.clear(); @@ -1038,7 +1038,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI assertArrayEquals(zero, buf.array()); // Verify that the action performs the expected task - performAction(listingProvider.actionCaptureSelectedMemory); + performAction(listingProvider.actionReadSelectedMemory); waitForBusyTool(tool); waitForDomainObject(trace); @@ -1053,28 +1053,28 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI // Verify that setting the memory inaccessible disables the action mb.testProcess1.memory.setAccessible(false); - waitForPass(() -> assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled())); + waitForPass(() -> assertFalse(listingProvider.actionReadSelectedMemory.isEnabled())); // Verify that setting it accessible re-enables it (assuming we still have selection) mb.testProcess1.memory.setAccessible(true); - waitForPass(() -> assertTrue(listingProvider.actionCaptureSelectedMemory.isEnabled())); + waitForPass(() -> assertTrue(listingProvider.actionReadSelectedMemory.isEnabled())); // Verify that moving into the past disables the action TraceSnapshot forced = recorder.forceSnapshot(); waitForSwing(); // UI Wants to sync with new snap. Wait.... traceManager.activateSnap(forced.getKey() - 1); waitForSwing(); - assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(listingProvider.actionReadSelectedMemory.isEnabled()); // Verify that advancing to the present enables the action (assuming a selection) traceManager.activateSnap(forced.getKey()); waitForSwing(); - assertTrue(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertTrue(listingProvider.actionReadSelectedMemory.isEnabled()); // Verify that stopping the recording disables the action recorder.stopRecording(); waitForSwing(); - assertFalse(listingProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(listingProvider.actionReadSelectedMemory.isEnabled()); // TODO: When resume recording is implemented, verify action is enabled with selection } diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java index 1078c1b838..d41dfb4a59 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProviderTest.java @@ -741,11 +741,11 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge @Test @Ignore("TODO") // Needs attention, but low priority // Accessibility listener does not seem to work - public void testActionCaptureSelectedMemory() throws Exception { + public void testActionReadSelectedMemory() throws Exception { byte[] data = incBlock(); byte[] zero = new byte[data.length]; ByteBuffer buf = ByteBuffer.allocate(data.length); - assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled()); memBytesProvider.setAutoReadMemorySpec(readNone); // To verify enabled requires live target @@ -760,12 +760,12 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge traceManager.activateTrace(tb.trace); waitForSwing(); // Still - assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled()); memBytesProvider.setSelection(sel); waitForSwing(); // Still - assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled()); // Now, simulate the sequence that typically enables the action createTestModel(); @@ -782,21 +782,21 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge // NOTE: recordTargetContainerAndOpenTrace has already activated the trace // Action is still disabled, because it requires a selection - assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled()); memBytesProvider.setSelection(sel); waitForSwing(); // Now, it should be enabled - assertTrue(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertTrue(memBytesProvider.actionReadSelectedMemory.isEnabled()); - // First check nothing captured yet + // First check nothing recorded yet buf.clear(); assertEquals(data.length, trace.getMemoryManager().getBytes(recorder.getSnap(), addr(trace, 0x55550000), buf)); assertArrayEquals(zero, buf.array()); // Verify that the action performs the expected task - performAction(memBytesProvider.actionCaptureSelectedMemory); + performAction(memBytesProvider.actionReadSelectedMemory); waitForBusyTool(tool); waitForDomainObject(trace); @@ -811,28 +811,28 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge // Verify that setting the memory inaccessible disables the action mb.testProcess1.memory.setAccessible(false); - waitForPass(() -> assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled())); + waitForPass(() -> assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled())); // Verify that setting it accessible re-enables it (assuming we still have selection) mb.testProcess1.memory.setAccessible(true); - waitForPass(() -> assertTrue(memBytesProvider.actionCaptureSelectedMemory.isEnabled())); + waitForPass(() -> assertTrue(memBytesProvider.actionReadSelectedMemory.isEnabled())); // Verify that moving into the past disables the action TraceSnapshot forced = recorder.forceSnapshot(); waitForSwing(); // UI Wants to sync with new snap. Wait.... traceManager.activateSnap(forced.getKey() - 1); waitForSwing(); - assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled()); // Verify that advancing to the present enables the action (assuming a selection) traceManager.activateSnap(forced.getKey()); waitForSwing(); - assertTrue(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertTrue(memBytesProvider.actionReadSelectedMemory.isEnabled()); // Verify that stopping the recording disables the action recorder.stopRecording(); waitForSwing(); - assertFalse(memBytesProvider.actionCaptureSelectedMemory.isEnabled()); + assertFalse(memBytesProvider.actionReadSelectedMemory.isEnabled()); // TODO: When resume recording is implemented, verify action is enabled with selection } diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServiceTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServiceTest.java index f42ff513f8..3434ff071a 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServiceTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/modules/DebuggerStaticMappingServiceTest.java @@ -27,7 +27,7 @@ import com.google.common.collect.Range; import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest; import ghidra.app.services.DebuggerStaticMappingService; -import ghidra.app.services.DebuggerStaticMappingService.ShiftAndAddressSetView; +import ghidra.app.services.DebuggerStaticMappingService.MappedAddressRange; import ghidra.framework.model.DomainFile; import ghidra.program.model.address.*; import ghidra.program.model.listing.Program; @@ -339,7 +339,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg public void testAddMappingThenTranslateTraceViewToStaticEmpty() throws Exception { addMapping(); - Map views = + Map> views = mappingService.getOpenMappedViews(tb.trace, new AddressSet(), 0); assertTrue(views.isEmpty()); } @@ -360,18 +360,19 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg // After set.add(dynSpace.getAddress(0xbadbadbadL), dynSpace.getAddress(0xbadbadbadL + 0xff)); - Map views = + Map> views = mappingService.getOpenMappedViews(tb.trace, set, 0); assertEquals(1, views.size()); - ShiftAndAddressSetView shifted = views.get(program); - assertEquals(0x100000, shifted.getShift()); - AddressSetView inStatic = shifted.getAddressSetView(); - assertEquals(3, inStatic.getNumAddressRanges()); - AddressSet expected = new AddressSet(); - expected.add(stSpace.getAddress(0x00200000), stSpace.getAddress(0x002000ff)); - expected.add(stSpace.getAddress(0x00200c0d), stSpace.getAddress(0x00200ccc)); - expected.add(stSpace.getAddress(0x00201000 - 0x100), stSpace.getAddress(0x00200fff)); - assertEquals(expected, inStatic); + Collection mappedSet = views.get(program); + + assertEquals(Set.of( + new MappedAddressRange(tb.range(0x00100000, 0x001000ff), + tb.range(stSpace, 0x00200000, 0x002000ff)), + new MappedAddressRange(tb.range(0x00100c0d, 0x00100ccc), + tb.range(stSpace, 0x00200c0d, 0x00200ccc)), + new MappedAddressRange(tb.range(0x00100f00, 0x00100fff), + tb.range(stSpace, 0x00200f00, 0x00200fff))), + mappedSet); } @Test @@ -380,7 +381,7 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg copyTrace(); add2ndMapping(); - Map views = + Map> views = mappingService.getOpenMappedViews(program, new AddressSet()); assertTrue(views.isEmpty()); } @@ -403,30 +404,34 @@ public class DebuggerStaticMappingServiceTest extends AbstractGhidraHeadedDebugg // After set.add(stSpace.getAddress(0xbadbadbadL), stSpace.getAddress(0xbadbadbadL + 0xff)); - Map views = + Map> views = mappingService.getOpenMappedViews(program, set); Msg.info(this, views); assertEquals(2, views.size()); - ShiftAndAddressSetView shifted1 = views.get(new DefaultTraceSnap(tb.trace, 0)); - assertEquals(-0x100000, shifted1.getShift()); - AddressSetView in1st = shifted1.getAddressSetView(); - assertEquals(5, in1st.getNumAddressRanges()); - AddressSetView in2nd = views.get(new DefaultTraceSnap(copy, 0)).getAddressSetView(); - assertEquals(3, in2nd.getNumAddressRanges()); + Collection mappedSet1 = views.get(new DefaultTraceSnap(tb.trace, 0)); + Collection mappedSet2 = views.get(new DefaultTraceSnap(copy, 0)); - AddressSet expectedIn1st = new AddressSet(); - AddressSet expectedIn2nd = new AddressSet(); - expectedIn1st.add(dynSpace.getAddress(0x00100000), dynSpace.getAddress(0x001000ff)); - expectedIn1st.add(dynSpace.getAddress(0x00100800 - 0x10), - dynSpace.getAddress(0x00100800 + 0xf)); - expectedIn1st.add(dynSpace.getAddress(0x00101000 - 0x100), dynSpace.getAddress(0x00100fff)); - expectedIn2nd.add(expectedIn1st); + assertEquals(Set.of( + new MappedAddressRange(tb.range(stSpace, 0x00200000, 0x002000ff), + tb.range(0x00100000, 0x001000ff)), + new MappedAddressRange(tb.range(stSpace, 0x002007f0, 0x0020080f), + tb.range(0x001007f0, 0x0010080f)), + new MappedAddressRange(tb.range(stSpace, 0x00200f00, 0x00200fff), + tb.range(0x00100f00, 0x00100fff)), + new MappedAddressRange(tb.range(stSpace, 0x00200000, 0x002000ff), + tb.range(0x00102000, 0x001020ff)), + new MappedAddressRange(tb.range(stSpace, 0x002007f0, 0x002007ff), + tb.range(0x001027f0, 0x001027ff))), + mappedSet1); - expectedIn1st.add(dynSpace.getAddress(0x00102000), dynSpace.getAddress(0x001020ff)); - expectedIn1st.add(dynSpace.getAddress(0x00102800 - 0x10), dynSpace.getAddress(0x001027ff)); - - assertEquals(expectedIn1st, in1st); - assertEquals(expectedIn2nd, in2nd); + assertEquals(Set.of( + new MappedAddressRange(tb.range(stSpace, 0x00200000, 0x002000ff), + tb.range(0x00100000, 0x001000ff)), + new MappedAddressRange(tb.range(stSpace, 0x002007f0, 0x0020080f), + tb.range(0x001007f0, 0x0010080f)), + new MappedAddressRange(tb.range(stSpace, 0x00200f00, 0x00200fff), + tb.range(0x00100f00, 0x00100fff))), + mappedSet2); } @Test diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/data/DBTraceDataTypeManager.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/data/DBTraceDataTypeManager.java index c2e8c9ef56..5d5ab618d9 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/data/DBTraceDataTypeManager.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/data/DBTraceDataTypeManager.java @@ -220,9 +220,7 @@ public class DBTraceDataTypeManager extends DataTypeManagerDB @Override public DataOrganization getDataOrganization() { if (dataOrganization == null) { - // TODO: Do I need to have a base compiler spec? - dataOrganization = - trace.getBaseLanguage().getDefaultCompilerSpec().getDataOrganization(); + dataOrganization = trace.getBaseCompilerSpec().getDataOrganization(); } return dataOrganization; } diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstruction.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstruction.java index 6812ecf3a5..83f32ce23e 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstruction.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstruction.java @@ -30,6 +30,7 @@ import ghidra.program.model.mem.MemBuffer; import ghidra.program.model.mem.MemoryAccessException; import ghidra.program.model.symbol.*; import ghidra.trace.database.DBTraceUtils; +import ghidra.trace.database.context.DBTraceRegisterContextManager; import ghidra.trace.database.context.DBTraceRegisterContextSpace; import ghidra.trace.database.language.DBTraceGuestLanguage; import ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapTree; @@ -621,13 +622,12 @@ public class DBTraceInstruction extends AbstractDBTraceCodeUnit lifespan, Address min, Address max, - ProcessorContextView context) { - Language language = space.baseLanguage; - Register contextReg = language.getContextBaseRegister(); - if (contextReg == null) { - return; - } - RegisterValue newValue = context.getRegisterValue(contextReg); - DBTraceRegisterContextManager ctxMgr = space.trace.getRegisterContextManager(); - if (Objects.equals(ctxMgr.getDefaultValue(language, contextReg, min), newValue)) { - DBTraceRegisterContextSpace ctxSpace = ctxMgr.get(space, false); - if (ctxSpace == null) { - return; - } - ctxSpace.setValue(language, null, lifespan, new AddressRangeImpl(min, max)); - return; - } - DBTraceRegisterContextSpace ctxSpace = ctxMgr.get(space, true); - // TODO: Do not save non-flowing context beyond??? - ctxSpace.setValue(language, newValue, lifespan, new AddressRangeImpl(min, max)); - } - protected Instruction doCreateInstruction(Range lifespan, Address address, InstructionPrototype prototype, Instruction protoInstr) { try { - doSetContexts(lifespan, address, address.addNoWrap(prototype.getLength() - 1), - protoInstr); - Instruction created = doCreate(lifespan, address, prototype, protoInstr); // copy override settings to replacement instruction if (protoInstr.isFallThroughOverridden()) { @@ -183,6 +159,27 @@ public class DBTraceInstructionsView extends AbstractBaseDBTraceDefinedUnitsView super(space, space.instructionMapSpace); } + protected void doSetContexts(TraceAddressSnapRange tasr, Language language, + ProcessorContextView context) { + Register contextReg = language.getContextBaseRegister(); + if (contextReg == null || contextReg == Register.NO_CONTEXT) { + return; + } + RegisterValue newValue = context.getRegisterValue(contextReg); + DBTraceRegisterContextManager ctxMgr = space.trace.getRegisterContextManager(); + if (Objects.equals(ctxMgr.getDefaultValue(language, contextReg, tasr.getX1()), newValue)) { + DBTraceRegisterContextSpace ctxSpace = ctxMgr.get(space, false); + if (ctxSpace == null) { + return; + } + ctxSpace.setValue(language, null, tasr.getLifespan(), tasr.getRange()); + return; + } + DBTraceRegisterContextSpace ctxSpace = ctxMgr.get(space, true); + // TODO: Do not save non-flowing context beyond??? + ctxSpace.setValue(language, newValue, tasr.getLifespan(), tasr.getRange()); + } + protected DBTraceInstruction doCreate(Range lifespan, Address address, InstructionPrototype prototype, ProcessorContextView context) throws CodeUnitInsertionException, AddressOverflowException { @@ -214,6 +211,8 @@ public class DBTraceInstructionsView extends AbstractBaseDBTraceDefinedUnitsView throw new CodeUnitInsertionException("Code units cannot overlap"); } + doSetContexts(tasr, prototype.getLanguage(), context); + DBTraceInstruction created = space.instructionMapSpace.put(tasr, null); created.set(prototype, context); diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewListing.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewListing.java index fe45f80d9f..92de69852e 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewListing.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewListing.java @@ -415,25 +415,33 @@ public abstract class AbstractDBTraceProgramViewListing implements TraceProgramV forward))); } + protected AddressSetView getCommentAddresses(int commentType, AddressSetView addrSet) { + return new IntersectionAddressSetView(addrSet, program.viewport.unionedAddresses( + s -> program.trace.getCommentAdapter() + .getAddressSetView(Range.singleton(s), e -> e.getType() == commentType))); + } + + protected AddressSetView getCommentAddresses(AddressSetView addrSet) { + return new IntersectionAddressSetView(addrSet, program.viewport.unionedAddresses( + s -> program.trace.getCommentAdapter() + .getAddressSetView(Range.singleton(s)))); + } + @Override public CodeUnitIterator getCommentCodeUnitIterator(int commentType, AddressSetView addrSet) { - // TODO Auto-generated method stub - return null; + return new WrappingCodeUnitIterator( + getCodeUnitIterator(getCommentAddresses(commentType, addrSet), true)); } @Override public AddressIterator getCommentAddressIterator(int commentType, AddressSetView addrSet, boolean forward) { - return new IntersectionAddressSetView(addrSet, program.viewport.unionedAddresses( - s -> program.trace.getCommentAdapter() - .getAddressSetView(Range.singleton(s), e -> e.getType() == commentType))) - .getAddresses(forward); + return getCommentAddresses(commentType, addrSet).getAddresses(forward); } @Override public AddressIterator getCommentAddressIterator(AddressSetView addrSet, boolean forward) { - // TODO Auto-generated method stub - return null; + return getCommentAddresses(addrSet).getAddresses(forward); } @Override diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewReferenceManager.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewReferenceManager.java index 9e55f25e49..583420507f 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewReferenceManager.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/program/AbstractDBTraceProgramViewReferenceManager.java @@ -25,6 +25,7 @@ import javax.help.UnsupportedOperationException; import com.google.common.collect.Range; +import generic.NestedIterator; import ghidra.program.model.address.*; import ghidra.program.model.lang.Register; import ghidra.program.model.listing.Variable; @@ -231,13 +232,22 @@ public abstract class AbstractDBTraceProgramViewReferenceManager implements Refe : (r1, r2) -> -r1.getFromAddress().compareTo(r2.getFromAddress()); } + protected Iterator getReferenceIteratorForSnap(long snap, Address startAddr) { + AddressIterator addresses = + refs.getReferenceSources(Range.singleton(snap)).getAddresses(startAddr, true); + return NestedIterator.start(addresses, a -> { + return refs.getReferencesFrom(snap, a).iterator(); + }); + } + @Override public ReferenceIterator getReferenceIterator(Address startAddr) { if (refs(false) == null) { return new ReferenceIteratorAdapter(Collections.emptyIterator()); } + // TODO: This will fail to occlude on equal (src,dst,opIndex) keys return new ReferenceIteratorAdapter( - program.viewport.mergedIterator(s -> refs.getReferencesFrom(s, startAddr).iterator(), + program.viewport.mergedIterator(s -> getReferenceIteratorForSnap(s, startAddr), getReferenceFromComparator(true))); } diff --git a/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java b/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java index 0079f96350..6658797d2a 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java @@ -49,8 +49,7 @@ import ghidra.trace.database.memory.DBTraceMemoryManager; import ghidra.trace.database.symbol.DBTraceReference; import ghidra.trace.database.thread.DBTraceThread; import ghidra.trace.database.thread.DBTraceThreadManager; -import ghidra.trace.model.ImmutableTraceAddressSnapRange; -import ghidra.trace.model.TraceAddressSnapRange; +import ghidra.trace.model.*; import ghidra.trace.model.language.TraceGuestLanguage; import ghidra.util.Msg; import ghidra.util.database.DBOpenMode; @@ -76,6 +75,12 @@ public class ToyDBTraceBuilder implements AutoCloseable { this.trace = new DBTrace(name, language.getDefaultCompilerSpec(), this); } + public ToyDBTraceBuilder(Trace trace) { + this.language = trace.getBaseLanguage(); + this.trace = (DBTrace) trace; + trace.addConsumer(this); + } + public Address addr(AddressSpace space, long offset) { return space.getAddress(offset); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/ProgramMergeManagerPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/ProgramMergeManagerPlugin.java index 73b89bac4d..f130ba0db2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/ProgramMergeManagerPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/ProgramMergeManagerPlugin.java @@ -50,6 +50,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro /** * Constructor for plugin that handles multi-user merge of programs. + * * @param tool the tool with the active program to be merged * @param mergeManager the merge manager that will control the merge process * @param program the current program @@ -61,7 +62,8 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro @Override public MergeManagerProvider createProvider() { - return new MergeManagerProvider(this, "Merge Programs for " + currentDomainObject.getName()); + return new MergeManagerProvider(this, + "Merge Programs for " + currentDomainObject.getName()); } @Override @@ -82,6 +84,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro /** * Gets the merge manager associated with this plug-in. + * * @return the merge manager */ @Override @@ -91,6 +94,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro /** * Defines and displays a component for resolving merge conflicts. + * * @param component the component * @param componentID the identifier for this component */ @@ -101,6 +105,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro /** * Sets the merge description at the top of the merge tool. + * * @param mergeDescription the new description */ @Override @@ -110,7 +115,9 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro /** * Sets the message below the progress meter in the current phase progress area. - * @param progressDescription the new text message to display. If null, then the default message is displayed. + * + * @param progressDescription the new text message to display. If null, then the default message + * is displayed. */ @Override void updateProgressDetails(String progressDescription) { @@ -118,7 +125,9 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro } /** - * Sets the percentage of the progress meter that is filled in for the current phase progress area. + * Sets the percentage of the progress meter that is filled in for the current phase progress + * area. + * * @param currentPercentProgress the percentage of the progress bar to fill in from 0 to 100. */ @Override @@ -135,8 +144,9 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro } /** - * Enables/disables the Apply button at the bottom of the merge tool. - * The Apply button is for applying conflicts. + * Enables/disables the Apply button at the bottom of the merge tool. The Apply button is for + * applying conflicts. + * * @param state true means enable the button. false means disable it. */ @Override @@ -146,6 +156,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro /** * Gets the provider for the merge. + * * @return the provider */ @Override @@ -153,22 +164,27 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro return provider; } + @Override public boolean closeOtherPrograms(boolean ignoreChanges) { return false; } + @Override public boolean closeAllPrograms(boolean ignoreChanges) { return false; } + @Override public boolean closeProgram() { return false; } + @Override public boolean closeProgram(Program program, boolean ignoreChanges) { return false; } + @Override public Program[] getAllOpenPrograms() { ProgramMultiUserMergeManager programMergeManager = (ProgramMultiUserMergeManager) mergeManager; @@ -178,10 +194,12 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro programMergeManager.getProgram(MergeConstants.ORIGINAL) }; } + @Override public Program getCurrentProgram() { return (Program) currentDomainObject; } + @Override public Program getProgram(Address addr) { return null; } @@ -190,6 +208,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro return 0; } + @Override public boolean isVisible(Program program) { return false; } @@ -199,6 +218,7 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro return null; } + @Override public Program openProgram(DomainFile domainFile) { return null; } @@ -208,29 +228,53 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro return null; } + @Override public Program openProgram(DomainFile df, int version) { return null; } + @Override public Program openProgram(DomainFile domainFile, int version, int state) { return null; } + @Override public void openProgram(Program program) { } + @Override public void openProgram(Program program, boolean current) { } + @Override public void openProgram(Program program, int state) { } + @Override public void releaseProgram(Program program, Object persistentOwner) { } + @Override + public void saveProgram() { + } + + @Override + public void saveProgram(Program program) { + } + + @Override + public void saveProgramAs() { + } + + @Override + public void saveProgramAs(Program program) { + } + + @Override public void setCurrentProgram(Program p) { } + @Override public boolean setPersistentOwner(Program program, Object owner) { return false; } @@ -238,10 +282,12 @@ public class ProgramMergeManagerPlugin extends MergeManagerPlugin implements Pro public void setSearchPriority(Program p, int priority) { } + @Override public boolean isLocked() { return false; } + @Override public void lockDown(boolean state) { } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/ProgramManagerPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/ProgramManagerPlugin.java index 81b78ea51b..53a4e79bf3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/ProgramManagerPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/ProgramManagerPlugin.java @@ -102,8 +102,7 @@ public class ProgramManagerPlugin extends Plugin implements ProgramManager { /** * Method called if the plugin supports this domain file. * - * @param data - * the data to be used by the running tool + * @param data the data to be used by the running tool * @return false if data is not a Program object. */ @Override @@ -447,9 +446,9 @@ public class ProgramManagerPlugin extends Plugin implements ProgramManager { } /** - * This method notifies listening plugins that a programs has been added to - * the program manager. This is not used for actually opening a program from - * the database and will act strangely if given a closed Program object. + * This method notifies listening plugins that a programs has been added to the program manager. + * This is not used for actually opening a program from the database and will act strangely if + * given a closed Program object. * * @see ghidra.app.services.ProgramManager#openProgram(ghidra.program.model.listing.Program) */ @@ -585,7 +584,7 @@ public class ProgramManagerPlugin extends Plugin implements ProgramManager { /** * Set the string chooser property editor on the property that is a filename. * - * @param options property list + * @param options property list * @param filePropertyName name of the property that is a filename */ private void setPropertyEditor(Options options, String filePropertyName) { @@ -597,8 +596,8 @@ public class ProgramManagerPlugin extends Plugin implements ProgramManager { } /** - * Start a transaction if one has not been started; needed when program - * properties are about to change from the options editor. + * Start a transaction if one has not been started; needed when program properties are about to + * change from the options editor. */ private void startTransaction(Program currentProgram) { if (transactionID < 0) { @@ -685,6 +684,26 @@ public class ProgramManagerPlugin extends Plugin implements ProgramManager { return openProgram; } + @Override + public void saveProgram() { + saveProgram(getCurrentProgram()); + } + + @Override + public void saveProgram(Program program) { + Swing.runIfSwingOrRunLater(() -> programSaveMgr.saveProgram(program)); + } + + @Override + public void saveProgramAs() { + saveProgramAs(getCurrentProgram()); + } + + @Override + public void saveProgramAs(Program program) { + Swing.runIfSwingOrRunLater(() -> programSaveMgr.saveAs(program)); + } + /** * Write out my data state. */ @@ -1040,13 +1059,4 @@ public class ProgramManagerPlugin extends Plugin implements ProgramManager { public boolean isManaged(Program program) { return programMgr.contains(program); } - - public void saveProgram(Program program) { - programSaveMgr.saveProgram(program); - } - - public void saveProgramAs(Program program) { - programSaveMgr.saveAs(program); - } - } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/services/ProgramManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/services/ProgramManager.java index c7dea6e54e..1191106483 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/services/ProgramManager.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/services/ProgramManager.java @@ -26,16 +26,17 @@ import ghidra.program.model.address.Address; import ghidra.program.model.listing.Program; /** - * Service for managing programs. Multiple programs may be open in a tool, but only one is active - * at any given time. + * Service for managing programs. Multiple programs may be open in a tool, but only one is active at + * any given time. */ -@ServiceInfo(defaultProvider = ProgramManagerPlugin.class, description = "Get the currently open program") +@ServiceInfo( + defaultProvider = ProgramManagerPlugin.class, + description = "Get the currently open program") public interface ProgramManager { /** - * Program will be open in a Hidden state if not already open. - * This mode is generally used in conjunction with a persistent - * program owner. + * Program will be open in a Hidden state if not already open. This mode is generally used in + * conjunction with a persistent program owner. */ public static final int OPEN_HIDDEN = 0; @@ -45,20 +46,21 @@ public interface ProgramManager { public static final int OPEN_CURRENT = 1; /** - * Program will be open within the tool but no change will be made - * to the currently active program. If this is the only program - * open, it will become the currently active program. + * Program will be open within the tool but no change will be made to the currently active + * program. If this is the only program open, it will become the currently active program. */ public static final int OPEN_VISIBLE = 2; /** * Return the program that is currently active. + * * @return may return null if no program is open */ public Program getCurrentProgram(); /** * Returns true if the specified program is open and considered visible to the user. + * * @param program the program * @return true if the specified program is open and considered visible to the user */ @@ -66,47 +68,51 @@ public interface ProgramManager { /** * Closes the currently active program - * @return true if the close is successful. - * false if the close fails or if there is no program currently active. + * + * @return true if the close is successful. false if the close fails or if there is no program + * currently active. */ public boolean closeProgram(); /** - * Open the program corresponding to the given url. + * Open the program corresponding to the given url. + * * @param ghidraURL valid server-based program URL - * @param state initial open state (OPEN_HIDDEN, OPEN_CURRENT, OPEN_VISIBLE). - * The visibility states will be ignored if the program is already open. - * @return null if the user canceled the "open" for the new program or an error - * occurred and was displayed. + * @param state initial open state (OPEN_HIDDEN, OPEN_CURRENT, OPEN_VISIBLE). The visibility + * states will be ignored if the program is already open. + * @return null if the user canceled the "open" for the new program or an error occurred and was + * displayed. * @see GhidraURL */ public Program openProgram(URL ghidraURL, int state); /** - * Open the program for the given domainFile. Once open it will - * become the active program. + * Open the program for the given domainFile. Once open it will become the active program. + * * @param domainFile domain file that has the program * @return null if the user canceled the "open" for the new program */ public Program openProgram(DomainFile domainFile); /** - * Open the program for the given domainFile. Once open it will become the active program. + * Open the program for the given domainFile. Once open it will become the active program. * - *

Note: this method functions exactly as {@link #openProgram(DomainFile)} + *

+ * Note: this method functions exactly as {@link #openProgram(DomainFile)} * * @param domainFile domain file that has the program * @param dialogParent unused * @return the program - * @deprecated deprecated for 10.1; removal for 10.3 or later; use {@link #openProgram(DomainFile)} + * @deprecated deprecated for 10.1; removal for 10.3 or later; use + * {@link #openProgram(DomainFile)} */ @Deprecated public Program openProgram(DomainFile domainFile, Component dialogParent); /** - * Opens the specified version of the program represented by the given DomainFile. This - * method should be used for shared DomainFiles. The newly opened file will be made the - * active program. + * Opens the specified version of the program represented by the given DomainFile. This method + * should be used for shared DomainFiles. The newly opened file will be made the active program. + * * @param df the DomainFile to open * @param version the version of the Program to open * @return the opened program or null if the given version does not exist. @@ -115,29 +121,32 @@ public interface ProgramManager { /** * Open the program for the given domainFile + * * @param domainFile domain file that has the program - * @param version the version of the Program to open. Specify - * DomainFile.DEFAULT_VERSION for file update mode. - * @param state initial open state (OPEN_HIDDEN, OPEN_CURRENT, OPEN_VISIBLE). - * The visibility states will be ignored if the program is already open. - * @return null if the user canceled the "open" for the new program or an error - * occurred and was displayed. + * @param version the version of the Program to open. Specify DomainFile.DEFAULT_VERSION for + * file update mode. + * @param state initial open state (OPEN_HIDDEN, OPEN_CURRENT, OPEN_VISIBLE). The visibility + * states will be ignored if the program is already open. + * @return null if the user canceled the "open" for the new program or an error occurred and was + * displayed. */ public Program openProgram(DomainFile domainFile, int version, int state); /** - * Opens the program to the tool. In this case the program is already open, but this tool - * may not have it registered as open. The program is made the active program. + * Opens the program to the tool. In this case the program is already open, but this tool may + * not have it registered as open. The program is made the active program. + * * @param program the program to register as open with the tool. */ public void openProgram(Program program); /** - * Opens the program to the tool. In this case the program is already open, but this tool - * may not have it registered as open. The program is made the active program. + * Opens the program to the tool. In this case the program is already open, but this tool may + * not have it registered as open. The program is made the active program. + * * @param program the program to register as open with the tool. - * @param current if true, the program is made the current active program. If false, then - * the program is made active only if it the first open program in the tool. + * @param current if true, the program is made the current active program. If false, then the + * program is made active only if it the first open program in the tool. * @deprecated use openProgram(Program program, int state) instead. */ @Deprecated @@ -145,19 +154,45 @@ public interface ProgramManager { /** * Open the specified program in the tool. + * * @param program the program - * @param state initial open state (OPEN_HIDDEN, OPEN_CURRENT, OPEN_VISIBLE). - * The visibility states will be ignored if the program is already open. + * @param state initial open state (OPEN_HIDDEN, OPEN_CURRENT, OPEN_VISIBLE). The visibility + * states will be ignored if the program is already open. */ public void openProgram(Program program, int state); /** - * Establish a persistent owner on an open program. This will cause the program manager to - * imply make a program hidden if it is closed. + * Saves the current program, possibly prompting the user for a new name. + */ + public void saveProgram(); + + /** + * Saves the specified program, possibly prompting the user for a new name. + * + * @param program the program + */ + public void saveProgram(Program program); + + /** + * Prompts the user to save the current program to a selected file. + */ + public void saveProgramAs(); + + /** + * Prompts the user to save the specified program to a selected file. + * + * @param program the program + */ + public void saveProgramAs(Program program); + + /** + * Establish a persistent owner on an open program. This will cause the program manager to imply + * make a program hidden if it is closed. + * * @param program the program * @param owner the owner - * @return true if program is open and another object is not already the owner, - * or the specified owner is already the owner. + * @return true if program is open and another object is not already the owner, or the specified + * owner is already the owner. * @see #releaseProgram(Program, Object) */ public boolean setPersistentOwner(Program program, Object owner); @@ -165,62 +200,67 @@ public interface ProgramManager { /** * Release the persistent ownership of a program. *

- * The program will automatically be closed if it is hidden or was marked as temporary. If - * any of these closures corresponds to a program with changes the user will be given an - * opportunity to save or keep the program open. + * The program will automatically be closed if it is hidden or was marked as temporary. If any + * of these closures corresponds to a program with changes the user will be given an opportunity + * to save or keep the program open. *

* If persistentOwner is not the correct owner, the method will have no affect. + * * @param program the program * @param persistentOwner the owner defined by {@link #setPersistentOwner(Program, Object)} */ public void releaseProgram(Program program, Object persistentOwner); /** - * Closes the given program with the option of saving any changes. The exact behavior of - * this method depends on several factors. First of all, if any other tool has this program - * open, then the program is closed for this tool only and the user is not prompted to - * save the program regardless of the ignoreChanges flag. Otherwise, if ignoreChanges is - * false and changes have been made, the user is prompted to save the program. + * Closes the given program with the option of saving any changes. The exact behavior of this + * method depends on several factors. First of all, if any other tool has this program open, + * then the program is closed for this tool only and the user is not prompted to save the + * program regardless of the ignoreChanges flag. Otherwise, if ignoreChanges is false and + * changes have been made, the user is prompted to save the program. + * * @param program the program to close. * @param ignoreChanges if true, the program is closed without saving any changes. - * @return true if the program was closed. Returns false if the user canceled the close - * while being prompted to save. Also returns false if the program passed in as a parameter - * is null. + * @return true if the program was closed. Returns false if the user canceled the close while + * being prompted to save. Also returns false if the program passed in as a parameter is + * null. */ boolean closeProgram(Program program, boolean ignoreChanges); /** - * Closes all open programs in this tool except the current program. - * If this tool is the only tool with a program open and that program has changes, - * then the user will be prompted to close each such file. - * (Providing the ignoreChanges flag is false) + * Closes all open programs in this tool except the current program. If this tool is the only + * tool with a program open and that program has changes, then the user will be prompted to + * close each such file. (Providing the ignoreChanges flag is false) + * * @param ignoreChanges if true, the programs will be closed without saving changes. * @return true if all other programs were closed. Returns false if the user canceled the close - * while being prompted to save. + * while being prompted to save. */ public boolean closeOtherPrograms(boolean ignoreChanges); /** - * Closes all open programs in this tool. If this tool is the only tool with a program - * open and that program has changes, then the user will be prompted to close each such file. - * (Providing the ignoreChanges flag is false) + * Closes all open programs in this tool. If this tool is the only tool with a program open and + * that program has changes, then the user will be prompted to close each such file. (Providing + * the ignoreChanges flag is false) + * * @param ignoreChanges if true, the programs will be closed without saving changes. - * @return true if all programs were closed. Returns false if the user canceled the close - * while being prompted to save. + * @return true if all programs were closed. Returns false if the user canceled the close while + * being prompted to save. */ public boolean closeAllPrograms(boolean ignoreChanges); /** * Sets the given program to be the current active program in the tool. + * * @param p the program to make active. */ public void setCurrentProgram(Program p); /** * Returns the first program in the list of open programs that contains the given address. - * Programs are searched in the order they were opened within a given priority. - * Program are initially opened with the PRIORITY_NORMAL priority, but can be set to have - * PRIORITY_HIGH or PRIORITY_LOW. + * Programs are searched in the order they were opened within a given priority. Program are + * initially opened with the PRIORITY_NORMAL priority, but can be set to have PRIORITY_HIGH or + * PRIORITY_LOW. + * * @param addr the address for which to search. * @return the first program that can be found to contain the given address. */ @@ -228,13 +268,15 @@ public interface ProgramManager { /** * Returns a list of all open program. + * * @return the programs */ public Program[] getAllOpenPrograms(); /** - * Allows program manager state to be locked/unlocked. While locked, the program manager will + * Allows program manager state to be locked/unlocked. While locked, the program manager will * not support opening additional programs. + * * @param state locked if true, unlocked if false * @deprecated deprecated for 10.1; removal for 10.3 or later */ @@ -243,6 +285,7 @@ public interface ProgramManager { /** * Returns true if program manager is in the locked state + * * @return true if program manager is in the locked state * @deprecated deprecated for 10.1; removal for 10.3 or later */ diff --git a/Ghidra/Features/Base/src/test/java/ghidra/app/services/TestDummyProgramManager.java b/Ghidra/Features/Base/src/test/java/ghidra/app/services/TestDummyProgramManager.java index 22c31fe08f..798502615a 100644 --- a/Ghidra/Features/Base/src/test/java/ghidra/app/services/TestDummyProgramManager.java +++ b/Ghidra/Features/Base/src/test/java/ghidra/app/services/TestDummyProgramManager.java @@ -23,8 +23,8 @@ import ghidra.program.model.address.Address; import ghidra.program.model.listing.Program; /** - * A stub of the {@link ProgramManager} interface. This can be used to supply a test program - * manager or to spy on system internals by overriding methods as needed. + * A stub of the {@link ProgramManager} interface. This can be used to supply a test program manager + * or to spy on system internals by overriding methods as needed. */ public class TestDummyProgramManager implements ProgramManager { @@ -91,6 +91,26 @@ public class TestDummyProgramManager implements ProgramManager { // stub } + @Override + public void saveProgram() { + // stub + } + + @Override + public void saveProgram(Program program) { + // stub + } + + @Override + public void saveProgramAs() { + // stub + } + + @Override + public void saveProgramAs(Program program) { + // stub + } + @Override public boolean setPersistentOwner(Program program, Object owner) { // stub diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffProgramManager.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffProgramManager.java index 49221b6816..4c73890b22 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffProgramManager.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffProgramManager.java @@ -24,8 +24,8 @@ import ghidra.program.model.address.Address; import ghidra.program.model.listing.Program; /** - * A stubbed {@link ProgramManager} that used the 'second program' at the current program. This - * is used to secondary views in order to install the right program. + * A stubbed {@link ProgramManager} that used the 'second program' at the current program. This is + * used to secondary views in order to install the right program. */ public class DiffProgramManager implements ProgramManager { ProgramDiffPlugin programDiffPlugin; @@ -119,6 +119,26 @@ public class DiffProgramManager implements ProgramManager { // stub } + @Override + public void saveProgram() { + // stub + } + + @Override + public void saveProgram(Program program) { + // stub + } + + @Override + public void saveProgramAs() { + // stub + } + + @Override + public void saveProgramAs(Program program) { + // stub + } + @Override public void setCurrentProgram(Program p) { // stub diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/SleighAssembler.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/SleighAssembler.java index c2b2c32487..ac4cb0c714 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/SleighAssembler.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/SleighAssembler.java @@ -49,7 +49,6 @@ public class SleighAssembler implements Assembler { protected Program program; protected Listing listing; protected Memory memory; - protected Disassembler dis; protected AssemblyParser parser; protected AssemblyDefaultContext defaultContext; protected AssemblyContextGraph ctxGraph; @@ -71,8 +70,6 @@ public class SleighAssembler implements Assembler { this.listing = program.getListing(); this.memory = program.getMemory(); - this.dis = Disassembler.getDisassembler(program, TaskMonitor.DUMMY, - DisassemblerMessageListener.IGNORE); } /** @@ -113,8 +110,12 @@ public class SleighAssembler implements Assembler { Address end = at.add(insbytes.length - 1); listing.clearCodeUnits(at, end, false); memory.setBytes(at, insbytes); - dis.disassemble(at, new AddressSet(at)); - return listing.getInstructions(new AddressSet(at, end), true); + AddressSet set = new AddressSet(at, end); + // Creating this at construction causes it to assess memory flags too early. + Disassembler dis = Disassembler.getDisassembler(program, TaskMonitor.DUMMY, + DisassemblerMessageListener.IGNORE); + dis.disassemble(at, set); + return listing.getInstructions(set, true); } @Override diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyConstructorSemantic.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyConstructorSemantic.java index ac2c5e1350..38f4c5be69 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyConstructorSemantic.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyConstructorSemantic.java @@ -46,9 +46,10 @@ public class AssemblyConstructorSemantic implements Comparable indices) { this.cons = cons; @@ -73,6 +74,7 @@ public class AssemblyConstructorSemantic implements Comparable getPatterns() { @@ -92,6 +95,7 @@ public class AssemblyConstructorSemantic implements Comparable getOperandIndices() { @@ -111,8 +116,9 @@ public class AssemblyConstructorSemantic implements Comparable getOperandIndexIterator() { @@ -142,17 +148,17 @@ public class AssemblyConstructorSemantic implements ComparableallInitializedAddrSet and initializedLoadedAddrSet - * with relevant initialized addresses from the specified memory block. If block is not - * a mapped-block and it may be a source to existing mapped-blocks then - * scanAllMappedBlocksIfNeeded should be passed as true unless - * all mapped blocks will be processed separately. + * Update the allInitializedAddrSet and initializedLoadedAddrSet with + * relevant initialized addresses from the specified memory block. If block is not a + * mapped-block and it may be a source to existing mapped-blocks then + * scanAllMappedBlocksIfNeeded should be passed as true unless all + * mapped blocks will be processed separately. + * * @param block memory block - * @param scanAllMappedBlocksIfNeeded if true and block is initialized and not a mapped block all - * mapped blocks will be processed for possible introduction of newly initialized mapped regions. + * @param scanAllMappedBlocksIfNeeded if true and block is initialized and not a mapped block + * all mapped blocks will be processed for possible introduction of newly initialized + * mapped regions. */ private void addBlockAddresses(MemoryBlockDB block, boolean scanAllMappedBlocksIfNeeded) { AddressSet blockSet = new AddressSet(block.getStart(), block.getEnd()); @@ -193,11 +196,12 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { } /** - * Update initialized address set for those mapped blocks which map onto the - * specified block which has just completed a transition of its' initialized state. + * Update initialized address set for those mapped blocks which map onto the specified block + * which has just completed a transition of its' initialized state. + * * @param block block whose initialized state has changed - * @param isInitialized true if block transitioned from uninitialized to initialized, - * else transition is from initialized to uninitialized. + * @param isInitialized true if block transitioned from uninitialized to initialized, else + * transition is from initialized to uninitialized. */ private void updateMappedAddresses(MemoryBlockDB block, boolean isInitialized) { @@ -285,6 +289,7 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { /** * Returns the address factory for the program. + * * @return program address factory */ AddressFactory getAddressFactory() { @@ -293,6 +298,7 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { /** * Returns the AddressMap from the program. + * * @return program address map */ AddressMapDB getAddressMap() { @@ -331,7 +337,7 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { throw new MemoryAccessException(block.getName() + " does not contain range " + start.toString(true) + "-" + endAddr); } - + if (block.isMapped()) { checkMemoryWriteMappedBlock(block, start, endAddr); } @@ -368,7 +374,7 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { mappedEndAddress = byteMappingScheme.getMappedSourceAddress(mappedRangeMinAddr, endOffset); } - + for (MemoryBlockDB b : getBlocks(mappedStartAddress, mappedEndAddress)) { Address minAddr = Address.min(b.getEnd(), mappedEndAddress); Address maxAddr = Address.max(b.getStart(), mappedStartAddress); @@ -381,9 +387,9 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { throws MemoryAccessException { // TODO: could contain uninitialized region which is illegal to write to although block.isInitialized // may not be of much help since it reflects the first sub-block only - seems like mixing is a bad idea - + checkRangeForInstructions(start, endAddr); - + // Check all mapped-block address ranges which map onto the range to be modified Collection mappedBlocks = nonMappedBlock.getMappedBlocks(); if (mappedBlocks != null) { @@ -480,8 +486,9 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { } /** - * Two blocks have been joined producing newBlock. The block which was - * eliminated can be identified using the oldBlockStartAddr. + * Two blocks have been joined producing newBlock. The block which was eliminated can be + * identified using the oldBlockStartAddr. + * * @param newBlock new joined memory block * @param oldBlockStartAddr original start address of affected block */ @@ -798,6 +805,7 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { /** * Check new block name for validity + * * @param name new block name * @throws IllegalArgumentException if invalid block name specified */ @@ -1246,25 +1254,19 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { } /** - * Tests if the memory contains a sequence of contiguous bytes that match the - * given byte array at all bit positions where the mask contains an "on" bit. - * The test will be something like + * Tests if the memory contains a sequence of contiguous bytes that match the given byte array + * at all bit positions where the mask contains an "on" bit. The test will be something like * - * for(int i=0;i= n) { break; } + n -= advanced; try { addr = block.getEnd().addNoWrap(1); } @@ -1879,8 +1882,9 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { } /** - * Tests if the given addressSpace (overlay space) is used by any blocks. If not, it - * removes the space. + * Tests if the given addressSpace (overlay space) is used by any blocks. If not, it removes the + * space. + * * @param addressSpace overlay address space to be removed */ private void checkRemoveAddressSpace(AddressSpace addressSpace) { @@ -1930,8 +1934,8 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { } /** - * Gets the intersected set of addresses between a mapped memory block, and some other - * address set. + * Gets the intersected set of addresses between a mapped memory block, and some other address + * set. * * @param mappedBlock The mapped memory block to use in the intersection. * @param set Some other address set to use in the intersection. @@ -1954,9 +1958,10 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { } /** - * Converts the given address range back from the source range back to the mapped range. - * NOTE: It is important that the specified mappedSourceRange is restricted to the - * mapped source area of the specified mappedBlock. + * Converts the given address range back from the source range back to the mapped range. NOTE: + * It is important that the specified mappedSourceRange is restricted to the mapped source area + * of the specified mappedBlock. + * * @param mappedBlock mapped memory block * @param mappedSourceRange source range which maps into mappedBlock. * @return mapped range or null if source range not mapped to block @@ -2225,9 +2230,10 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener { /** * Returns a list of all memory blocks that contain any addresses in the given range + * * @param start the start address * @param end the end address - * @return a list of all memory blocks that contain any addresses in the given range + * @return a list of all memory blocks that contain any addresses in the given range */ List getBlocks(Address start, Address end) { List list = new ArrayList<>(); From ded7acd71fd4dfac795a414c067d58a5725df136 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Mon, 29 Nov 2021 13:58:57 -0500 Subject: [PATCH 4/8] GP-1547: Fixing address space issue when switching between traces. --- .../core/debug/gui/DebuggerLocationLabel.java | 27 +++++++----- .../AbstractGhidraHeadedDebuggerGUITest.java | 26 ++++++++--- .../listing/DebuggerListingProviderTest.java | 44 +++++++++++++++++++ .../trace/database/ToyDBTraceBuilder.java | 23 ++++++++-- 4 files changed, 100 insertions(+), 20 deletions(-) diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerLocationLabel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerLocationLabel.java index 2ee23c1306..e707f16ee6 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerLocationLabel.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerLocationLabel.java @@ -175,19 +175,24 @@ public class DebuggerLocationLabel extends JLabel { if (address == null) { return "(nowhere)"; } - TraceSection section = getNearestSectionContaining(); - if (section != null) { - return section.getModule().getName() + ":" + section.getName(); + try { + TraceSection section = getNearestSectionContaining(); + if (section != null) { + return section.getModule().getName() + ":" + section.getName(); + } + TraceModule module = getNearestModuleContaining(); + if (module != null) { + return module.getName(); + } + TraceMemoryRegion region = getRegionContaining(); + if (region != null) { + return region.getName(); + } + return "(unknown)"; } - TraceModule module = getNearestModuleContaining(); - if (module != null) { - return module.getName(); + catch (Throwable t) { + return "(error) " + t.getMessage(); } - TraceMemoryRegion region = getRegionContaining(); - if (region != null) { - return region.getName(); - } - return "(unknown)"; } public void updateLabel() { diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java index 5d58809104..a8906486d3 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerGUITest.java @@ -495,8 +495,12 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest tool.getProject().getProjectData().getRootFolder().createFile(obj.getName(), obj, monitor); } + protected void createSnaplessTrace(String langID) throws IOException { + tb = new ToyDBTraceBuilder("dynamic-" + name.getMethodName(), langID); + } + protected void createSnaplessTrace() throws IOException { - tb = new ToyDBTraceBuilder("dynamic-" + name.getMethodName(), LANGID_TOYBE64); + createSnaplessTrace(LANGID_TOYBE64); } protected void addSnapshot(String desc) throws IOException { @@ -505,16 +509,28 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest } } - protected void createTrace() throws IOException { - createSnaplessTrace(); + protected void createTrace(String langID) throws IOException { + createSnaplessTrace(langID); addSnapshot("First snap"); } - protected void createAndOpenTrace() throws IOException { - createTrace(); + protected void createTrace() throws IOException { + createTrace(LANGID_TOYBE64); + } + + protected void useTrace(Trace trace) { + tb = new ToyDBTraceBuilder(trace); + } + + protected void createAndOpenTrace(String langID) throws IOException { + createTrace(langID); traceManager.openTrace(tb.trace); } + protected void createAndOpenTrace() throws IOException { + createAndOpenTrace(LANGID_TOYBE64); + } + protected String getProgramName() { return "static-" + getClass().getCanonicalName() + "." + name.getMethodName(); } diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java index 04fca7415d..0027466d0d 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProviderTest.java @@ -1195,6 +1195,50 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI waitForPass(() -> assertEquals("modExe:.text", listingProvider.locationLabel.getText())); } + @Test + public void testActivateTraceChangeLanguage() throws Exception { + assertEquals(trackPc, listingProvider.actionTrackLocation.getCurrentUserData()); + + createSnaplessTrace("x86:LE:64:default"); + + try (ToyDBTraceBuilder tb2 = + new ToyDBTraceBuilder("dynamic2-" + name.getMethodName(), "dsPIC33F:LE:24:default")) { + + TraceThread thread1; + try (UndoableTransaction tid = tb.startTransaction()) { + tb.trace.getTimeManager().createSnapshot("First"); + tb.trace.getMemoryManager() + .createRegion(".text", 0, tb.range(0x00400000, 0x0040ffff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + thread1 = tb.getOrAddThread("Thread1", 0); + tb.exec(0, 0, thread1, java.util.List.of( + "RIP = 0x00400000;")); + } + + TraceThread thread2; + try (UndoableTransaction tid = tb2.startTransaction()) { + tb2.trace.getTimeManager().createSnapshot("First"); + tb2.trace.getMemoryManager() + .createRegion(".text", 0, tb2.range(0x200, 0x3ff), + TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE); + thread2 = tb2.getOrAddThread("Thread2", 0); + tb2.exec(0, 0, thread2, java.util.List.of( + "PC = 0x100;")); + } + + traceManager.openTrace(tb.trace); + traceManager.openTrace(tb2.trace); + + traceManager.activateThread(thread1); + waitForSwing(); + + traceManager.activateThread(thread2); + waitForSwing(); + + assertFalse(listingProvider.locationLabel.getText().startsWith("(error)")); + } + } + @Test public void testActivateThreadTracks() throws Exception { assertEquals(trackPc, listingProvider.actionTrackLocation.getCurrentUserData()); diff --git a/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java b/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java index 0079f96350..7ca4ceda1b 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/ToyDBTraceBuilder.java @@ -26,12 +26,14 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Collection; -import java.util.Objects; +import java.util.*; import com.google.common.collect.Range; import db.DBHandle; +import ghidra.app.plugin.processors.sleigh.SleighLanguage; +import ghidra.pcode.exec.*; +import ghidra.pcode.exec.trace.TraceSleighUtils; import ghidra.program.disassemble.Disassembler; import ghidra.program.model.address.*; import ghidra.program.model.data.DataType; @@ -49,9 +51,9 @@ import ghidra.trace.database.memory.DBTraceMemoryManager; import ghidra.trace.database.symbol.DBTraceReference; import ghidra.trace.database.thread.DBTraceThread; import ghidra.trace.database.thread.DBTraceThreadManager; -import ghidra.trace.model.ImmutableTraceAddressSnapRange; -import ghidra.trace.model.TraceAddressSnapRange; +import ghidra.trace.model.*; import ghidra.trace.model.language.TraceGuestLanguage; +import ghidra.trace.model.thread.TraceThread; import ghidra.util.Msg; import ghidra.util.database.DBOpenMode; import ghidra.util.database.UndoableTransaction; @@ -76,6 +78,19 @@ public class ToyDBTraceBuilder implements AutoCloseable { this.trace = new DBTrace(name, language.getDefaultCompilerSpec(), this); } + public ToyDBTraceBuilder(Trace trace) { + this.language = trace.getBaseLanguage(); + this.trace = (DBTrace) trace; + trace.addConsumer(this); + } + + public void exec(long snap, int frame, TraceThread thread, List sleigh) { + PcodeProgram program = SleighProgramCompiler.compileProgram((SleighLanguage) language, + "builder", sleigh, SleighUseropLibrary.nil()); + TraceSleighUtils.buildByteExecutor(trace, snap, thread, frame) + .execute(program, SleighUseropLibrary.nil()); + } + public Address addr(AddressSpace space, long offset) { return space.getAddress(offset); } From d6a7c496155726a9559a5e0a1b5b122828b9aa19 Mon Sep 17 00:00:00 2001 From: d-millar <33498836+d-millar@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:39:34 +0000 Subject: [PATCH 5/8] GP-1477: Improved build scripts for LLDB Java language bindings --- Ghidra/Debug/Debugger-agent-lldb/build.gradle | 9 +- .../certification.manifest | 19 +- .../data/InstructionsForPatchingLLDB.txt | 30 - .../lldb/bindings/java/java-typemaps.swig | 3 - .../lldb/bindings/java/java.swig | 5 +- .../src/llvm/lldb/CMakeLists.txt | 109 - .../src/llvm/lldb/bindings/CMakeLists.txt | 48 - .../llvm/lldb/bindings/java/CMakeLists.txt | 23 - .../lldb/cmake/modules/FindJavaAndSwig.cmake | 32 - .../llvm/lldb/cmake/modules/LLDBConfig.cmake | 319 --- .../src/llvm/lldb/include/jni.h | 1964 ----------------- .../src/llvm/lldb/include/jni_md.h | 26 - .../lldb/include/lldb/Host/Config.h.cmake | 64 - .../src/llvm/lldb/source/API/CMakeLists.txt | 247 --- .../src/llvm/lldb/source/API/SBDebugger.cpp | 1904 ---------------- .../lldb/source/API/liblldb-private.exports | 8 - .../src/llvm/lldb/source/API/liblldb.exports | 8 - .../Plugins/ScriptInterpreter/CMakeLists.txt | 17 - .../ScriptInterpreter/Java/CMakeLists.txt | 16 - .../Plugins/ScriptInterpreter/Java/Java.cpp | 170 -- .../Plugins/ScriptInterpreter/Java/Java.h | 50 - .../Java/ScriptInterpreterJava.cpp | 246 --- .../Java/ScriptInterpreterJava.h | 81 - .../tools/debugserver/source/CMakeLists.txt | 348 --- .../src/main/java/SWIG/SBTraceOptions.java | 92 - .../src/main/java/SWIG/SWIGTYPE_p_JNIEnv.java | 31 - .../src/main/java/SWIG/SWIGTYPE_p_bool.java | 31 - .../src/main/java/SWIG/SWIGTYPE_p_byte.java | 30 - .../src/main/java/SWIG/SWIGTYPE_p_char.java | 30 - .../src/main/java/SWIG/SWIGTYPE_p_float.java | 30 - .../src/main/java/SWIG/SWIGTYPE_p_p_char.java | 31 - .../java/agent/lldb/lldb/DebugClientImpl.java | 18 +- .../lldb/manager/impl/LldbManagerImpl.java | 40 +- ...LldbModelTargetStackFrameRegisterImpl.java | 5 + .../LldbModelTargetThreadContainerImpl.java | 3 + .../Debug/Debugger-swig-lldb/Module.manifest | 1 + Ghidra/Debug/Debugger-swig-lldb/build.gradle | 50 + .../Debugger-swig-lldb/buildNatives.gradle | 124 ++ .../Debugger-swig-lldb/certification.manifest | 10 + .../InstructionsForBuildingLLDBInterface.txt | 56 + .../lldb/bindings/java/java-typemaps.swig | 18 + .../llvm-project/lldb/bindings/java/java.swig | 22 + .../src/main/cpp}/LLDBWrapJava.cpp | 910 ++++---- .../src/main/java/SWIG/AccessType.java | 6 +- .../src/main/java/SWIG/BasicType.java | 6 +- .../main/java/SWIG/BreakpointEventType.java | 6 +- .../src/main/java/SWIG/ByteArray.java | 4 +- .../src/main/java/SWIG/ByteOrder.java | 6 +- .../main/java/SWIG/CommandArgumentType.java | 9 +- .../src/main/java/SWIG/CommandFlags.java | 6 +- .../java/SWIG/CommandInterpreterResult.java | 6 +- .../src/main/java/SWIG/ConnectionStatus.java | 6 +- .../src/main/java/SWIG/DescriptionLevel.java | 6 +- .../src/main/java/SWIG/DynamicValueType.java | 6 +- .../java/SWIG/EmulateInstructionOptions.java | 6 +- .../src/main/java/SWIG/Encoding.java | 6 +- .../src/main/java/SWIG/ErrorType.java | 6 +- .../java/SWIG/ExpressionEvaluationPhase.java | 6 +- .../src/main/java/SWIG/ExpressionResults.java | 6 +- .../src/main/java/SWIG/FilePermissions.java | 6 +- .../src/main/java/SWIG/Format.java | 6 +- .../src/main/java/SWIG/FrameComparison.java | 6 +- .../src/main/java/SWIG/FunctionNameType.java | 6 +- .../src/main/java/SWIG/GdbSignal.java | 6 +- .../src/main/java/SWIG/InputReaderAction.java | 6 +- .../java/SWIG/InputReaderGranularity.java | 6 +- .../java/SWIG/InstrumentationRuntimeType.java | 6 +- .../src/main/java/SWIG/LanguageType.java | 6 +- .../src/main/java/SWIG/LaunchFlags.java | 6 +- .../src/main/java/SWIG/MatchType.java | 6 +- .../main/java/SWIG/MemberFunctionKind.java | 6 +- .../src/main/java/SWIG/PathType.java | 6 +- .../src/main/java/SWIG/Permissions.java | 6 +- .../src/main/java/SWIG/QueueItemKind.java | 6 +- .../src/main/java/SWIG/QueueKind.java | 6 +- .../src/main/java/SWIG/RegisterKind.java | 6 +- .../src/main/java/SWIG/ReturnStatus.java | 6 +- .../src/main/java/SWIG/RunMode.java | 6 +- .../src/main/java/SWIG/SBAddress.java | 6 +- .../src/main/java/SWIG/SBAttachInfo.java | 6 +- .../src/main/java/SWIG/SBBlock.java | 6 +- .../src/main/java/SWIG/SBBreakpoint.java | 6 +- .../src/main/java/SWIG/SBBreakpointList.java | 6 +- .../main/java/SWIG/SBBreakpointLocation.java | 6 +- .../src/main/java/SWIG/SBBreakpointName.java | 6 +- .../src/main/java/SWIG/SBBroadcaster.java | 6 +- .../main/java/SWIG/SBCommandInterpreter.java | 6 +- .../SWIG/SBCommandInterpreterRunOptions.java | 14 +- .../main/java/SWIG/SBCommandReturnObject.java | 6 +- .../src/main/java/SWIG/SBCommunication.java | 6 +- .../src/main/java/SWIG/SBCompileUnit.java | 6 +- .../src/main/java/SWIG/SBData.java | 6 +- .../src/main/java/SWIG/SBDebugger.java | 11 +- .../src/main/java/SWIG/SBDeclaration.java | 6 +- .../src/main/java/SWIG/SBEnvironment.java | 6 +- .../src/main/java/SWIG/SBError.java | 6 +- .../src/main/java/SWIG/SBEvent.java | 6 +- .../main/java/SWIG/SBExecutionContext.java | 6 +- .../main/java/SWIG/SBExpressionOptions.java | 6 +- .../src/main/java/SWIG/SBFile.java | 6 +- .../src/main/java/SWIG/SBFileSpec.java | 6 +- .../src/main/java/SWIG/SBFileSpecList.java | 6 +- .../src/main/java/SWIG/SBFrame.java | 6 +- .../src/main/java/SWIG/SBFunction.java | 6 +- .../src/main/java/SWIG/SBHostOS.java | 6 +- .../src/main/java/SWIG/SBInstruction.java | 6 +- .../src/main/java/SWIG/SBInstructionList.java | 6 +- .../src/main/java/SWIG/SBLanguageRuntime.java | 6 +- .../src/main/java/SWIG/SBLaunchInfo.java | 7 +- .../src/main/java/SWIG/SBLineEntry.java | 6 +- .../src/main/java/SWIG/SBListener.java | 6 +- .../main/java/SWIG/SBMemoryRegionInfo.java | 26 +- .../java/SWIG/SBMemoryRegionInfoList.java | 10 +- .../src/main/java/SWIG/SBModule.java | 6 +- .../src/main/java/SWIG/SBModuleSpec.java | 6 +- .../src/main/java/SWIG/SBModuleSpecList.java | 6 +- .../src/main/java/SWIG/SBPlatform.java | 6 +- .../java/SWIG/SBPlatformConnectOptions.java | 6 +- .../java/SWIG/SBPlatformShellCommand.java | 6 +- .../src/main/java/SWIG/SBProcess.java | 31 +- .../src/main/java/SWIG/SBProcessInfo.java | 10 +- .../src/main/java/SWIG/SBQueue.java | 6 +- .../src/main/java/SWIG/SBQueueItem.java | 6 +- .../src/main/java/SWIG/SBReproducer.java | 6 +- .../src/main/java/SWIG/SBSection.java | 6 +- .../src/main/java/SWIG/SBSourceManager.java | 6 +- .../src/main/java/SWIG/SBStream.java | 6 +- .../src/main/java/SWIG/SBStringList.java | 7 +- .../src/main/java/SWIG/SBStructuredData.java | 12 +- .../src/main/java/SWIG/SBSymbol.java | 6 +- .../src/main/java/SWIG/SBSymbolContext.java | 6 +- .../main/java/SWIG/SBSymbolContextList.java | 6 +- .../src/main/java/SWIG/SBTarget.java | 20 +- .../src/main/java/SWIG/SBThread.java | 16 +- .../main/java/SWIG/SBThreadCollection.java | 6 +- .../src/main/java/SWIG/SBThreadPlan.java | 6 +- .../src/main/java/SWIG/SBTrace.java | 26 +- .../src/main/java/SWIG/SBType.java | 14 +- .../src/main/java/SWIG/SBTypeCategory.java | 6 +- .../src/main/java/SWIG/SBTypeEnumMember.java | 6 +- .../main/java/SWIG/SBTypeEnumMemberList.java | 6 +- .../src/main/java/SWIG/SBTypeFilter.java | 6 +- .../src/main/java/SWIG/SBTypeFormat.java | 6 +- .../src/main/java/SWIG/SBTypeList.java | 6 +- .../src/main/java/SWIG/SBTypeMember.java | 6 +- .../main/java/SWIG/SBTypeMemberFunction.java | 6 +- .../main/java/SWIG/SBTypeNameSpecifier.java | 6 +- .../src/main/java/SWIG/SBTypeSummary.java | 6 +- .../main/java/SWIG/SBTypeSummaryOptions.java | 6 +- .../src/main/java/SWIG/SBTypeSynthetic.java | 6 +- .../src/main/java/SWIG/SBUnixSignals.java | 6 +- .../src/main/java/SWIG/SBValue.java | 6 +- .../src/main/java/SWIG/SBValueList.java | 6 +- .../main/java/SWIG/SBVariablesOptions.java | 6 +- .../src/main/java/SWIG/SBWatchpoint.java | 6 +- .../src/main/java/SWIG/SWIGTYPE_p_double.java | 6 +- ...TYPE_p_f_p_q_const__char_p_void__void.java | 6 +- .../SWIG/SWIGTYPE_p_f_p_void__p_void.java | 6 +- ...f_p_void_p_q_const__void_size_t__void.java | 6 +- .../src/main/java/SWIG/SWIGTYPE_p_int.java | 6 +- .../src/main/java/SWIG/SWIGTYPE_p_jbyte.java | 7 +- .../SWIGTYPE_p_lldb__ConnectionStatus.java | 6 +- .../java/SWIG/SWIGTYPE_p_long_double.java | 6 +- .../main/java/SWIG/SWIGTYPE_p_long_long.java | 6 +- .../src/main/java/SWIG/SWIGTYPE_p_p_void.java | 6 +- .../main/java/SWIG/SWIGTYPE_p_pthread_t.java | 6 +- .../src/main/java/SWIG/SWIGTYPE_p_size_t.java | 6 +- ...td__shared_ptrT_lldb_private__Event_t.java | 6 +- ...std__shared_ptrT_lldb_private__File_t.java | 6 +- ...shared_ptrT_lldb_private__QueueItem_t.java | 6 +- ...td__shared_ptrT_lldb_private__Queue_t.java | 6 +- ...hared_ptrT_lldb_private__ThreadPlan_t.java | 6 +- .../java/SWIG/SWIGTYPE_p_unsigned_char.java | 6 +- .../java/SWIG/SWIGTYPE_p_unsigned_int.java | 6 +- .../SWIG/SWIGTYPE_p_unsigned_long_long.java | 6 +- .../src/main/java/SWIG/SWIGTYPE_p_void.java | 6 +- .../src/main/java/SWIG/SaveCoreStyle.java | 59 + .../src/main/java/SWIG/ScriptLanguage.java | 6 +- .../src/main/java/SWIG/SearchDepth.java | 6 +- .../src/main/java/SWIG/SectionType.java | 6 +- .../src/main/java/SWIG/StateType.java | 10 +- .../src/main/java/SWIG/StopReason.java | 12 +- .../src/main/java/SWIG/StopShowColumn.java | 6 +- .../main/java/SWIG/StructuredDataType.java | 6 +- .../src/main/java/SWIG/SymbolContextItem.java | 6 +- .../src/main/java/SWIG/SymbolType.java | 6 +- .../main/java/SWIG/TemplateArgumentKind.java | 9 +- .../SWIG/TraceInstructionControlFlowType.java | 60 + .../src/main/java/SWIG/TraceType.java | 6 +- .../src/main/java/SWIG/TypeClass.java | 6 +- .../src/main/java/SWIG/TypeFlags.java | 6 +- .../src/main/java/SWIG/TypeOptions.java | 6 +- .../main/java/SWIG/TypeSummaryCapping.java | 6 +- .../src/main/java/SWIG/ValueType.java | 6 +- .../main/java/SWIG/WatchpointEventType.java | 6 +- .../src/main/java/SWIG/WatchpointKind.java | 6 +- .../src/main/java/SWIG/lldb.java | 2 +- .../src/main/java/SWIG/lldbConstants.java | 7 +- .../src/main/java/SWIG/lldbJNI.java | 51 +- .../arm/LldbArmDebuggerMappingOpinion.java | 6 +- .../lldb/LldbX86DebuggerMappingOpinion.java | 46 +- 201 files changed, 1334 insertions(+), 7222 deletions(-) delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/data/InstructionsForPatchingLLDB.txt rename Ghidra/Debug/Debugger-agent-lldb/src/{llvm => llvm-project}/lldb/bindings/java/java-typemaps.swig (89%) rename Ghidra/Debug/Debugger-agent-lldb/src/{llvm => llvm-project}/lldb/bindings/java/java.swig (82%) delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/FindJavaAndSwig.cmake delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/LLDBConfig.cmake delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni.h delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni_md.h delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/lldb/Host/Config.h.cmake delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/SBDebugger.cpp delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb-private.exports delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb.exports delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.cpp delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.h delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.cpp delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.h delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/tools/debugserver/source/CMakeLists.txt delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTraceOptions.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_JNIEnv.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_bool.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_byte.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_char.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_float.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_char.java create mode 100644 Ghidra/Debug/Debugger-swig-lldb/Module.manifest create mode 100644 Ghidra/Debug/Debugger-swig-lldb/build.gradle create mode 100644 Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle create mode 100644 Ghidra/Debug/Debugger-swig-lldb/certification.manifest create mode 100644 Ghidra/Debug/Debugger-swig-lldb/data/InstructionsForBuildingLLDBInterface.txt create mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig create mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig rename Ghidra/Debug/{Debugger-agent-lldb/src/llvm/lldb => Debugger-swig-lldb/src/main/cpp}/LLDBWrapJava.cpp (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/AccessType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/BasicType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/BreakpointEventType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ByteArray.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ByteOrder.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/CommandArgumentType.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/CommandFlags.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/CommandInterpreterResult.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ConnectionStatus.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/DescriptionLevel.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/DynamicValueType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/EmulateInstructionOptions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/Encoding.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ErrorType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ExpressionEvaluationPhase.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ExpressionResults.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/FilePermissions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/Format.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/FrameComparison.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/FunctionNameType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/GdbSignal.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/InputReaderAction.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/InputReaderGranularity.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/InstrumentationRuntimeType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/LanguageType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/LaunchFlags.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/MatchType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/MemberFunctionKind.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/PathType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/Permissions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/QueueItemKind.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/QueueKind.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/RegisterKind.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ReturnStatus.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/RunMode.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBAddress.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBAttachInfo.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBBlock.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBBreakpoint.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBBreakpointList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBBreakpointLocation.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBBreakpointName.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBBroadcaster.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBCommandInterpreter.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBCommandInterpreterRunOptions.java (91%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBCommandReturnObject.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBCommunication.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBCompileUnit.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBData.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBDebugger.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBDeclaration.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBEnvironment.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBError.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBEvent.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBExecutionContext.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBExpressionOptions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBFile.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBFileSpec.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBFileSpecList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBFrame.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBFunction.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBHostOS.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBInstruction.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBInstructionList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBLanguageRuntime.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBLaunchInfo.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBLineEntry.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBListener.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBMemoryRegionInfo.java (75%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBMemoryRegionInfoList.java (88%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBModule.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBModuleSpec.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBModuleSpecList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBPlatform.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBPlatformConnectOptions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBPlatformShellCommand.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBProcess.java (92%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBProcessInfo.java (96%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBQueue.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBQueueItem.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBReproducer.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBSection.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBSourceManager.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBStream.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBStringList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBStructuredData.java (92%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBSymbol.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBSymbolContext.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBSymbolContextList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTarget.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBThread.java (94%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBThreadCollection.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBThreadPlan.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTrace.java (54%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBType.java (95%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeCategory.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeEnumMember.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeEnumMemberList.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeFilter.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeFormat.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeList.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeMember.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeMemberFunction.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeNameSpecifier.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeSummary.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeSummaryOptions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBTypeSynthetic.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBUnixSignals.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBValue.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBValueList.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBVariablesOptions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SBWatchpoint.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_double.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_int.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_jbyte.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_long_double.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_long_long.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_p_void.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_size_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java (97%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SWIGTYPE_p_void.java (97%) create mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ScriptLanguage.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SearchDepth.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SectionType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/StateType.java (96%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/StopReason.java (85%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/StopShowColumn.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/StructuredDataType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SymbolContextItem.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/SymbolType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/TemplateArgumentKind.java (93%) create mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceInstructionControlFlowType.java rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/TraceType.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/TypeClass.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/TypeFlags.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/TypeOptions.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/TypeSummaryCapping.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/ValueType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/WatchpointEventType.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/WatchpointKind.java (99%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/lldb.java (96%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/lldbConstants.java (98%) rename Ghidra/Debug/{Debugger-agent-lldb => Debugger-swig-lldb}/src/main/java/SWIG/lldbJNI.java (98%) diff --git a/Ghidra/Debug/Debugger-agent-lldb/build.gradle b/Ghidra/Debug/Debugger-agent-lldb/build.gradle index 7e50733583..57338fd0ca 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/build.gradle +++ b/Ghidra/Debug/Debugger-agent-lldb/build.gradle @@ -26,6 +26,7 @@ dependencies { api project(':Framework-AsyncComm') api project(':Framework-Debugging') api project(':Debugger-gadp') + api project(':Debugger-swig-lldb') testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') @@ -72,14 +73,6 @@ task nodepJar(type: Jar) { from(zipTree(jar.archivePath)) } -// Include llvm patch and SWIG files -rootProject.assembleDistribution { - from (this.project.projectDir.toString()) { - include "src/llvm/**" - into {getZipPath(this.project) + "/data/"} - } -} - task executableJar { ext.execsh = file("src/main/sh/execjar.sh") ext.jarfile = file(nodepJar.archivePath) diff --git a/Ghidra/Debug/Debugger-agent-lldb/certification.manifest b/Ghidra/Debug/Debugger-agent-lldb/certification.manifest index c267970356..be44694b3e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/certification.manifest +++ b/Ghidra/Debug/Debugger-agent-lldb/certification.manifest @@ -5,18 +5,7 @@ .project||NONE||reviewed||END| Module.manifest||GHIDRA||||END| build.gradle||GHIDRA||||END| -data/InstructionsForPatchingLLDB.txt||GHIDRA||||END| -src/llvm/lldb/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/bindings/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/bindings/java/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/cmake/modules/FindJavaAndSwig.cmake||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/cmake/modules/LLDBConfig.cmake||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/include/lldb/Host/Config.h.cmake||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/source/API/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/source/API/liblldb-private.exports||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/source/API/liblldb.exports||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm/lldb/tools/debugserver/source/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END| +data/InstructionsForBuildingLLDBInterface.txt||GHIDRA||||END| +src/llvm-project/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END| +src/llvm-project/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END| +src/llvm-project/lldb/build_script||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger-agent-lldb/data/InstructionsForPatchingLLDB.txt b/Ghidra/Debug/Debugger-agent-lldb/data/InstructionsForPatchingLLDB.txt deleted file mode 100644 index a5ce9741b2..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/data/InstructionsForPatchingLLDB.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory include a fragment of the LLVM lldb source tree with modifications to generate Java JNI wrappers for the Scripting Bridge API via SWIG. Some of these are source modifications, some compilation instructions, some add exports. To use lldb with Ghidra, you will need to: - -(A) Download and build lldb following the standard guidelines from https://lldb.llvm.org -(B) Modify the lldb code along the lines of the included code and rebuild -(C) Copy the resulting liblldb.dylib (for macOS) or liblldb.so (for Linux) into the system directory - -The SWIG-generated Java files that form the JNI interface have already been included as class files in the Ghidra jars. That said, if the exported API has changed and caused a mismatch, they may need to be replaced and recompiled. The Ghidra versions live in Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG. - -The CMake changes live in: -- lldb/CMakeLists.txt -- lldb/bindings/CMakeLists.txt -- lldb/bindings/java/CMakeLists.txt (new) -- lldb/source/API/CMakeLists.txt -Most of the changes involve adding LLDB_ENABLE_JAVA, in line with LLDB_ENABLE_LUA and LLDB_ENABLE_PYTHON. The same templates are used for all three. - -A minor change to lldb/source/API/SBDebugger.cpp adds LLDB_ENABLE_JAVA to the config options. - -Extra export patterns have been added to: -- lldb/source/API/liblldb.exports -- lldb/source/API/liblldb.private-exports -to accommodate the Java patterns. - -Two new .swig files have been added, which may be copied over as is: -- lldb/bindings/java/java.swig -- lldb/bindings/java/java-typemaps.swig -The latter adds access for ByteArrays. - -Finally, lldb/cmake/modules/FindJavaAndSwig.cmake has been added as the generator. - - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/java-typemaps.swig b/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig similarity index 89% rename from Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/java-typemaps.swig rename to Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig index 24b90c895b..e23628eb30 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/java-typemaps.swig +++ b/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig @@ -1,6 +1,3 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ %include %include %include diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/java.swig b/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig similarity index 82% rename from Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/java.swig rename to Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig index 2cfe68d859..305ecc6b70 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/java.swig +++ b/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig @@ -1,6 +1,3 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ /* lldb.swig @@ -22,4 +19,4 @@ using namespace lldb; %} %include "interfaces.swig" -//%include "lua-wrapper.swig" + diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/CMakeLists.txt deleted file mode 100644 index 9bfd06ee97..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/CMakeLists.txt +++ /dev/null @@ -1,109 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -cmake_minimum_required(VERSION 3.13.4) - -# Add path for custom modules. -set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${CMAKE_CURRENT_SOURCE_DIR}/cmake" - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" - ) - -# If we are not building as part of LLVM, build LLDB as a standalone project, -# using LLVM as an external library. -if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - project(lldb) - include(LLDBStandalone) - - set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to") - set(CMAKE_CXX_STANDARD_REQUIRED YES) - set(CMAKE_CXX_EXTENSIONS NO) -endif() - -include(LLDBConfig) -include(AddLLDB) - -# Define the LLDB_CONFIGURATION_xxx matching the build type. -if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) - add_definitions(-DLLDB_CONFIGURATION_DEBUG) -endif() - -if (WIN32) - add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) -endif() - -if (LLDB_ENABLE_PYTHON) - if (NOT CMAKE_CROSSCOMPILING) - execute_process( - COMMAND ${Python3_EXECUTABLE} - -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))" - OUTPUT_VARIABLE LLDB_PYTHON_DEFAULT_RELATIVE_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE) - - file(TO_CMAKE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} LLDB_PYTHON_DEFAULT_RELATIVE_PATH) - else () - if ("${LLDB_PYTHON_RELATIVE_PATH}" STREQUAL "") - message(FATAL_ERROR - "Crosscompiling LLDB with Python requires manually setting - LLDB_PYTHON_RELATIVE_PATH.") - endif () - endif () - - set(LLDB_PYTHON_RELATIVE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} - CACHE STRING "Path where Python modules are installed, relative to install prefix") -endif () - -if (LLDB_ENABLE_PYTHON OR LLDB_ENABLE_LUA OR LLDB_ENABLE_JAVA) - add_subdirectory(bindings) -endif () - -# We need the headers generated by instrinsics_gen before we can compile -# any source file in LLDB as the imported Clang modules might include -# some of these generated headers. This approach is copied from Clang's main -# CMakeLists.txt, so it should kept in sync the code in Clang which was added -# in llvm-svn 308844. -if(LLVM_ENABLE_MODULES) - list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen) -endif() - -if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE) - set(LLVM_USE_HOST_TOOLS ON) - include(CrossCompile) - if (NOT NATIVE_LLVM_DIR OR NOT NATIVE_Clang_DIR) - message(FATAL_ERROR - "Crosscompiling standalone requires the variables NATIVE_{CLANG,LLVM}_DIR - for building the native lldb-tblgen used during the build process.") - endif() - llvm_create_cross_target(lldb NATIVE "" Release - -DLLVM_DIR=${NATIVE_LLVM_DIR} - -DClang_DIR=${NATIVE_Clang_DIR}) -endif() - -# TableGen -add_subdirectory(utils/TableGen) - -add_subdirectory(source) -add_subdirectory(tools) -add_subdirectory(docs) - -if (LLDB_ENABLE_PYTHON) - if(LLDB_BUILD_FRAMEWORK) - set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") - else() - set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") - endif() - get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR) - finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}") -endif() - -option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS}) -if(LLDB_INCLUDE_TESTS) - add_subdirectory(test) - add_subdirectory(unittests) - add_subdirectory(utils) -endif() - -if(LLDB_BUILT_STANDALONE AND NOT LLVM_ENABLE_IDE) - llvm_distribution_add_targets() -endif() diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/CMakeLists.txt deleted file mode 100644 index c8df7c9243..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -file(GLOB SWIG_INTERFACES interface/*.i) -file(GLOB_RECURSE SWIG_SOURCES *.swig) -file(GLOB SWIG_HEADERS - ${LLDB_SOURCE_DIR}/include/lldb/API/*.h - ${LLDB_SOURCE_DIR}/include/lldb/*.h -) -file(GLOB SWIG_PRIVATE_HEADERS - ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h -) -foreach(private_header ${SWIG_PRIVATE_HEADERS}) - list(REMOVE_ITEM SWIG_HEADERS ${private_header}) -endforeach() - -if(LLDB_BUILD_FRAMEWORK) - set(framework_arg --framework --target-platform Darwin) -endif() - -if(APPLE) - set(DARWIN_EXTRAS "-D__APPLE__") -else() - set(DARWIN_EXTRAS "") -endif() - -set(SWIG_COMMON_FLAGS - -c++ - -features autodoc - -I${LLDB_SOURCE_DIR}/include - -I${CMAKE_CURRENT_SOURCE_DIR} - -D__STDC_LIMIT_MACROS - -D__STDC_CONSTANT_MACROS - ${DARWIN_EXTRAS} -) - -if (LLDB_ENABLE_PYTHON) - add_subdirectory(python) -endif() - -if (LLDB_ENABLE_LUA) - add_subdirectory(lua) -endif() - -if (LLDB_ENABLE_JAVA) - add_subdirectory(java) -endif() - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/CMakeLists.txt deleted file mode 100644 index 191db4c21f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/bindings/java/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapJava.cpp - DEPENDS ${SWIG_SOURCES} - DEPENDS ${SWIG_INTERFACES} - DEPENDS ${SWIG_HEADERS} - COMMAND ${SWIG_EXECUTABLE} - ${SWIG_COMMON_FLAGS} - -I${CMAKE_CURRENT_SOURCE_DIR} - -java - -package SWIG - -c++ - -outdir ${CMAKE_CURRENT_BINARY_DIR} - -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapJava.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/java.swig - VERBATIM - COMMENT "Building LLDB Java wrapper") - -add_custom_target(swig_wrapper_java ALL DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapJava.cpp -) diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/FindJavaAndSwig.cmake b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/FindJavaAndSwig.cmake deleted file mode 100644 index 6dc3d176d6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/FindJavaAndSwig.cmake +++ /dev/null @@ -1,32 +0,0 @@ -#.rst: -# FindJavaAndSwig -# -------------- -# -# Find Java and SWIG as a whole. - -#if(JAVA_LIBRARIES AND JAVA_INCLUDE_DIR AND SWIG_EXECUTABLE) -if(SWIG_EXECUTABLE) - set(JAVAANDSWIG_FOUND TRUE) -else() - find_package(SWIG 2.0) - if (SWIG_FOUND) - find_package(Java 11.0) - if(JAVA_FOUND AND SWIG_FOUND) - mark_as_advanced( - JAVA_LIBRARIES - JAVA_INCLUDE_DIR - SWIG_EXECUTABLE) - endif() - else() - message(STATUS "SWIG 2 or later is required for Java support in LLDB but could not be found") - endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(JavaAndSwig - FOUND_VAR - JAVAANDSWIG_FOUND - REQUIRED_VARS - JAVA_LIBRARIES - JAVA_INCLUDE_DIR - SWIG_EXECUTABLE) -endif() diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/LLDBConfig.cmake b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/LLDBConfig.cmake deleted file mode 100644 index a38a763f45..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/cmake/modules/LLDBConfig.cmake +++ /dev/null @@ -1,319 +0,0 @@ -include(CheckCXXSymbolExists) -include(CheckTypeSize) - -set(LLDB_PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) -set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source") -set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include") - -set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) - -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) - message(FATAL_ERROR - "In-source builds are not allowed. CMake would overwrite the makefiles " - "distributed with LLDB. Please create a directory and run cmake from " - "there, passing the path to this source directory as the last argument. " - "This process created the file `CMakeCache.txt' and the directory " - "`CMakeFiles'. Please delete them.") -endif() - -set(LLDB_LINKER_SUPPORTS_GROUPS OFF) -if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") - # The Darwin linker doesn't understand --start-group/--end-group. - set(LLDB_LINKER_SUPPORTS_GROUPS ON) -endif() - -macro(add_optional_dependency variable description package found) - cmake_parse_arguments(ARG - "" - "VERSION" - "" - ${ARGN}) - - set(${variable} "Auto" CACHE STRING "${description} On, Off or Auto (default)") - string(TOUPPER "${${variable}}" ${variable}) - - if("${${variable}}" STREQUAL "AUTO") - set(find_package TRUE) - set(maybe_required) - elseif(${${variable}}) - set(find_package TRUE) - set(maybe_required REQUIRED) - else() - set(find_package FALSE) - set(${variable} FALSE) - endif() - - if(${find_package}) - find_package(${package} ${ARG_VERSION} ${maybe_required}) - set(${variable} "${${found}}") - endif() - - message(STATUS "${description}: ${${variable}}") -endmacro() - -add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) -add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) -add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) -add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_JAVA "Enable Java scripting support in LLDB" JavaAndSwig JAVAANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) - -option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF) -option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) -option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF) -option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF) -option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF) -option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF) -option(LLDB_SKIP_DSYM "Whether to skip generating a dSYM when installing lldb." OFF) - -if (LLDB_USE_SYSTEM_DEBUGSERVER) - # The custom target for the system debugserver has no install target, so we - # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. - if (LLVM_DISTRIBUTION_COMPONENTS) - list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) - set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} CACHE STRING "" FORCE) - endif() -endif() - -if(LLDB_BUILD_FRAMEWORK) - if(NOT APPLE) - message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms") - endif() - - set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") - set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework") - set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework") - - get_filename_component(LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE - BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}) - - # Essentially, emit the framework's dSYM outside of the framework directory. - set(LLDB_DEBUGINFO_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin CACHE STRING - "Directory to emit dSYM files stripped from executables and libraries (Darwin Only)") -endif() - -if(APPLE AND CMAKE_GENERATOR STREQUAL Xcode) - if(NOT LLDB_EXPLICIT_XCODE_CACHE_USED) - message(WARNING - "When building with Xcode, we recommend using the corresponding cache script. " - "If this was a mistake, clean your build directory and re-run CMake with:\n" - " -C ${CMAKE_SOURCE_DIR}/cmake/caches/Apple-lldb-Xcode.cmake\n" - "See: https://lldb.llvm.org/resources/build.html#cmakegeneratedxcodeproject\n") - endif() -endif() - -if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") - set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL - "Causes lldb to export all symbols when building liblldb.") -else() - # Windows doesn't support toggling this, so don't bother making it a - # cache variable. - set(LLDB_EXPORT_ALL_SYMBOLS 0) -endif() - -if ((NOT MSVC) OR MSVC12) - add_definitions( -DHAVE_ROUND ) -endif() - -# Check if we libedit capable of handling wide characters (built with -# '--enable-widec'). -if (LLDB_ENABLE_LIBEDIT) - set(CMAKE_REQUIRED_LIBRARIES ${LibEdit_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES ${LibEdit_INCLUDE_DIRS}) - check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR) - set(CMAKE_EXTRA_INCLUDE_FILES histedit.h) - check_type_size(el_rfunc_t LLDB_EL_RFUNC_T_SIZE) - if (LLDB_EL_RFUNC_T_SIZE STREQUAL "") - set(LLDB_HAVE_EL_RFUNC_T 0) - else() - set(LLDB_HAVE_EL_RFUNC_T 1) - endif() - set(CMAKE_REQUIRED_LIBRARIES) - set(CMAKE_REQUIRED_INCLUDES) - set(CMAKE_EXTRA_INCLUDE_FILES) -endif() - -if (LLDB_ENABLE_PYTHON) - if(CMAKE_SYSTEM_NAME MATCHES "Windows") - set(default_embed_python_home ON) - else() - set(default_embed_python_home OFF) - endif() - option(LLDB_EMBED_PYTHON_HOME - "Embed PYTHONHOME in the binary. If set to OFF, PYTHONHOME environment variable will be used to to locate Python." - ${default_embed_python_home}) - - include_directories(${Python3_INCLUDE_DIRS}) - if (LLDB_EMBED_PYTHON_HOME) - get_filename_component(PYTHON_HOME "${Python3_EXECUTABLE}" DIRECTORY) - set(LLDB_PYTHON_HOME "${PYTHON_HOME}" CACHE STRING - "Path to use as PYTHONHOME in lldb. If a relative path is specified, it will be resolved at runtime relative to liblldb directory.") - endif() -endif() - -if (LLVM_EXTERNAL_CLANG_SOURCE_DIR) - include_directories(${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include) -else () - include_directories(${CMAKE_SOURCE_DIR}/tools/clang/include) -endif () -include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include") - -# Disable GCC warnings -check_cxx_compiler_flag("-Wno-deprecated-declarations" CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS) -append_if(CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wno-unknown-pragmas" CXX_SUPPORTS_NO_UNKNOWN_PRAGMAS) -append_if(CXX_SUPPORTS_NO_UNKNOWN_PRAGMAS "-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wno-strict-aliasing" CXX_SUPPORTS_NO_STRICT_ALIASING) -append_if(CXX_SUPPORTS_NO_STRICT_ALIASING "-Wno-strict-aliasing" CMAKE_CXX_FLAGS) - -# Disable Clang warnings -check_cxx_compiler_flag("-Wno-deprecated-register" CXX_SUPPORTS_NO_DEPRECATED_REGISTER) -append_if(CXX_SUPPORTS_NO_DEPRECATED_REGISTER "-Wno-deprecated-register" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wno-vla-extension" CXX_SUPPORTS_NO_VLA_EXTENSION) -append_if(CXX_SUPPORTS_NO_VLA_EXTENSION "-Wno-vla-extension" CMAKE_CXX_FLAGS) - -# Disable MSVC warnings -if( MSVC ) - add_definitions( - -wd4018 # Suppress 'warning C4018: '>=' : signed/unsigned mismatch' - -wd4068 # Suppress 'warning C4068: unknown pragma' - -wd4150 # Suppress 'warning C4150: deletion of pointer to incomplete type' - -wd4201 # Suppress 'warning C4201: nonstandard extension used: nameless struct/union' - -wd4251 # Suppress 'warning C4251: T must have dll-interface to be used by clients of class U.' - -wd4521 # Suppress 'warning C4521: 'type' : multiple copy constructors specified' - -wd4530 # Suppress 'warning C4530: C++ exception handler used, but unwind semantics are not enabled.' - ) -endif() - -# Use the Unicode (UTF-16) APIs by default on Win32 -if (CMAKE_SYSTEM_NAME MATCHES "Windows") - add_definitions( -D_UNICODE -DUNICODE ) -endif() - -# If LLDB_VERSION_* is specified, use it, if not use LLVM_VERSION_*. -if(NOT DEFINED LLDB_VERSION_MAJOR) - set(LLDB_VERSION_MAJOR ${LLVM_VERSION_MAJOR}) -endif() -if(NOT DEFINED LLDB_VERSION_MINOR) - set(LLDB_VERSION_MINOR ${LLVM_VERSION_MINOR}) -endif() -if(NOT DEFINED LLDB_VERSION_PATCH) - set(LLDB_VERSION_PATCH ${LLVM_VERSION_PATCH}) -endif() -if(NOT DEFINED LLDB_VERSION_SUFFIX) - set(LLDB_VERSION_SUFFIX ${LLVM_VERSION_SUFFIX}) -endif() -set(LLDB_VERSION "${LLDB_VERSION_MAJOR}.${LLDB_VERSION_MINOR}.${LLDB_VERSION_PATCH}${LLDB_VERSION_SUFFIX}") -message(STATUS "LLDB version: ${LLDB_VERSION}") - -if (LLDB_ENABLE_LZMA) - include_directories(${LIBLZMA_INCLUDE_DIRS}) -endif() - -if (LLDB_ENABLE_LIBXML2) - include_directories(${LIBXML2_INCLUDE_DIR}) -endif() - -include_directories(BEFORE - ${CMAKE_CURRENT_BINARY_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include - ) - -if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - install(DIRECTORY include/ - COMPONENT lldb-headers - DESTINATION include - FILES_MATCHING - PATTERN "*.h" - PATTERN ".cmake" EXCLUDE - ) - - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ - COMPONENT lldb-headers - DESTINATION include - FILES_MATCHING - PATTERN "*.h" - PATTERN ".cmake" EXCLUDE - ) - - add_custom_target(lldb-headers) - set_target_properties(lldb-headers PROPERTIES FOLDER "lldb misc") - - if (NOT CMAKE_CONFIGURATION_TYPES) - add_llvm_install_targets(install-lldb-headers - COMPONENT lldb-headers) - endif() -endif() - - -# If LLDB is building against a prebuilt Clang, then the Clang resource -# directory that LLDB is using for its embedded Clang instance needs to point -# to the resource directory of the used Clang installation. -if (NOT TARGET clang-resource-headers) - set(LLDB_CLANG_RESOURCE_DIR_NAME "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}") - # Iterate over the possible places where the external resource directory - # could be and pick the first that exists. - foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}" - "${LLVM_BUILD_LIBRARY_DIR}" - "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") - # Build the resource directory path by appending 'clang/'. - set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}") - if (IS_DIRECTORY "${CANDIDATE_RESOURCE_DIR}") - set(LLDB_EXTERNAL_CLANG_RESOURCE_DIR "${CANDIDATE_RESOURCE_DIR}") - break() - endif() - endforeach() - - if (NOT LLDB_EXTERNAL_CLANG_RESOURCE_DIR) - message(FATAL_ERROR "Expected directory for clang-resource headers not found: ${LLDB_EXTERNAL_CLANG_RESOURCE_DIR}") - endif() -endif() - -# Find Apple-specific libraries or frameworks that may be needed. -if (APPLE) - if(NOT APPLE_EMBEDDED) - find_library(CARBON_LIBRARY Carbon) - find_library(CORE_SERVICES_LIBRARY CoreServices) - endif() - find_library(FOUNDATION_LIBRARY Foundation) - find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) - find_library(SECURITY_LIBRARY Security) - include_directories(${LIBXML2_INCLUDE_DIR}) -endif() - -if( WIN32 AND NOT CYGWIN ) - set(PURE_WINDOWS 1) -endif() - -if(NOT PURE_WINDOWS) - set(CMAKE_THREAD_PREFER_PTHREAD TRUE) - find_package(Threads REQUIRED) -endif() - -# Figure out if lldb could use lldb-server. If so, then we'll -# ensure we build lldb-server when an lldb target is being built. -if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD|Windows") - set(LLDB_CAN_USE_LLDB_SERVER ON) -else() - set(LLDB_CAN_USE_LLDB_SERVER OFF) -endif() - -# Figure out if lldb could use debugserver. If so, then we'll -# ensure we build debugserver when we build lldb. -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - set(LLDB_CAN_USE_DEBUGSERVER ON) -else() - set(LLDB_CAN_USE_DEBUGSERVER OFF) -endif() - -if ((CMAKE_SYSTEM_NAME MATCHES "Android") AND LLVM_BUILD_STATIC AND - ((ANDROID_ABI MATCHES "armeabi") OR (ANDROID_ABI MATCHES "mips"))) - add_definitions(-DANDROID_USE_ACCEPT_WORKAROUND) -endif() - -include(LLDBGenerateConfig) diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni.h b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni.h deleted file mode 100644 index 730e502e35..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni.h +++ /dev/null @@ -1,1964 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* - * @(#)jni.h 1.62 06/02/02 - * - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. - */ - -/* - * We used part of Netscape's Java Runtime Interface (JRI) as the starting - * point of our design and implementation. - */ - -/****************************************************************************** - * Java Runtime Interface - * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. - *****************************************************************************/ - -#ifndef _JAVASOFT_JNI_H_ -#define _JAVASOFT_JNI_H_ - -#include -#include - -/* jni_md.h contains the machine-dependent typedefs for jbyte, jint - and jlong */ - -#include "jni_md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * JNI Types - */ - -#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H - -typedef unsigned char jboolean; -typedef unsigned short jchar; -typedef short jshort; -typedef float jfloat; -typedef double jdouble; - -typedef jint jsize; - -#ifdef __cplusplus - -class _jobject {}; -class _jclass : public _jobject {}; -class _jthrowable : public _jobject {}; -class _jstring : public _jobject {}; -class _jarray : public _jobject {}; -class _jbooleanArray : public _jarray {}; -class _jbyteArray : public _jarray {}; -class _jcharArray : public _jarray {}; -class _jshortArray : public _jarray {}; -class _jintArray : public _jarray {}; -class _jlongArray : public _jarray {}; -class _jfloatArray : public _jarray {}; -class _jdoubleArray : public _jarray {}; -class _jobjectArray : public _jarray {}; - -typedef _jobject *jobject; -typedef _jclass *jclass; -typedef _jthrowable *jthrowable; -typedef _jstring *jstring; -typedef _jarray *jarray; -typedef _jbooleanArray *jbooleanArray; -typedef _jbyteArray *jbyteArray; -typedef _jcharArray *jcharArray; -typedef _jshortArray *jshortArray; -typedef _jintArray *jintArray; -typedef _jlongArray *jlongArray; -typedef _jfloatArray *jfloatArray; -typedef _jdoubleArray *jdoubleArray; -typedef _jobjectArray *jobjectArray; - -#else - -struct _jobject; - -typedef struct _jobject *jobject; -typedef jobject jclass; -typedef jobject jthrowable; -typedef jobject jstring; -typedef jobject jarray; -typedef jarray jbooleanArray; -typedef jarray jbyteArray; -typedef jarray jcharArray; -typedef jarray jshortArray; -typedef jarray jintArray; -typedef jarray jlongArray; -typedef jarray jfloatArray; -typedef jarray jdoubleArray; -typedef jarray jobjectArray; - -#endif - -typedef jobject jweak; - -typedef union jvalue { - jboolean z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong j; - jfloat f; - jdouble d; - jobject l; -} jvalue; - -struct _jfieldID; -typedef struct _jfieldID *jfieldID; - -struct _jmethodID; -typedef struct _jmethodID *jmethodID; - -/* Return values from jobjectRefType */ -typedef enum _jobjectType { - JNIInvalidRefType = 0, - JNILocalRefType = 1, - JNIGlobalRefType = 2, - JNIWeakGlobalRefType = 3 -} jobjectRefType; - - -#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ - -/* - * jboolean constants - */ - -#define JNI_FALSE 0 -#define JNI_TRUE 1 - -/* - * possible return values for JNI functions. - */ - -#define JNI_OK 0 /* success */ -#define JNI_ERR (-1) /* unknown error */ -#define JNI_EDETACHED (-2) /* thread detached from the VM */ -#define JNI_EVERSION (-3) /* JNI version error */ -#define JNI_ENOMEM (-4) /* not enough memory */ -#define JNI_EEXIST (-5) /* VM already created */ -#define JNI_EINVAL (-6) /* invalid arguments */ - -/* - * used in ReleaseScalarArrayElements - */ - -#define JNI_COMMIT 1 -#define JNI_ABORT 2 - -/* - * used in RegisterNatives to describe native method name, signature, - * and function pointer. - */ - -typedef struct { - char *name; - char *signature; - void *fnPtr; -} JNINativeMethod; - -/* - * JNI Native Method Interface. - */ - -struct JNINativeInterface_; - -struct JNIEnv_; - -#ifdef __cplusplus -typedef JNIEnv_ JNIEnv; -#else -typedef const struct JNINativeInterface_ *JNIEnv; -#endif - -/* - * JNI Invocation Interface. - */ - -struct JNIInvokeInterface_; - -struct JavaVM_; - -#ifdef __cplusplus -typedef JavaVM_ JavaVM; -#else -typedef const struct JNIInvokeInterface_ *JavaVM; -#endif - -struct JNINativeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - void *reserved3; - -#if !TARGET_RT_MAC_CFM && defined(__ppc__) - void* cfm_vectors[225]; -#endif /* !TARGET_RT_MAC_CFM && defined(__ppc__) */ - - jint (JNICALL *GetVersion)(JNIEnv *env); - - jclass (JNICALL *DefineClass) - (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, - jsize len); - jclass (JNICALL *FindClass) - (JNIEnv *env, const char *name); - - jmethodID (JNICALL *FromReflectedMethod) - (JNIEnv *env, jobject method); - jfieldID (JNICALL *FromReflectedField) - (JNIEnv *env, jobject field); - - jobject (JNICALL *ToReflectedMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); - - jclass (JNICALL *GetSuperclass) - (JNIEnv *env, jclass sub); - jboolean (JNICALL *IsAssignableFrom) - (JNIEnv *env, jclass sub, jclass sup); - - jobject (JNICALL *ToReflectedField) - (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); - - jint (JNICALL *Throw) - (JNIEnv *env, jthrowable obj); - jint (JNICALL *ThrowNew) - (JNIEnv *env, jclass clazz, const char *msg); - jthrowable (JNICALL *ExceptionOccurred) - (JNIEnv *env); - void (JNICALL *ExceptionDescribe) - (JNIEnv *env); - void (JNICALL *ExceptionClear) - (JNIEnv *env); - void (JNICALL *FatalError) - (JNIEnv *env, const char *msg); - - jint (JNICALL *PushLocalFrame) - (JNIEnv *env, jint capacity); - jobject (JNICALL *PopLocalFrame) - (JNIEnv *env, jobject result); - - jobject (JNICALL *NewGlobalRef) - (JNIEnv *env, jobject lobj); - void (JNICALL *DeleteGlobalRef) - (JNIEnv *env, jobject gref); - void (JNICALL *DeleteLocalRef) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsSameObject) - (JNIEnv *env, jobject obj1, jobject obj2); - jobject (JNICALL *NewLocalRef) - (JNIEnv *env, jobject ref); - jint (JNICALL *EnsureLocalCapacity) - (JNIEnv *env, jint capacity); - - jobject (JNICALL *AllocObject) - (JNIEnv *env, jclass clazz); - jobject (JNICALL *NewObject) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *NewObjectV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *NewObjectA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jclass (JNICALL *GetObjectClass) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsInstanceOf) - (JNIEnv *env, jobject obj, jclass clazz); - - jmethodID (JNICALL *GetMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallObjectMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jobject (JNICALL *CallObjectMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jobject (JNICALL *CallObjectMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jboolean (JNICALL *CallBooleanMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jboolean (JNICALL *CallBooleanMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jboolean (JNICALL *CallBooleanMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jbyte (JNICALL *CallByteMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jbyte (JNICALL *CallByteMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jbyte (JNICALL *CallByteMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jchar (JNICALL *CallCharMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jchar (JNICALL *CallCharMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jchar (JNICALL *CallCharMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jshort (JNICALL *CallShortMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jshort (JNICALL *CallShortMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jshort (JNICALL *CallShortMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jint (JNICALL *CallIntMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jint (JNICALL *CallIntMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jint (JNICALL *CallIntMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jlong (JNICALL *CallLongMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jlong (JNICALL *CallLongMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jlong (JNICALL *CallLongMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jfloat (JNICALL *CallFloatMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jfloat (JNICALL *CallFloatMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jfloat (JNICALL *CallFloatMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - jdouble (JNICALL *CallDoubleMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jdouble (JNICALL *CallDoubleMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jdouble (JNICALL *CallDoubleMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); - - void (JNICALL *CallVoidMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - void (JNICALL *CallVoidMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - void (JNICALL *CallVoidMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); - - jobject (JNICALL *CallNonvirtualObjectMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallNonvirtualObjectMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jobject (JNICALL *CallNonvirtualObjectMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jboolean (JNICALL *CallNonvirtualBooleanMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallNonvirtualBooleanMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jboolean (JNICALL *CallNonvirtualBooleanMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jbyte (JNICALL *CallNonvirtualByteMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallNonvirtualByteMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jbyte (JNICALL *CallNonvirtualByteMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jchar (JNICALL *CallNonvirtualCharMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallNonvirtualCharMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jchar (JNICALL *CallNonvirtualCharMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jshort (JNICALL *CallNonvirtualShortMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallNonvirtualShortMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jshort (JNICALL *CallNonvirtualShortMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jint (JNICALL *CallNonvirtualIntMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallNonvirtualIntMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jint (JNICALL *CallNonvirtualIntMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jlong (JNICALL *CallNonvirtualLongMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallNonvirtualLongMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jlong (JNICALL *CallNonvirtualLongMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jfloat (JNICALL *CallNonvirtualFloatMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallNonvirtualFloatMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jfloat (JNICALL *CallNonvirtualFloatMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - jdouble (JNICALL *CallNonvirtualDoubleMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallNonvirtualDoubleMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jdouble (JNICALL *CallNonvirtualDoubleMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue *args); - - void (JNICALL *CallNonvirtualVoidMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - void (JNICALL *CallNonvirtualVoidMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - void (JNICALL *CallNonvirtualVoidMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - const jvalue * args); - - jfieldID (JNICALL *GetFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *GetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jboolean (JNICALL *GetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jbyte (JNICALL *GetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jchar (JNICALL *GetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jshort (JNICALL *GetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jint (JNICALL *GetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jlong (JNICALL *GetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jfloat (JNICALL *GetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jdouble (JNICALL *GetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - - void (JNICALL *SetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); - void (JNICALL *SetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); - void (JNICALL *SetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); - void (JNICALL *SetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); - void (JNICALL *SetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); - void (JNICALL *SetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); - void (JNICALL *SetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); - void (JNICALL *SetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); - void (JNICALL *SetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); - - jmethodID (JNICALL *GetStaticMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallStaticObjectMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallStaticObjectMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *CallStaticObjectMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jboolean (JNICALL *CallStaticBooleanMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallStaticBooleanMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jboolean (JNICALL *CallStaticBooleanMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jbyte (JNICALL *CallStaticByteMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallStaticByteMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jbyte (JNICALL *CallStaticByteMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jchar (JNICALL *CallStaticCharMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallStaticCharMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jchar (JNICALL *CallStaticCharMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jshort (JNICALL *CallStaticShortMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallStaticShortMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jshort (JNICALL *CallStaticShortMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jint (JNICALL *CallStaticIntMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallStaticIntMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jint (JNICALL *CallStaticIntMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jlong (JNICALL *CallStaticLongMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallStaticLongMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jlong (JNICALL *CallStaticLongMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jfloat (JNICALL *CallStaticFloatMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallStaticFloatMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jfloat (JNICALL *CallStaticFloatMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - jdouble (JNICALL *CallStaticDoubleMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallStaticDoubleMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jdouble (JNICALL *CallStaticDoubleMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); - - void (JNICALL *CallStaticVoidMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, ...); - void (JNICALL *CallStaticVoidMethodV) - (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); - void (JNICALL *CallStaticVoidMethodA) - (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); - - jfieldID (JNICALL *GetStaticFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - jobject (JNICALL *GetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jboolean (JNICALL *GetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jbyte (JNICALL *GetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jchar (JNICALL *GetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jshort (JNICALL *GetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jint (JNICALL *GetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jlong (JNICALL *GetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jfloat (JNICALL *GetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jdouble (JNICALL *GetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - - void (JNICALL *SetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); - void (JNICALL *SetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); - void (JNICALL *SetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); - void (JNICALL *SetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); - void (JNICALL *SetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); - void (JNICALL *SetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); - void (JNICALL *SetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); - void (JNICALL *SetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); - void (JNICALL *SetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); - - jstring (JNICALL *NewString) - (JNIEnv *env, const jchar *unicode, jsize len); - jsize (JNICALL *GetStringLength) - (JNIEnv *env, jstring str); - const jchar *(JNICALL *GetStringChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringChars) - (JNIEnv *env, jstring str, const jchar *chars); - - jstring (JNICALL *NewStringUTF) - (JNIEnv *env, const char *utf); - jsize (JNICALL *GetStringUTFLength) - (JNIEnv *env, jstring str); - const char* (JNICALL *GetStringUTFChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringUTFChars) - (JNIEnv *env, jstring str, const char* chars); - - - jsize (JNICALL *GetArrayLength) - (JNIEnv *env, jarray array); - - jobjectArray (JNICALL *NewObjectArray) - (JNIEnv *env, jsize len, jclass clazz, jobject init); - jobject (JNICALL *GetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index); - void (JNICALL *SetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index, jobject val); - - jbooleanArray (JNICALL *NewBooleanArray) - (JNIEnv *env, jsize len); - jbyteArray (JNICALL *NewByteArray) - (JNIEnv *env, jsize len); - jcharArray (JNICALL *NewCharArray) - (JNIEnv *env, jsize len); - jshortArray (JNICALL *NewShortArray) - (JNIEnv *env, jsize len); - jintArray (JNICALL *NewIntArray) - (JNIEnv *env, jsize len); - jlongArray (JNICALL *NewLongArray) - (JNIEnv *env, jsize len); - jfloatArray (JNICALL *NewFloatArray) - (JNIEnv *env, jsize len); - jdoubleArray (JNICALL *NewDoubleArray) - (JNIEnv *env, jsize len); - - jboolean * (JNICALL *GetBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *isCopy); - jbyte * (JNICALL *GetByteArrayElements) - (JNIEnv *env, jbyteArray array, jboolean *isCopy); - jchar * (JNICALL *GetCharArrayElements) - (JNIEnv *env, jcharArray array, jboolean *isCopy); - jshort * (JNICALL *GetShortArrayElements) - (JNIEnv *env, jshortArray array, jboolean *isCopy); - jint * (JNICALL *GetIntArrayElements) - (JNIEnv *env, jintArray array, jboolean *isCopy); - jlong * (JNICALL *GetLongArrayElements) - (JNIEnv *env, jlongArray array, jboolean *isCopy); - jfloat * (JNICALL *GetFloatArrayElements) - (JNIEnv *env, jfloatArray array, jboolean *isCopy); - jdouble * (JNICALL *GetDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jboolean *isCopy); - - void (JNICALL *ReleaseBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); - void (JNICALL *ReleaseByteArrayElements) - (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); - void (JNICALL *ReleaseCharArrayElements) - (JNIEnv *env, jcharArray array, jchar *elems, jint mode); - void (JNICALL *ReleaseShortArrayElements) - (JNIEnv *env, jshortArray array, jshort *elems, jint mode); - void (JNICALL *ReleaseIntArrayElements) - (JNIEnv *env, jintArray array, jint *elems, jint mode); - void (JNICALL *ReleaseLongArrayElements) - (JNIEnv *env, jlongArray array, jlong *elems, jint mode); - void (JNICALL *ReleaseFloatArrayElements) - (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); - void (JNICALL *ReleaseDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); - - void (JNICALL *GetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (JNICALL *GetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (JNICALL *GetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (JNICALL *GetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (JNICALL *GetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (JNICALL *GetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (JNICALL *GetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (JNICALL *GetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - void (JNICALL *SetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); - void (JNICALL *SetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); - void (JNICALL *SetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); - void (JNICALL *SetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); - void (JNICALL *SetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); - void (JNICALL *SetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); - void (JNICALL *SetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); - void (JNICALL *SetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); - - jint (JNICALL *RegisterNatives) - (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods); - jint (JNICALL *UnregisterNatives) - (JNIEnv *env, jclass clazz); - - jint (JNICALL *MonitorEnter) - (JNIEnv *env, jobject obj); - jint (JNICALL *MonitorExit) - (JNIEnv *env, jobject obj); - - jint (JNICALL *GetJavaVM) - (JNIEnv *env, JavaVM **vm); - - void (JNICALL *GetStringRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); - void (JNICALL *GetStringUTFRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); - - void * (JNICALL *GetPrimitiveArrayCritical) - (JNIEnv *env, jarray array, jboolean *isCopy); - void (JNICALL *ReleasePrimitiveArrayCritical) - (JNIEnv *env, jarray array, void *carray, jint mode); - - const jchar * (JNICALL *GetStringCritical) - (JNIEnv *env, jstring string, jboolean *isCopy); - void (JNICALL *ReleaseStringCritical) - (JNIEnv *env, jstring string, const jchar *cstring); - - jweak (JNICALL *NewWeakGlobalRef) - (JNIEnv *env, jobject obj); - void (JNICALL *DeleteWeakGlobalRef) - (JNIEnv *env, jweak ref); - - jboolean (JNICALL *ExceptionCheck) - (JNIEnv *env); - - jobject (JNICALL *NewDirectByteBuffer) - (JNIEnv* env, void* address, jlong capacity); - void* (JNICALL *GetDirectBufferAddress) - (JNIEnv* env, jobject buf); - jlong (JNICALL *GetDirectBufferCapacity) - (JNIEnv* env, jobject buf); - - /* New JNI 1.6 Features */ - - jobjectRefType (JNICALL *GetObjectRefType) - (JNIEnv* env, jobject obj); - - #if TARGET_RT_MAC_CFM && defined(__ppc__) - void* real_functions[228]; - #endif /* TARGET_RT_MAC_CFM && defined(__ppc__) */ -}; - -/* - * We use inlined functions for C++ so that programmers can write: - * - * env->FindClass("java/lang/String") - * - * in C++ rather than: - * - * (*env)->FindClass(env, "java/lang/String") - * - * in C. - */ - -struct JNIEnv_ { - const struct JNINativeInterface_ *functions; -#ifdef __cplusplus - - jint GetVersion() { - return functions->GetVersion(this); - } - jclass DefineClass(const char *name, jobject loader, const jbyte *buf, - jsize len) { - return functions->DefineClass(this, name, loader, buf, len); - } - jclass FindClass(const char *name) { - return functions->FindClass(this, name); - } - jmethodID FromReflectedMethod(jobject method) { - return functions->FromReflectedMethod(this,method); - } - jfieldID FromReflectedField(jobject field) { - return functions->FromReflectedField(this,field); - } - - jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { - return functions->ToReflectedMethod(this, cls, methodID, isStatic); - } - - jclass GetSuperclass(jclass sub) { - return functions->GetSuperclass(this, sub); - } - jboolean IsAssignableFrom(jclass sub, jclass sup) { - return functions->IsAssignableFrom(this, sub, sup); - } - - jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { - return functions->ToReflectedField(this,cls,fieldID,isStatic); - } - - jint Throw(jthrowable obj) { - return functions->Throw(this, obj); - } - jint ThrowNew(jclass clazz, const char *msg) { - return functions->ThrowNew(this, clazz, msg); - } - jthrowable ExceptionOccurred() { - return functions->ExceptionOccurred(this); - } - void ExceptionDescribe() { - functions->ExceptionDescribe(this); - } - void ExceptionClear() { - functions->ExceptionClear(this); - } - void FatalError(const char *msg) { - functions->FatalError(this, msg); - } - - jint PushLocalFrame(jint capacity) { - return functions->PushLocalFrame(this,capacity); - } - jobject PopLocalFrame(jobject result) { - return functions->PopLocalFrame(this,result); - } - - jobject NewGlobalRef(jobject lobj) { - return functions->NewGlobalRef(this,lobj); - } - void DeleteGlobalRef(jobject gref) { - functions->DeleteGlobalRef(this,gref); - } - void DeleteLocalRef(jobject obj) { - functions->DeleteLocalRef(this, obj); - } - - jboolean IsSameObject(jobject obj1, jobject obj2) { - return functions->IsSameObject(this,obj1,obj2); - } - - jobject NewLocalRef(jobject ref) { - return functions->NewLocalRef(this,ref); - } - jint EnsureLocalCapacity(jint capacity) { - return functions->EnsureLocalCapacity(this,capacity); - } - - jobject AllocObject(jclass clazz) { - return functions->AllocObject(this,clazz); - } - jobject NewObject(jclass clazz, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args, methodID); - result = functions->NewObjectV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject NewObjectV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->NewObjectV(this,clazz,methodID,args); - } - jobject NewObjectA(jclass clazz, jmethodID methodID, - const jvalue *args) { - return functions->NewObjectA(this,clazz,methodID,args); - } - - jclass GetObjectClass(jobject obj) { - return functions->GetObjectClass(this,obj); - } - jboolean IsInstanceOf(jobject obj, jclass clazz) { - return functions->IsInstanceOf(this,obj,clazz); - } - - jmethodID GetMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetMethodID(this,clazz,name,sig); - } - - jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallObjectMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jobject CallObjectMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallObjectMethodV(this,obj,methodID,args); - } - jobject CallObjectMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallObjectMethodA(this,obj,methodID,args); - } - - jboolean CallBooleanMethod(jobject obj, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallBooleanMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallBooleanMethodV(this,obj,methodID,args); - } - jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallBooleanMethodA(this,obj,methodID, args); - } - - jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallByteMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jbyte CallByteMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallByteMethodV(this,obj,methodID,args); - } - jbyte CallByteMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallByteMethodA(this,obj,methodID,args); - } - - jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallCharMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jchar CallCharMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallCharMethodV(this,obj,methodID,args); - } - jchar CallCharMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallCharMethodA(this,obj,methodID,args); - } - - jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallShortMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jshort CallShortMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallShortMethodV(this,obj,methodID,args); - } - jshort CallShortMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallShortMethodA(this,obj,methodID,args); - } - - jint CallIntMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallIntMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jint CallIntMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallIntMethodV(this,obj,methodID,args); - } - jint CallIntMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallIntMethodA(this,obj,methodID,args); - } - - jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallLongMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jlong CallLongMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallLongMethodV(this,obj,methodID,args); - } - jlong CallLongMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallLongMethodA(this,obj,methodID,args); - } - - jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallFloatMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jfloat CallFloatMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallFloatMethodV(this,obj,methodID,args); - } - jfloat CallFloatMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallFloatMethodA(this,obj,methodID,args); - } - - jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallDoubleMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallDoubleMethodV(this,obj,methodID,args); - } - jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - return functions->CallDoubleMethodA(this,obj,methodID,args); - } - - void CallVoidMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallVoidMethodV(this,obj,methodID,args); - va_end(args); - } - void CallVoidMethodV(jobject obj, jmethodID methodID, - va_list args) { - functions->CallVoidMethodV(this,obj,methodID,args); - } - void CallVoidMethodA(jobject obj, jmethodID methodID, - const jvalue * args) { - functions->CallVoidMethodA(this,obj,methodID,args); - } - - jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - } - jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualObjectMethodA(this,obj,clazz, - methodID,args); - } - - jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - } - jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, - methodID, args); - } - - jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - } - jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualByteMethodA(this,obj,clazz, - methodID,args); - } - - jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - } - jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualCharMethodA(this,obj,clazz, - methodID,args); - } - - jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - } - jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualShortMethodA(this,obj,clazz, - methodID,args); - } - - jint CallNonvirtualIntMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - } - jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualIntMethodA(this,obj,clazz, - methodID,args); - } - - jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - } - jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, - jmethodID methodID, const jvalue * args) { - return functions->CallNonvirtualLongMethodA(this,obj,clazz, - methodID,args); - } - - jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - } - jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - return functions->CallNonvirtualFloatMethodA(this,obj,clazz, - methodID,args); - } - - jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - } - jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, - methodID,args); - } - - void CallNonvirtualVoidMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - va_end(args); - } - void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - } - void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, - jmethodID methodID, - const jvalue * args) { - functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); - } - - jfieldID GetFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetFieldID(this,clazz,name,sig); - } - - jobject GetObjectField(jobject obj, jfieldID fieldID) { - return functions->GetObjectField(this,obj,fieldID); - } - jboolean GetBooleanField(jobject obj, jfieldID fieldID) { - return functions->GetBooleanField(this,obj,fieldID); - } - jbyte GetByteField(jobject obj, jfieldID fieldID) { - return functions->GetByteField(this,obj,fieldID); - } - jchar GetCharField(jobject obj, jfieldID fieldID) { - return functions->GetCharField(this,obj,fieldID); - } - jshort GetShortField(jobject obj, jfieldID fieldID) { - return functions->GetShortField(this,obj,fieldID); - } - jint GetIntField(jobject obj, jfieldID fieldID) { - return functions->GetIntField(this,obj,fieldID); - } - jlong GetLongField(jobject obj, jfieldID fieldID) { - return functions->GetLongField(this,obj,fieldID); - } - jfloat GetFloatField(jobject obj, jfieldID fieldID) { - return functions->GetFloatField(this,obj,fieldID); - } - jdouble GetDoubleField(jobject obj, jfieldID fieldID) { - return functions->GetDoubleField(this,obj,fieldID); - } - - void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { - functions->SetObjectField(this,obj,fieldID,val); - } - void SetBooleanField(jobject obj, jfieldID fieldID, - jboolean val) { - functions->SetBooleanField(this,obj,fieldID,val); - } - void SetByteField(jobject obj, jfieldID fieldID, - jbyte val) { - functions->SetByteField(this,obj,fieldID,val); - } - void SetCharField(jobject obj, jfieldID fieldID, - jchar val) { - functions->SetCharField(this,obj,fieldID,val); - } - void SetShortField(jobject obj, jfieldID fieldID, - jshort val) { - functions->SetShortField(this,obj,fieldID,val); - } - void SetIntField(jobject obj, jfieldID fieldID, - jint val) { - functions->SetIntField(this,obj,fieldID,val); - } - void SetLongField(jobject obj, jfieldID fieldID, - jlong val) { - functions->SetLongField(this,obj,fieldID,val); - } - void SetFloatField(jobject obj, jfieldID fieldID, - jfloat val) { - functions->SetFloatField(this,obj,fieldID,val); - } - void SetDoubleField(jobject obj, jfieldID fieldID, - jdouble val) { - functions->SetDoubleField(this,obj,fieldID,val); - } - - jmethodID GetStaticMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticMethodID(this,clazz,name,sig); - } - - jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, - ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->CallStaticObjectMethodV(this,clazz,methodID,args); - } - jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, - const jvalue *args) { - return functions->CallStaticObjectMethodA(this,clazz,methodID,args); - } - - jboolean CallStaticBooleanMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jboolean CallStaticBooleanMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - } - jboolean CallStaticBooleanMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); - } - - jbyte CallStaticByteMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallStaticByteMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jbyte CallStaticByteMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticByteMethodV(this,clazz,methodID,args); - } - jbyte CallStaticByteMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticByteMethodA(this,clazz,methodID,args); - } - - jchar CallStaticCharMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallStaticCharMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jchar CallStaticCharMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticCharMethodV(this,clazz,methodID,args); - } - jchar CallStaticCharMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticCharMethodA(this,clazz,methodID,args); - } - - jshort CallStaticShortMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallStaticShortMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jshort CallStaticShortMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticShortMethodV(this,clazz,methodID,args); - } - jshort CallStaticShortMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticShortMethodA(this,clazz,methodID,args); - } - - jint CallStaticIntMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallStaticIntMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jint CallStaticIntMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticIntMethodV(this,clazz,methodID,args); - } - jint CallStaticIntMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticIntMethodA(this,clazz,methodID,args); - } - - jlong CallStaticLongMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallStaticLongMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jlong CallStaticLongMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticLongMethodV(this,clazz,methodID,args); - } - jlong CallStaticLongMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticLongMethodA(this,clazz,methodID,args); - } - - jfloat CallStaticFloatMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jfloat CallStaticFloatMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticFloatMethodV(this,clazz,methodID,args); - } - jfloat CallStaticFloatMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticFloatMethodA(this,clazz,methodID,args); - } - - jdouble CallStaticDoubleMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jdouble CallStaticDoubleMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - } - jdouble CallStaticDoubleMethodA(jclass clazz, - jmethodID methodID, const jvalue *args) { - return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); - } - - void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallStaticVoidMethodV(this,cls,methodID,args); - va_end(args); - } - void CallStaticVoidMethodV(jclass cls, jmethodID methodID, - va_list args) { - functions->CallStaticVoidMethodV(this,cls,methodID,args); - } - void CallStaticVoidMethodA(jclass cls, jmethodID methodID, - const jvalue * args) { - functions->CallStaticVoidMethodA(this,cls,methodID,args); - } - - jfieldID GetStaticFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticFieldID(this,clazz,name,sig); - } - jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticObjectField(this,clazz,fieldID); - } - jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticBooleanField(this,clazz,fieldID); - } - jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticByteField(this,clazz,fieldID); - } - jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticCharField(this,clazz,fieldID); - } - jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticShortField(this,clazz,fieldID); - } - jint GetStaticIntField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticIntField(this,clazz,fieldID); - } - jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticLongField(this,clazz,fieldID); - } - jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticFloatField(this,clazz,fieldID); - } - jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticDoubleField(this,clazz,fieldID); - } - - void SetStaticObjectField(jclass clazz, jfieldID fieldID, - jobject value) { - functions->SetStaticObjectField(this,clazz,fieldID,value); - } - void SetStaticBooleanField(jclass clazz, jfieldID fieldID, - jboolean value) { - functions->SetStaticBooleanField(this,clazz,fieldID,value); - } - void SetStaticByteField(jclass clazz, jfieldID fieldID, - jbyte value) { - functions->SetStaticByteField(this,clazz,fieldID,value); - } - void SetStaticCharField(jclass clazz, jfieldID fieldID, - jchar value) { - functions->SetStaticCharField(this,clazz,fieldID,value); - } - void SetStaticShortField(jclass clazz, jfieldID fieldID, - jshort value) { - functions->SetStaticShortField(this,clazz,fieldID,value); - } - void SetStaticIntField(jclass clazz, jfieldID fieldID, - jint value) { - functions->SetStaticIntField(this,clazz,fieldID,value); - } - void SetStaticLongField(jclass clazz, jfieldID fieldID, - jlong value) { - functions->SetStaticLongField(this,clazz,fieldID,value); - } - void SetStaticFloatField(jclass clazz, jfieldID fieldID, - jfloat value) { - functions->SetStaticFloatField(this,clazz,fieldID,value); - } - void SetStaticDoubleField(jclass clazz, jfieldID fieldID, - jdouble value) { - functions->SetStaticDoubleField(this,clazz,fieldID,value); - } - - jstring NewString(const jchar *unicode, jsize len) { - return functions->NewString(this,unicode,len); - } - jsize GetStringLength(jstring str) { - return functions->GetStringLength(this,str); - } - const jchar *GetStringChars(jstring str, jboolean *isCopy) { - return functions->GetStringChars(this,str,isCopy); - } - void ReleaseStringChars(jstring str, const jchar *chars) { - functions->ReleaseStringChars(this,str,chars); - } - - jstring NewStringUTF(const char *utf) { - return functions->NewStringUTF(this,utf); - } - jsize GetStringUTFLength(jstring str) { - return functions->GetStringUTFLength(this,str); - } - const char* GetStringUTFChars(jstring str, jboolean *isCopy) { - return functions->GetStringUTFChars(this,str,isCopy); - } - void ReleaseStringUTFChars(jstring str, const char* chars) { - functions->ReleaseStringUTFChars(this,str,chars); - } - - jsize GetArrayLength(jarray array) { - return functions->GetArrayLength(this,array); - } - - jobjectArray NewObjectArray(jsize len, jclass clazz, - jobject init) { - return functions->NewObjectArray(this,len,clazz,init); - } - jobject GetObjectArrayElement(jobjectArray array, jsize index) { - return functions->GetObjectArrayElement(this,array,index); - } - void SetObjectArrayElement(jobjectArray array, jsize index, - jobject val) { - functions->SetObjectArrayElement(this,array,index,val); - } - - jbooleanArray NewBooleanArray(jsize len) { - return functions->NewBooleanArray(this,len); - } - jbyteArray NewByteArray(jsize len) { - return functions->NewByteArray(this,len); - } - jcharArray NewCharArray(jsize len) { - return functions->NewCharArray(this,len); - } - jshortArray NewShortArray(jsize len) { - return functions->NewShortArray(this,len); - } - jintArray NewIntArray(jsize len) { - return functions->NewIntArray(this,len); - } - jlongArray NewLongArray(jsize len) { - return functions->NewLongArray(this,len); - } - jfloatArray NewFloatArray(jsize len) { - return functions->NewFloatArray(this,len); - } - jdoubleArray NewDoubleArray(jsize len) { - return functions->NewDoubleArray(this,len); - } - - jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { - return functions->GetBooleanArrayElements(this,array,isCopy); - } - jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { - return functions->GetByteArrayElements(this,array,isCopy); - } - jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { - return functions->GetCharArrayElements(this,array,isCopy); - } - jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { - return functions->GetShortArrayElements(this,array,isCopy); - } - jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { - return functions->GetIntArrayElements(this,array,isCopy); - } - jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { - return functions->GetLongArrayElements(this,array,isCopy); - } - jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { - return functions->GetFloatArrayElements(this,array,isCopy); - } - jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { - return functions->GetDoubleArrayElements(this,array,isCopy); - } - - void ReleaseBooleanArrayElements(jbooleanArray array, - jboolean *elems, - jint mode) { - functions->ReleaseBooleanArrayElements(this,array,elems,mode); - } - void ReleaseByteArrayElements(jbyteArray array, - jbyte *elems, - jint mode) { - functions->ReleaseByteArrayElements(this,array,elems,mode); - } - void ReleaseCharArrayElements(jcharArray array, - jchar *elems, - jint mode) { - functions->ReleaseCharArrayElements(this,array,elems,mode); - } - void ReleaseShortArrayElements(jshortArray array, - jshort *elems, - jint mode) { - functions->ReleaseShortArrayElements(this,array,elems,mode); - } - void ReleaseIntArrayElements(jintArray array, - jint *elems, - jint mode) { - functions->ReleaseIntArrayElements(this,array,elems,mode); - } - void ReleaseLongArrayElements(jlongArray array, - jlong *elems, - jint mode) { - functions->ReleaseLongArrayElements(this,array,elems,mode); - } - void ReleaseFloatArrayElements(jfloatArray array, - jfloat *elems, - jint mode) { - functions->ReleaseFloatArrayElements(this,array,elems,mode); - } - void ReleaseDoubleArrayElements(jdoubleArray array, - jdouble *elems, - jint mode) { - functions->ReleaseDoubleArrayElements(this,array,elems,mode); - } - - void GetBooleanArrayRegion(jbooleanArray array, - jsize start, jsize len, jboolean *buf) { - functions->GetBooleanArrayRegion(this,array,start,len,buf); - } - void GetByteArrayRegion(jbyteArray array, - jsize start, jsize len, jbyte *buf) { - functions->GetByteArrayRegion(this,array,start,len,buf); - } - void GetCharArrayRegion(jcharArray array, - jsize start, jsize len, jchar *buf) { - functions->GetCharArrayRegion(this,array,start,len,buf); - } - void GetShortArrayRegion(jshortArray array, - jsize start, jsize len, jshort *buf) { - functions->GetShortArrayRegion(this,array,start,len,buf); - } - void GetIntArrayRegion(jintArray array, - jsize start, jsize len, jint *buf) { - functions->GetIntArrayRegion(this,array,start,len,buf); - } - void GetLongArrayRegion(jlongArray array, - jsize start, jsize len, jlong *buf) { - functions->GetLongArrayRegion(this,array,start,len,buf); - } - void GetFloatArrayRegion(jfloatArray array, - jsize start, jsize len, jfloat *buf) { - functions->GetFloatArrayRegion(this,array,start,len,buf); - } - void GetDoubleArrayRegion(jdoubleArray array, - jsize start, jsize len, jdouble *buf) { - functions->GetDoubleArrayRegion(this,array,start,len,buf); - } - - void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, - const jboolean *buf) { - functions->SetBooleanArrayRegion(this,array,start,len,buf); - } - void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, - const jbyte *buf) { - functions->SetByteArrayRegion(this,array,start,len,buf); - } - void SetCharArrayRegion(jcharArray array, jsize start, jsize len, - const jchar *buf) { - functions->SetCharArrayRegion(this,array,start,len,buf); - } - void SetShortArrayRegion(jshortArray array, jsize start, jsize len, - const jshort *buf) { - functions->SetShortArrayRegion(this,array,start,len,buf); - } - void SetIntArrayRegion(jintArray array, jsize start, jsize len, - const jint *buf) { - functions->SetIntArrayRegion(this,array,start,len,buf); - } - void SetLongArrayRegion(jlongArray array, jsize start, jsize len, - const jlong *buf) { - functions->SetLongArrayRegion(this,array,start,len,buf); - } - void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, - const jfloat *buf) { - functions->SetFloatArrayRegion(this,array,start,len,buf); - } - void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, - const jdouble *buf) { - functions->SetDoubleArrayRegion(this,array,start,len,buf); - } - - jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, - jint nMethods) { - return functions->RegisterNatives(this,clazz,methods,nMethods); - } - jint UnregisterNatives(jclass clazz) { - return functions->UnregisterNatives(this,clazz); - } - - jint MonitorEnter(jobject obj) { - return functions->MonitorEnter(this,obj); - } - jint MonitorExit(jobject obj) { - return functions->MonitorExit(this,obj); - } - - jint GetJavaVM(JavaVM **vm) { - return functions->GetJavaVM(this,vm); - } - - void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { - functions->GetStringRegion(this,str,start,len,buf); - } - void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { - functions->GetStringUTFRegion(this,str,start,len,buf); - } - - void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { - return functions->GetPrimitiveArrayCritical(this,array,isCopy); - } - void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { - functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); - } - - const jchar * GetStringCritical(jstring string, jboolean *isCopy) { - return functions->GetStringCritical(this,string,isCopy); - } - void ReleaseStringCritical(jstring string, const jchar *cstring) { - functions->ReleaseStringCritical(this,string,cstring); - } - - jweak NewWeakGlobalRef(jobject obj) { - return functions->NewWeakGlobalRef(this,obj); - } - void DeleteWeakGlobalRef(jweak ref) { - functions->DeleteWeakGlobalRef(this,ref); - } - - jboolean ExceptionCheck() { - return functions->ExceptionCheck(this); - } - - jobject NewDirectByteBuffer(void* address, jlong capacity) { - return functions->NewDirectByteBuffer(this, address, capacity); - } - void* GetDirectBufferAddress(jobject buf) { - return functions->GetDirectBufferAddress(this, buf); - } - jlong GetDirectBufferCapacity(jobject buf) { - return functions->GetDirectBufferCapacity(this, buf); - } - jobjectRefType GetObjectRefType(jobject obj) { - return functions->GetObjectRefType(this, obj); - } - -#endif /* __cplusplus */ -}; - -typedef struct JavaVMOption { - char *optionString; - void *extraInfo; -} JavaVMOption; - -typedef struct JavaVMInitArgs { - jint version; - - jint nOptions; - JavaVMOption *options; - jboolean ignoreUnrecognized; -} JavaVMInitArgs; - -typedef struct JavaVMAttachArgs { - jint version; - - char *name; - jobject group; -} JavaVMAttachArgs; - -/* These will be VM-specific. */ - -#define JDK1_2 -#define JDK1_4 - -/* End VM-specific. */ - -struct JNIInvokeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - -#if !TARGET_RT_MAC_CFM && defined(__ppc__) - void* cfm_vectors[4]; -#endif /* !TARGET_RT_MAC_CFM && defined(__ppc__) */ - - jint (JNICALL *DestroyJavaVM)(JavaVM *vm); - - jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); - - jint (JNICALL *DetachCurrentThread)(JavaVM *vm); - - jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); - - jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); - -#if TARGET_RT_MAC_CFM && defined(__ppc__) - void* real_functions[5]; -#endif /* TARGET_RT_MAC_CFM && defined(__ppc__) */ -}; - -struct JavaVM_ { - const struct JNIInvokeInterface_ *functions; -#ifdef __cplusplus - - jint DestroyJavaVM() { - return functions->DestroyJavaVM(this); - } - jint AttachCurrentThread(void **penv, void *args) { - return functions->AttachCurrentThread(this, penv, args); - } - jint DetachCurrentThread() { - return functions->DetachCurrentThread(this); - } - - jint GetEnv(void **penv, jint version) { - return functions->GetEnv(this, penv, version); - } - jint AttachCurrentThreadAsDaemon(void **penv, void *args) { - return functions->AttachCurrentThreadAsDaemon(this, penv, args); - } -#endif -}; - -#ifdef _JNI_IMPLEMENTATION_ -#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT -#else -#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT -#endif -_JNI_IMPORT_OR_EXPORT_ __attribute__((deprecated)) jint JNICALL -JNI_GetDefaultJavaVMInitArgs(void *args); - -_JNI_IMPORT_OR_EXPORT_ __attribute__((deprecated)) jint JNICALL -JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); - -_JNI_IMPORT_OR_EXPORT_ __attribute__((deprecated)) jint JNICALL -JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); - -/* Defined by native libraries. */ -JNIEXPORT jint JNICALL -JNI_OnLoad(JavaVM *vm, void *reserved); - -JNIEXPORT void JNICALL -JNI_OnUnload(JavaVM *vm, void *reserved); - -#define JNI_VERSION_1_1 0x00010001 -#define JNI_VERSION_1_2 0x00010002 -#define JNI_VERSION_1_4 0x00010004 -#define JNI_VERSION_1_6 0x00010006 - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* !_JAVASOFT_JNI_H_ */ - - - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni_md.h b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni_md.h deleted file mode 100644 index d71d676ad7..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/jni_md.h +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* - * @(#)jni_md.h 1.19 05/11/17 - * - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. - */ - -#ifndef _JAVASOFT_JNI_MD_H_ -#define _JAVASOFT_JNI_MD_H_ - -#define JNIEXPORT __attribute__((visibility("default"))) -#define JNIIMPORT -#define JNICALL - -#if defined(__LP64__) && __LP64__ /* for -Wundef */ -typedef int jint; -#else -typedef long jint; -#endif -typedef long long jlong; -typedef signed char jbyte; - -#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/lldb/Host/Config.h.cmake b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/lldb/Host/Config.h.cmake deleted file mode 100644 index 9f86ec47ed..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/include/lldb/Host/Config.h.cmake +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -//===-- Config.h -----------------------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef LLDB_HOST_CONFIG_H -#define LLDB_HOST_CONFIG_H - -#cmakedefine01 LLDB_EDITLINE_USE_WCHAR - -#cmakedefine01 LLDB_HAVE_EL_RFUNC_T - - -#cmakedefine01 HAVE_SYS_TYPES_H - -#cmakedefine01 HAVE_SYS_EVENT_H - -#cmakedefine01 HAVE_PPOLL - -#cmakedefine01 HAVE_PTSNAME_R - -#cmakedefine01 HAVE_SIGACTION - -#cmakedefine01 HAVE_PROCESS_VM_READV - -#cmakedefine01 HAVE_NR_PROCESS_VM_READV - -#ifndef HAVE_LIBCOMPRESSION -#cmakedefine HAVE_LIBCOMPRESSION -#endif - -#cmakedefine01 LLDB_ENABLE_POSIX - -#cmakedefine01 LLDB_ENABLE_TERMIOS - -#cmakedefine01 LLDB_ENABLE_LZMA - -#cmakedefine01 LLDB_ENABLE_CURSES - -#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H - -#cmakedefine01 LLDB_ENABLE_LIBEDIT - -#cmakedefine01 LLDB_ENABLE_LIBXML2 - -#cmakedefine01 LLDB_ENABLE_LUA - -#cmakedefine01 LLDB_ENABLE_PYTHON - -#cmakedefine01 LLDB_ENABLE_JAVA - -#cmakedefine01 LLDB_EMBED_PYTHON_HOME - -#cmakedefine LLDB_PYTHON_HOME R"(${LLDB_PYTHON_HOME})" - -#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" - -#endif // #ifndef LLDB_HOST_CONFIG_H diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/CMakeLists.txt deleted file mode 100644 index 1e255457ec..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/CMakeLists.txt +++ /dev/null @@ -1,247 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - add_definitions( -DEXPORT_LIBLLDB ) -endif() - -get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS) - -if(LLDB_BUILD_FRAMEWORK) - set(option_install_prefix INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_DIR}) - set(option_framework FRAMEWORK) -endif() - -if(LLDB_ENABLE_PYTHON) - get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) - set(lldb_python_wrapper ${python_bindings_dir}/LLDBWrapPython.cpp) -endif() - -if(LLDB_ENABLE_LUA) - get_target_property(lua_bindings_dir swig_wrapper_lua BINARY_DIR) - set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp) -endif() - -if(LLDB_ENABLE_JAVA) - get_target_property(java_bindings_dir swig_wrapper_java BINARY_DIR) - set(lldb_java_wrapper ${java_bindings_dir}/LLDBWrapJava.cpp) -endif() - -add_lldb_library(liblldb SHARED ${option_framework} - SBAddress.cpp - SBAttachInfo.cpp - SBBlock.cpp - SBBreakpoint.cpp - SBBreakpointLocation.cpp - SBBreakpointName.cpp - SBBreakpointOptionCommon.cpp - SBBroadcaster.cpp - SBCommandInterpreter.cpp - SBCommandInterpreterRunOptions.cpp - SBCommandReturnObject.cpp - SBCommunication.cpp - SBCompileUnit.cpp - SBData.cpp - SBDebugger.cpp - SBDeclaration.cpp - SBEnvironment.cpp - SBError.cpp - SBEvent.cpp - SBExecutionContext.cpp - SBExpressionOptions.cpp - SBFileSpec.cpp - SBFile.cpp - SBFileSpecList.cpp - SBFrame.cpp - SBFunction.cpp - SBHostOS.cpp - SBInstruction.cpp - SBInstructionList.cpp - SBLanguageRuntime.cpp - SBLaunchInfo.cpp - SBLineEntry.cpp - SBListener.cpp - SBMemoryRegionInfo.cpp - SBMemoryRegionInfoList.cpp - SBModule.cpp - SBModuleSpec.cpp - SBPlatform.cpp - SBProcess.cpp - SBProcessInfo.cpp - SBQueue.cpp - SBQueueItem.cpp - SBReproducer.cpp - SBSection.cpp - SBSourceManager.cpp - SBStream.cpp - SBStringList.cpp - SBStructuredData.cpp - SBSymbol.cpp - SBSymbolContext.cpp - SBSymbolContextList.cpp - SBTarget.cpp - SBThread.cpp - SBThreadCollection.cpp - SBThreadPlan.cpp - SBTrace.cpp - SBTraceOptions.cpp - SBType.cpp - SBTypeCategory.cpp - SBTypeEnumMember.cpp - SBTypeFilter.cpp - SBTypeFormat.cpp - SBTypeNameSpecifier.cpp - SBTypeSummary.cpp - SBTypeSynthetic.cpp - SBValue.cpp - SBValueList.cpp - SBVariablesOptions.cpp - SBWatchpoint.cpp - SBUnixSignals.cpp - SystemInitializerFull.cpp - ${lldb_python_wrapper} - ${lldb_lua_wrapper} - ${lldb_java_wrapper} - - LINK_LIBS - lldbBase - lldbBreakpoint - lldbCore - lldbDataFormatters - lldbExpression - lldbHost - lldbInitialization - lldbInterpreter - lldbSymbol - lldbTarget - lldbUtility - ${LLDB_ALL_PLUGINS} - LINK_COMPONENTS - Support - - ${option_install_prefix} -) - -# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so, -# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so -# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so -# that _lldb.so can be loaded from Python. -if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE) - set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}") -endif() - -if(Python3_RPATH) - set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}") - set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") -endif() - - -if(LLDB_ENABLE_PYTHON) - add_dependencies(liblldb swig_wrapper_python) - - if (MSVC) - set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0") - else() - set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w") - endif() - - set_source_files_properties(${lldb_python_wrapper} PROPERTIES GENERATED ON) - if (CLANG_CL) - set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING - PROPERTY COMPILE_FLAGS " -Wno-unused-function") - endif() - if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND - NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") - set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING - PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual") - endif () -endif() - -if(LLDB_ENABLE_LUA) - add_dependencies(liblldb swig_wrapper_lua) - target_include_directories(liblldb PRIVATE ${LUA_INCLUDE_DIR}) - - if (MSVC) - set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0") - else() - set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w") - endif() - - set_source_files_properties(${lldb_lua_wrapper} PROPERTIES GENERATED ON) -endif() - -if(LLDB_ENABLE_JAVA) - add_dependencies(liblldb swig_wrapper_java) - target_include_directories(liblldb PRIVATE ${JAVA_INCLUDE_DIR}) - target_include_directories(liblldb PRIVATE ${JAVA_INCLUDE_DIR}/darwin) - - if (MSVC) - set_property(SOURCE ${lldb_java_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0") - else() - set_property(SOURCE ${lldb_java_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " ") - endif() - - set_source_files_properties(${lldb_java_wrapper} PROPERTIES GENERATED ON) -endif() - - -set_target_properties(liblldb - PROPERTIES - VERSION ${LLDB_VERSION} -) - -if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") - if (NOT LLDB_EXPORT_ALL_SYMBOLS) - # If we're not exporting all symbols, we'll want to explicitly set - # the exported symbols here. This prevents 'log enable --stack ...' - # from working on some systems but limits the liblldb size. - MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb namespace") - add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports) - else() - # Don't use an explicit export. Instead, tell the linker to - # export all symbols. - MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces") - add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports) - endif() - set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc") -endif() - -if (MSVC) - # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs, - # so only it needs to explicitly link against ${Python3_LIBRARIES} - if (LLDB_ENABLE_PYTHON) - target_link_libraries(liblldb PRIVATE ${Python3_LIBRARIES}) - endif() -else() - set_target_properties(liblldb - PROPERTIES - OUTPUT_NAME lldb - ) -endif() - -# The Clang expression parser in LLDB requires the Clang resource directory to function. -if (TARGET clang-resource-headers) - # If building alongside Clang, just add a dependency to ensure it is build together with liblldb. - add_dependencies(liblldb clang-resource-headers) -else() - # In a standalone build create a symlink from the LLDB library directory that points to the - # resource directory in the Clang library directory. LLDB searches relative to its install path, - # and the symlink is created in the same relative path as the resource directory of Clang when - # building alongside Clang. - # When building the LLDB framework, this isn't necessary as there we copy everything we need into - # the framework (including the Clang resourece directory). - if(NOT LLDB_BUILD_FRAMEWORK) - set(LLDB_CLANG_RESOURCE_DIR_PARENT "$/clang") - file(MAKE_DIRECTORY "${LLDB_CLANG_RESOURCE_DIR_PARENT}") - add_custom_command(TARGET liblldb POST_BUILD - COMMENT "Linking Clang resource dir into LLDB build directory: ${LLDB_CLANG_RESOURCE_DIR_PARENT}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${LLDB_CLANG_RESOURCE_DIR_PARENT}" - COMMAND ${CMAKE_COMMAND} -E create_symlink "${LLDB_EXTERNAL_CLANG_RESOURCE_DIR}" - "${LLDB_CLANG_RESOURCE_DIR_PARENT}/${LLDB_CLANG_RESOURCE_DIR_NAME}" - ) - endif() -endif() - -if(LLDB_BUILD_FRAMEWORK) - include(LLDBFramework) -endif() diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/SBDebugger.cpp b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/SBDebugger.cpp deleted file mode 100644 index 5cf4887048..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/SBDebugger.cpp +++ /dev/null @@ -1,1904 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -//===-- SBDebugger.cpp ----------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "SBReproducerPrivate.h" -#include "SystemInitializerFull.h" - -#include "lldb/API/SBDebugger.h" - -#include "lldb/lldb-private.h" - -#include "lldb/API/SBBroadcaster.h" -#include "lldb/API/SBCommandInterpreter.h" -#include "lldb/API/SBCommandInterpreterRunOptions.h" -#include "lldb/API/SBCommandReturnObject.h" -#include "lldb/API/SBError.h" -#include "lldb/API/SBEvent.h" -#include "lldb/API/SBFile.h" -#include "lldb/API/SBFrame.h" -#include "lldb/API/SBListener.h" -#include "lldb/API/SBProcess.h" -#include "lldb/API/SBSourceManager.h" -#include "lldb/API/SBStream.h" -#include "lldb/API/SBStringList.h" -#include "lldb/API/SBStructuredData.h" -#include "lldb/API/SBTarget.h" -#include "lldb/API/SBThread.h" -#include "lldb/API/SBTypeCategory.h" -#include "lldb/API/SBTypeFilter.h" -#include "lldb/API/SBTypeFormat.h" -#include "lldb/API/SBTypeNameSpecifier.h" -#include "lldb/API/SBTypeSummary.h" -#include "lldb/API/SBTypeSynthetic.h" - -#include "lldb/Core/Debugger.h" -#include "lldb/Core/PluginManager.h" -#include "lldb/Core/Progress.h" -#include "lldb/Core/StreamFile.h" -#include "lldb/Core/StructuredDataImpl.h" -#include "lldb/DataFormatters/DataVisualization.h" -#include "lldb/Host/Config.h" -#include "lldb/Host/XML.h" -#include "lldb/Initialization/SystemLifetimeManager.h" -#include "lldb/Interpreter/CommandInterpreter.h" -#include "lldb/Interpreter/OptionArgParser.h" -#include "lldb/Interpreter/OptionGroupPlatform.h" -#include "lldb/Target/Process.h" -#include "lldb/Target/TargetList.h" -#include "lldb/Utility/Args.h" -#include "lldb/Utility/State.h" - -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/DynamicLibrary.h" -#include "llvm/Support/ManagedStatic.h" - -using namespace lldb; -using namespace lldb_private; - -static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp, - const FileSpec &spec, - Status &error) { - llvm::sys::DynamicLibrary dynlib = - llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str()); - if (dynlib.isValid()) { - typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger & debugger); - - lldb::SBDebugger debugger_sb(debugger_sp); - // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger) - // function. - // TODO: mangle this differently for your system - on OSX, the first - // underscore needs to be removed and the second one stays - LLDBCommandPluginInit init_func = - (LLDBCommandPluginInit)(uintptr_t)dynlib.getAddressOfSymbol( - "_ZN4lldb16PluginInitializeENS_10SBDebuggerE"); - if (init_func) { - if (init_func(debugger_sb)) - return dynlib; - else - error.SetErrorString("plug-in refused to load " - "(lldb::PluginInitialize(lldb::SBDebugger) " - "returned false)"); - } else { - error.SetErrorString("plug-in is missing the required initialization: " - "lldb::PluginInitialize(lldb::SBDebugger)"); - } - } else { - if (FileSystem::Instance().Exists(spec)) - error.SetErrorString("this file does not represent a loadable dylib"); - else - error.SetErrorString("no such file"); - } - return llvm::sys::DynamicLibrary(); -} - -static llvm::ManagedStatic g_debugger_lifetime; - -SBError SBInputReader::Initialize( - lldb::SBDebugger &sb_debugger, - unsigned long (*callback)(void *, lldb::SBInputReader *, - lldb::InputReaderAction, char const *, - unsigned long), - void *a, lldb::InputReaderGranularity b, char const *c, char const *d, - bool e) { - LLDB_RECORD_DUMMY( - lldb::SBError, SBInputReader, Initialize, - (lldb::SBDebugger &, - unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction, - const char *, unsigned long), - void *, lldb::InputReaderGranularity, const char *, const char *, bool), - sb_debugger, callback, a, b, c, d, e); - - return SBError(); -} - -void SBInputReader::SetIsDone(bool b) { - LLDB_RECORD_METHOD(void, SBInputReader, SetIsDone, (bool), b); -} - -bool SBInputReader::IsActive() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBInputReader, IsActive); - - return false; -} - -SBDebugger::SBDebugger() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBDebugger); } - -SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp) - : m_opaque_sp(debugger_sp) { - LLDB_RECORD_CONSTRUCTOR(SBDebugger, (const lldb::DebuggerSP &), debugger_sp); -} - -SBDebugger::SBDebugger(const SBDebugger &rhs) : m_opaque_sp(rhs.m_opaque_sp) { - LLDB_RECORD_CONSTRUCTOR(SBDebugger, (const lldb::SBDebugger &), rhs); -} - -SBDebugger::~SBDebugger() = default; - -SBDebugger &SBDebugger::operator=(const SBDebugger &rhs) { - LLDB_RECORD_METHOD(lldb::SBDebugger &, - SBDebugger, operator=,(const lldb::SBDebugger &), rhs); - - if (this != &rhs) { - m_opaque_sp = rhs.m_opaque_sp; - } - return LLDB_RECORD_RESULT(*this); -} - -const char *SBDebugger::GetBroadcasterClass() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(const char *, SBDebugger, - GetBroadcasterClass); - - return Debugger::GetStaticBroadcasterClass().AsCString(); -} - -const char *SBDebugger::GetProgressFromEvent(const lldb::SBEvent &event, - uint64_t &progress_id, - uint64_t &completed, - uint64_t &total, - bool &is_debugger_specific) { - const Debugger::ProgressEventData *progress_data = - Debugger::ProgressEventData::GetEventDataFromEvent(event.get()); - if (progress_data == nullptr) - return nullptr; - progress_id = progress_data->GetID(); - completed = progress_data->GetCompleted(); - total = progress_data->GetTotal(); - is_debugger_specific = progress_data->IsDebuggerSpecific(); - // We must record the static method _after_ the out parameters have been - // filled in. - LLDB_RECORD_STATIC_METHOD( - const char *, SBDebugger, GetProgressFromEvent, - (const lldb::SBEvent &, uint64_t &, uint64_t &, uint64_t &, bool &), - event, progress_id, completed, total, is_debugger_specific); - return LLDB_RECORD_RESULT(progress_data->GetMessage().c_str()) -} - -SBBroadcaster SBDebugger::GetBroadcaster() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBroadcaster, SBDebugger, GetBroadcaster); - SBBroadcaster broadcaster(&m_opaque_sp->GetBroadcaster(), false); - return LLDB_RECORD_RESULT(broadcaster); -} - -void SBDebugger::Initialize() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, SBDebugger, Initialize); - SBError ignored = SBDebugger::InitializeWithErrorHandling(); -} - -lldb::SBError SBDebugger::InitializeWithErrorHandling() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(lldb::SBError, SBDebugger, - InitializeWithErrorHandling); - - SBError error; - if (auto e = g_debugger_lifetime->Initialize( - std::make_unique(), LoadPlugin)) { - error.SetError(Status(std::move(e))); - } - return LLDB_RECORD_RESULT(error); -} - -void SBDebugger::Terminate() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, SBDebugger, Terminate); - - g_debugger_lifetime->Terminate(); -} - -void SBDebugger::Clear() { - LLDB_RECORD_METHOD_NO_ARGS(void, SBDebugger, Clear); - - if (m_opaque_sp) - m_opaque_sp->ClearIOHandlers(); - - m_opaque_sp.reset(); -} - -SBDebugger SBDebugger::Create() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(lldb::SBDebugger, SBDebugger, Create); - - return LLDB_RECORD_RESULT(SBDebugger::Create(false, nullptr, nullptr)); -} - -SBDebugger SBDebugger::Create(bool source_init_files) { - LLDB_RECORD_STATIC_METHOD(lldb::SBDebugger, SBDebugger, Create, (bool), - source_init_files); - - return LLDB_RECORD_RESULT( - SBDebugger::Create(source_init_files, nullptr, nullptr)); -} - -SBDebugger SBDebugger::Create(bool source_init_files, - lldb::LogOutputCallback callback, void *baton) - -{ - LLDB_RECORD_DUMMY(lldb::SBDebugger, SBDebugger, Create, - (bool, lldb::LogOutputCallback, void *), source_init_files, - callback, baton); - - SBDebugger debugger; - - // Currently we have issues if this function is called simultaneously on two - // different threads. The issues mainly revolve around the fact that the - // lldb_private::FormatManager uses global collections and having two threads - // parsing the .lldbinit files can cause mayhem. So to get around this for - // now we need to use a mutex to prevent bad things from happening. - static std::recursive_mutex g_mutex; - std::lock_guard guard(g_mutex); - - debugger.reset(Debugger::CreateInstance(callback, baton)); - - SBCommandInterpreter interp = debugger.GetCommandInterpreter(); - if (source_init_files) { - interp.get()->SkipLLDBInitFiles(false); - interp.get()->SkipAppInitFiles(false); - SBCommandReturnObject result; - interp.SourceInitFileInHomeDirectory(result, false); - } else { - interp.get()->SkipLLDBInitFiles(true); - interp.get()->SkipAppInitFiles(true); - } - return debugger; -} - -void SBDebugger::Destroy(SBDebugger &debugger) { - LLDB_RECORD_STATIC_METHOD(void, SBDebugger, Destroy, (lldb::SBDebugger &), - debugger); - - Debugger::Destroy(debugger.m_opaque_sp); - - if (debugger.m_opaque_sp.get() != nullptr) - debugger.m_opaque_sp.reset(); -} - -void SBDebugger::MemoryPressureDetected() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, SBDebugger, MemoryPressureDetected); - - // Since this function can be call asynchronously, we allow it to be non- - // mandatory. We have seen deadlocks with this function when called so we - // need to safeguard against this until we can determine what is causing the - // deadlocks. - - const bool mandatory = false; - - ModuleList::RemoveOrphanSharedModules(mandatory); -} - -bool SBDebugger::IsValid() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBDebugger, IsValid); - return this->operator bool(); -} -SBDebugger::operator bool() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBDebugger, operator bool); - - return m_opaque_sp.get() != nullptr; -} - -void SBDebugger::SetAsync(bool b) { - LLDB_RECORD_METHOD(void, SBDebugger, SetAsync, (bool), b); - - if (m_opaque_sp) - m_opaque_sp->SetAsyncExecution(b); -} - -bool SBDebugger::GetAsync() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBDebugger, GetAsync); - - return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false); -} - -void SBDebugger::SkipLLDBInitFiles(bool b) { - LLDB_RECORD_METHOD(void, SBDebugger, SkipLLDBInitFiles, (bool), b); - - if (m_opaque_sp) - m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b); -} - -void SBDebugger::SkipAppInitFiles(bool b) { - LLDB_RECORD_METHOD(void, SBDebugger, SkipAppInitFiles, (bool), b); - - if (m_opaque_sp) - m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b); -} - -void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) { - LLDB_RECORD_METHOD(void, SBDebugger, SetInputFileHandle, (FILE *, bool), fh, - transfer_ownership); - SetInputFile((FileSP)std::make_shared(fh, transfer_ownership)); -} - -SBError SBDebugger::SetInputFile(FileSP file_sp) { - LLDB_RECORD_METHOD(SBError, SBDebugger, SetInputFile, (FileSP), file_sp); - return LLDB_RECORD_RESULT(SetInputFile(SBFile(file_sp))); -} - -// Shouldn't really be settable after initialization as this could cause lots -// of problems; don't want users trying to switch modes in the middle of a -// debugging session. -SBError SBDebugger::SetInputFile(SBFile file) { - LLDB_RECORD_METHOD(SBError, SBDebugger, SetInputFile, (SBFile), file); - - SBError error; - if (!m_opaque_sp) { - error.ref().SetErrorString("invalid debugger"); - return LLDB_RECORD_RESULT(error); - } - - repro::DataRecorder *recorder = nullptr; - if (repro::Generator *g = repro::Reproducer::Instance().GetGenerator()) - recorder = g->GetOrCreate().GetNewRecorder(); - - FileSP file_sp = file.m_opaque_sp; - - static std::unique_ptr> loader = - repro::MultiLoader::Create( - repro::Reproducer::Instance().GetLoader()); - if (loader) { - llvm::Optional nextfile = loader->GetNextFile(); - FILE *fh = nextfile ? FileSystem::Instance().Fopen(nextfile->c_str(), "r") - : nullptr; - // FIXME Jonas Devlieghere: shouldn't this error be propagated out to the - // reproducer somehow if fh is NULL? - if (fh) { - file_sp = std::make_shared(fh, true); - } - } - - if (!file_sp || !file_sp->IsValid()) { - error.ref().SetErrorString("invalid file"); - return LLDB_RECORD_RESULT(error); - } - - m_opaque_sp->SetInputFile(file_sp, recorder); - return LLDB_RECORD_RESULT(error); -} - -SBError SBDebugger::SetOutputFile(FileSP file_sp) { - LLDB_RECORD_METHOD(SBError, SBDebugger, SetOutputFile, (FileSP), file_sp); - return LLDB_RECORD_RESULT(SetOutputFile(SBFile(file_sp))); -} - -void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) { - LLDB_RECORD_METHOD(void, SBDebugger, SetOutputFileHandle, (FILE *, bool), fh, - transfer_ownership); - SetOutputFile((FileSP)std::make_shared(fh, transfer_ownership)); -} - -SBError SBDebugger::SetOutputFile(SBFile file) { - LLDB_RECORD_METHOD(SBError, SBDebugger, SetOutputFile, (SBFile file), file); - SBError error; - if (!m_opaque_sp) { - error.ref().SetErrorString("invalid debugger"); - return LLDB_RECORD_RESULT(error); - } - if (!file) { - error.ref().SetErrorString("invalid file"); - return LLDB_RECORD_RESULT(error); - } - m_opaque_sp->SetOutputFile(file.m_opaque_sp); - return LLDB_RECORD_RESULT(error); -} - -void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) { - LLDB_RECORD_METHOD(void, SBDebugger, SetErrorFileHandle, (FILE *, bool), fh, - transfer_ownership); - SetErrorFile((FileSP)std::make_shared(fh, transfer_ownership)); -} - -SBError SBDebugger::SetErrorFile(FileSP file_sp) { - LLDB_RECORD_METHOD(SBError, SBDebugger, SetErrorFile, (FileSP), file_sp); - return LLDB_RECORD_RESULT(SetErrorFile(SBFile(file_sp))); -} - -SBError SBDebugger::SetErrorFile(SBFile file) { - LLDB_RECORD_METHOD(SBError, SBDebugger, SetErrorFile, (SBFile file), file); - SBError error; - if (!m_opaque_sp) { - error.ref().SetErrorString("invalid debugger"); - return LLDB_RECORD_RESULT(error); - } - if (!file) { - error.ref().SetErrorString("invalid file"); - return LLDB_RECORD_RESULT(error); - } - m_opaque_sp->SetErrorFile(file.m_opaque_sp); - return LLDB_RECORD_RESULT(error); -} - -FILE *SBDebugger::GetInputFileHandle() { - LLDB_RECORD_METHOD_NO_ARGS(FILE *, SBDebugger, GetInputFileHandle); - if (m_opaque_sp) { - File &file_sp = m_opaque_sp->GetInputFile(); - return LLDB_RECORD_RESULT(file_sp.GetStream()); - } - return LLDB_RECORD_RESULT(nullptr); -} - -SBFile SBDebugger::GetInputFile() { - LLDB_RECORD_METHOD_NO_ARGS(SBFile, SBDebugger, GetInputFile); - if (m_opaque_sp) { - return LLDB_RECORD_RESULT(SBFile(m_opaque_sp->GetInputFileSP())); - } - return LLDB_RECORD_RESULT(SBFile()); -} - -FILE *SBDebugger::GetOutputFileHandle() { - LLDB_RECORD_METHOD_NO_ARGS(FILE *, SBDebugger, GetOutputFileHandle); - if (m_opaque_sp) { - StreamFile &stream_file = m_opaque_sp->GetOutputStream(); - return LLDB_RECORD_RESULT(stream_file.GetFile().GetStream()); - } - return LLDB_RECORD_RESULT(nullptr); -} - -SBFile SBDebugger::GetOutputFile() { - LLDB_RECORD_METHOD_NO_ARGS(SBFile, SBDebugger, GetOutputFile); - if (m_opaque_sp) { - SBFile file(m_opaque_sp->GetOutputStream().GetFileSP()); - return LLDB_RECORD_RESULT(file); - } - return LLDB_RECORD_RESULT(SBFile()); -} - -FILE *SBDebugger::GetErrorFileHandle() { - LLDB_RECORD_METHOD_NO_ARGS(FILE *, SBDebugger, GetErrorFileHandle); - - if (m_opaque_sp) { - StreamFile &stream_file = m_opaque_sp->GetErrorStream(); - return LLDB_RECORD_RESULT(stream_file.GetFile().GetStream()); - } - return LLDB_RECORD_RESULT(nullptr); -} - -SBFile SBDebugger::GetErrorFile() { - LLDB_RECORD_METHOD_NO_ARGS(SBFile, SBDebugger, GetErrorFile); - SBFile file; - if (m_opaque_sp) { - SBFile file(m_opaque_sp->GetErrorStream().GetFileSP()); - return LLDB_RECORD_RESULT(file); - } - return LLDB_RECORD_RESULT(SBFile()); -} - -void SBDebugger::SaveInputTerminalState() { - LLDB_RECORD_DUMMY_NO_ARGS(void, SBDebugger, SaveInputTerminalState); - - if (m_opaque_sp) - m_opaque_sp->SaveInputTerminalState(); -} - -void SBDebugger::RestoreInputTerminalState() { - LLDB_RECORD_DUMMY_NO_ARGS(void, SBDebugger, RestoreInputTerminalState); - - if (m_opaque_sp) - m_opaque_sp->RestoreInputTerminalState(); -} -SBCommandInterpreter SBDebugger::GetCommandInterpreter() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBCommandInterpreter, SBDebugger, - GetCommandInterpreter); - - SBCommandInterpreter sb_interpreter; - if (m_opaque_sp) - sb_interpreter.reset(&m_opaque_sp->GetCommandInterpreter()); - - return LLDB_RECORD_RESULT(sb_interpreter); -} - -void SBDebugger::HandleCommand(const char *command) { - LLDB_RECORD_METHOD(void, SBDebugger, HandleCommand, (const char *), command); - - if (m_opaque_sp) { - TargetSP target_sp(m_opaque_sp->GetSelectedTarget()); - std::unique_lock lock; - if (target_sp) - lock = std::unique_lock(target_sp->GetAPIMutex()); - - SBCommandInterpreter sb_interpreter(GetCommandInterpreter()); - SBCommandReturnObject result; - - sb_interpreter.HandleCommand(command, result, false); - - result.PutError(m_opaque_sp->GetErrorStream().GetFileSP()); - result.PutOutput(m_opaque_sp->GetOutputStream().GetFileSP()); - - if (!m_opaque_sp->GetAsyncExecution()) { - SBProcess process(GetCommandInterpreter().GetProcess()); - ProcessSP process_sp(process.GetSP()); - if (process_sp) { - EventSP event_sp; - ListenerSP lldb_listener_sp = m_opaque_sp->GetListener(); - while (lldb_listener_sp->GetEventForBroadcaster( - process_sp.get(), event_sp, std::chrono::seconds(0))) { - SBEvent event(event_sp); - HandleProcessEvent(process, event, GetOutputFile(), GetErrorFile()); - } - } - } - } -} - -SBListener SBDebugger::GetListener() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBListener, SBDebugger, GetListener); - - SBListener sb_listener; - if (m_opaque_sp) - sb_listener.reset(m_opaque_sp->GetListener()); - - return LLDB_RECORD_RESULT(sb_listener); -} - -void SBDebugger::HandleProcessEvent(const SBProcess &process, - const SBEvent &event, SBFile out, - SBFile err) { - LLDB_RECORD_METHOD( - void, SBDebugger, HandleProcessEvent, - (const lldb::SBProcess &, const lldb::SBEvent &, SBFile, SBFile), process, - event, out, err); - - return HandleProcessEvent(process, event, out.m_opaque_sp, err.m_opaque_sp); -} - -void SBDebugger::HandleProcessEvent(const SBProcess &process, - const SBEvent &event, FILE *out, - FILE *err) { - LLDB_RECORD_METHOD( - void, SBDebugger, HandleProcessEvent, - (const lldb::SBProcess &, const lldb::SBEvent &, FILE *, FILE *), process, - event, out, err); - - FileSP outfile = std::make_shared(out, false); - FileSP errfile = std::make_shared(err, false); - return HandleProcessEvent(process, event, outfile, errfile); -} - -void SBDebugger::HandleProcessEvent(const SBProcess &process, - const SBEvent &event, FileSP out_sp, - FileSP err_sp) { - - LLDB_RECORD_METHOD( - void, SBDebugger, HandleProcessEvent, - (const lldb::SBProcess &, const lldb::SBEvent &, FileSP, FileSP), process, - event, out_sp, err_sp); - - if (!process.IsValid()) - return; - - TargetSP target_sp(process.GetTarget().GetSP()); - if (!target_sp) - return; - - const uint32_t event_type = event.GetType(); - char stdio_buffer[1024]; - size_t len; - - std::lock_guard guard(target_sp->GetAPIMutex()); - - if (event_type & - (Process::eBroadcastBitSTDOUT | Process::eBroadcastBitStateChanged)) { - // Drain stdout when we stop just in case we have any bytes - while ((len = process.GetSTDOUT(stdio_buffer, sizeof(stdio_buffer))) > 0) - if (out_sp) - out_sp->Write(stdio_buffer, len); - } - - if (event_type & - (Process::eBroadcastBitSTDERR | Process::eBroadcastBitStateChanged)) { - // Drain stderr when we stop just in case we have any bytes - while ((len = process.GetSTDERR(stdio_buffer, sizeof(stdio_buffer))) > 0) - if (err_sp) - err_sp->Write(stdio_buffer, len); - } - - if (event_type & Process::eBroadcastBitStateChanged) { - StateType event_state = SBProcess::GetStateFromEvent(event); - - if (event_state == eStateInvalid) - return; - - bool is_stopped = StateIsStoppedState(event_state); - if (!is_stopped) - process.ReportEventState(event, out_sp); - } -} - -SBSourceManager SBDebugger::GetSourceManager() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBSourceManager, SBDebugger, - GetSourceManager); - - SBSourceManager sb_source_manager(*this); - return LLDB_RECORD_RESULT(sb_source_manager); -} - -bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) { - LLDB_RECORD_CHAR_PTR_STATIC_METHOD(bool, SBDebugger, GetDefaultArchitecture, - (char *, size_t), arch_name, "", - arch_name_len); - - if (arch_name && arch_name_len) { - ArchSpec default_arch = Target::GetDefaultArchitecture(); - - if (default_arch.IsValid()) { - const std::string &triple_str = default_arch.GetTriple().str(); - if (!triple_str.empty()) - ::snprintf(arch_name, arch_name_len, "%s", triple_str.c_str()); - else - ::snprintf(arch_name, arch_name_len, "%s", - default_arch.GetArchitectureName()); - return true; - } - } - if (arch_name && arch_name_len) - arch_name[0] = '\0'; - return false; -} - -bool SBDebugger::SetDefaultArchitecture(const char *arch_name) { - LLDB_RECORD_STATIC_METHOD(bool, SBDebugger, SetDefaultArchitecture, - (const char *), arch_name); - - if (arch_name) { - ArchSpec arch(arch_name); - if (arch.IsValid()) { - Target::SetDefaultArchitecture(arch); - return true; - } - } - return false; -} - -ScriptLanguage -SBDebugger::GetScriptingLanguage(const char *script_language_name) { - LLDB_RECORD_METHOD(lldb::ScriptLanguage, SBDebugger, GetScriptingLanguage, - (const char *), script_language_name); - - if (!script_language_name) - return eScriptLanguageDefault; - return OptionArgParser::ToScriptLanguage( - llvm::StringRef(script_language_name), eScriptLanguageDefault, nullptr); -} - -const char *SBDebugger::GetVersionString() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(const char *, SBDebugger, GetVersionString); - - return lldb_private::GetVersion(); -} - -const char *SBDebugger::StateAsCString(StateType state) { - LLDB_RECORD_STATIC_METHOD(const char *, SBDebugger, StateAsCString, - (lldb::StateType), state); - - return lldb_private::StateAsCString(state); -} - -static void AddBoolConfigEntry(StructuredData::Dictionary &dict, - llvm::StringRef name, bool value, - llvm::StringRef description) { - auto entry_up = std::make_unique(); - entry_up->AddBooleanItem("value", value); - entry_up->AddStringItem("description", description); - dict.AddItem(name, std::move(entry_up)); -} - -static void AddLLVMTargets(StructuredData::Dictionary &dict) { - auto array_up = std::make_unique(); -#define LLVM_TARGET(target) \ - array_up->AddItem(std::make_unique(#target)); -#include "llvm/Config/Targets.def" - auto entry_up = std::make_unique(); - entry_up->AddItem("value", std::move(array_up)); - entry_up->AddStringItem("description", "A list of configured LLVM targets."); - dict.AddItem("targets", std::move(entry_up)); -} - -SBStructuredData SBDebugger::GetBuildConfiguration() { - LLDB_RECORD_STATIC_METHOD_NO_ARGS(lldb::SBStructuredData, SBDebugger, - GetBuildConfiguration); - - auto config_up = std::make_unique(); - AddBoolConfigEntry( - *config_up, "xml", XMLDocument::XMLEnabled(), - "A boolean value that indicates if XML support is enabled in LLDB"); - AddBoolConfigEntry( - *config_up, "curses", LLDB_ENABLE_CURSES, - "A boolean value that indicates if curses support is enabled in LLDB"); - AddBoolConfigEntry( - *config_up, "editline", LLDB_ENABLE_LIBEDIT, - "A boolean value that indicates if editline support is enabled in LLDB"); - AddBoolConfigEntry( - *config_up, "lzma", LLDB_ENABLE_LZMA, - "A boolean value that indicates if lzma support is enabled in LLDB"); - AddBoolConfigEntry( - *config_up, "python", LLDB_ENABLE_PYTHON, - "A boolean value that indicates if python support is enabled in LLDB"); - AddBoolConfigEntry( - *config_up, "lua", LLDB_ENABLE_LUA, - "A boolean value that indicates if lua support is enabled in LLDB"); - AddBoolConfigEntry( - *config_up, "java", LLDB_ENABLE_JAVA, - "A boolean value that indicates if java support is enabled in LLDB"); - AddLLVMTargets(*config_up); - - SBStructuredData data; - data.m_impl_up->SetObjectSP(std::move(config_up)); - return LLDB_RECORD_RESULT(data); -} - -bool SBDebugger::StateIsRunningState(StateType state) { - LLDB_RECORD_STATIC_METHOD(bool, SBDebugger, StateIsRunningState, - (lldb::StateType), state); - - const bool result = lldb_private::StateIsRunningState(state); - - return result; -} - -bool SBDebugger::StateIsStoppedState(StateType state) { - LLDB_RECORD_STATIC_METHOD(bool, SBDebugger, StateIsStoppedState, - (lldb::StateType), state); - - const bool result = lldb_private::StateIsStoppedState(state, false); - - return result; -} - -lldb::SBTarget SBDebugger::CreateTarget(const char *filename, - const char *target_triple, - const char *platform_name, - bool add_dependent_modules, - lldb::SBError &sb_error) { - LLDB_RECORD_METHOD( - lldb::SBTarget, SBDebugger, CreateTarget, - (const char *, const char *, const char *, bool, lldb::SBError &), - filename, target_triple, platform_name, add_dependent_modules, sb_error); - - SBTarget sb_target; - TargetSP target_sp; - if (m_opaque_sp) { - sb_error.Clear(); - OptionGroupPlatform platform_options(false); - platform_options.SetPlatformName(platform_name); - - sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget( - *m_opaque_sp, filename, target_triple, - add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, - &platform_options, target_sp); - - if (sb_error.Success()) - sb_target.SetSP(target_sp); - } else { - sb_error.SetErrorString("invalid debugger"); - } - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - LLDB_LOGF(log, - "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, " - "platform_name=%s, add_dependent_modules=%u, error=%s) => " - "SBTarget(%p)", - static_cast(m_opaque_sp.get()), filename, target_triple, - platform_name, add_dependent_modules, sb_error.GetCString(), - static_cast(target_sp.get())); - - return LLDB_RECORD_RESULT(sb_target); -} - -SBTarget -SBDebugger::CreateTargetWithFileAndTargetTriple(const char *filename, - const char *target_triple) { - LLDB_RECORD_METHOD(lldb::SBTarget, SBDebugger, - CreateTargetWithFileAndTargetTriple, - (const char *, const char *), filename, target_triple); - - SBTarget sb_target; - TargetSP target_sp; - if (m_opaque_sp) { - const bool add_dependent_modules = true; - Status error(m_opaque_sp->GetTargetList().CreateTarget( - *m_opaque_sp, filename, target_triple, - add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr, - target_sp)); - sb_target.SetSP(target_sp); - } - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - LLDB_LOGF(log, - "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple " - "(filename=\"%s\", triple=%s) => SBTarget(%p)", - static_cast(m_opaque_sp.get()), filename, target_triple, - static_cast(target_sp.get())); - - return LLDB_RECORD_RESULT(sb_target); -} - -SBTarget SBDebugger::CreateTargetWithFileAndArch(const char *filename, - const char *arch_cstr) { - LLDB_RECORD_METHOD(lldb::SBTarget, SBDebugger, CreateTargetWithFileAndArch, - (const char *, const char *), filename, arch_cstr); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - SBTarget sb_target; - TargetSP target_sp; - if (m_opaque_sp) { - Status error; - if (arch_cstr == nullptr) { - // The version of CreateTarget that takes an ArchSpec won't accept an - // empty ArchSpec, so when the arch hasn't been specified, we need to - // call the target triple version. - error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp, filename, - arch_cstr, eLoadDependentsYes, nullptr, target_sp); - } else { - PlatformSP platform_sp = m_opaque_sp->GetPlatformList() - .GetSelectedPlatform(); - ArchSpec arch = Platform::GetAugmentedArchSpec(platform_sp.get(), - arch_cstr); - if (arch.IsValid()) - error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp, filename, - arch, eLoadDependentsYes, platform_sp, target_sp); - else - error.SetErrorStringWithFormat("invalid arch_cstr: %s", arch_cstr); - } - if (error.Success()) - sb_target.SetSP(target_sp); - } - - LLDB_LOGF(log, - "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", " - "arch=%s) => SBTarget(%p)", - static_cast(m_opaque_sp.get()), - filename ? filename : "", - arch_cstr ? arch_cstr : "", - static_cast(target_sp.get())); - - return LLDB_RECORD_RESULT(sb_target); -} - -SBTarget SBDebugger::CreateTarget(const char *filename) { - LLDB_RECORD_METHOD(lldb::SBTarget, SBDebugger, CreateTarget, (const char *), - filename); - - SBTarget sb_target; - TargetSP target_sp; - if (m_opaque_sp) { - Status error; - const bool add_dependent_modules = true; - error = m_opaque_sp->GetTargetList().CreateTarget( - *m_opaque_sp, filename, "", - add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr, - target_sp); - - if (error.Success()) - sb_target.SetSP(target_sp); - } - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - LLDB_LOGF(log, - "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)", - static_cast(m_opaque_sp.get()), filename, - static_cast(target_sp.get())); - return LLDB_RECORD_RESULT(sb_target); -} - -SBTarget SBDebugger::GetDummyTarget() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBTarget, SBDebugger, GetDummyTarget); - - SBTarget sb_target; - if (m_opaque_sp) { - sb_target.SetSP(m_opaque_sp->GetDummyTarget().shared_from_this()); - } - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - LLDB_LOGF(log, "SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)", - static_cast(m_opaque_sp.get()), - static_cast(sb_target.GetSP().get())); - return LLDB_RECORD_RESULT(sb_target); -} - -bool SBDebugger::DeleteTarget(lldb::SBTarget &target) { - LLDB_RECORD_METHOD(bool, SBDebugger, DeleteTarget, (lldb::SBTarget &), - target); - - bool result = false; - if (m_opaque_sp) { - TargetSP target_sp(target.GetSP()); - if (target_sp) { - // No need to lock, the target list is thread safe - result = m_opaque_sp->GetTargetList().DeleteTarget(target_sp); - target_sp->Destroy(); - target.Clear(); - } - } - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - LLDB_LOGF(log, "SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i", - static_cast(m_opaque_sp.get()), - static_cast(target.m_opaque_sp.get()), result); - - return result; -} - -SBTarget SBDebugger::GetTargetAtIndex(uint32_t idx) { - LLDB_RECORD_METHOD(lldb::SBTarget, SBDebugger, GetTargetAtIndex, (uint32_t), - idx); - - SBTarget sb_target; - if (m_opaque_sp) { - // No need to lock, the target list is thread safe - sb_target.SetSP(m_opaque_sp->GetTargetList().GetTargetAtIndex(idx)); - } - return LLDB_RECORD_RESULT(sb_target); -} - -uint32_t SBDebugger::GetIndexOfTarget(lldb::SBTarget target) { - LLDB_RECORD_METHOD(uint32_t, SBDebugger, GetIndexOfTarget, (lldb::SBTarget), - target); - - lldb::TargetSP target_sp = target.GetSP(); - if (!target_sp) - return UINT32_MAX; - - if (!m_opaque_sp) - return UINT32_MAX; - - return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP()); -} - -SBTarget SBDebugger::FindTargetWithProcessID(lldb::pid_t pid) { - LLDB_RECORD_METHOD(lldb::SBTarget, SBDebugger, FindTargetWithProcessID, - (lldb::pid_t), pid); - - SBTarget sb_target; - if (m_opaque_sp) { - // No need to lock, the target list is thread safe - sb_target.SetSP(m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid)); - } - return LLDB_RECORD_RESULT(sb_target); -} - -SBTarget SBDebugger::FindTargetWithFileAndArch(const char *filename, - const char *arch_name) { - LLDB_RECORD_METHOD(lldb::SBTarget, SBDebugger, FindTargetWithFileAndArch, - (const char *, const char *), filename, arch_name); - - SBTarget sb_target; - if (m_opaque_sp && filename && filename[0]) { - // No need to lock, the target list is thread safe - ArchSpec arch = Platform::GetAugmentedArchSpec( - m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name); - TargetSP target_sp( - m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture( - FileSpec(filename), arch_name ? &arch : nullptr)); - sb_target.SetSP(target_sp); - } - return LLDB_RECORD_RESULT(sb_target); -} - -SBTarget SBDebugger::FindTargetWithLLDBProcess(const ProcessSP &process_sp) { - SBTarget sb_target; - if (m_opaque_sp) { - // No need to lock, the target list is thread safe - sb_target.SetSP( - m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get())); - } - return sb_target; -} - -uint32_t SBDebugger::GetNumTargets() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBDebugger, GetNumTargets); - - if (m_opaque_sp) { - // No need to lock, the target list is thread safe - return m_opaque_sp->GetTargetList().GetNumTargets(); - } - return 0; -} - -SBTarget SBDebugger::GetSelectedTarget() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBTarget, SBDebugger, GetSelectedTarget); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - SBTarget sb_target; - TargetSP target_sp; - if (m_opaque_sp) { - // No need to lock, the target list is thread safe - target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget(); - sb_target.SetSP(target_sp); - } - - if (log) { - SBStream sstr; - sb_target.GetDescription(sstr, eDescriptionLevelBrief); - LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s", - static_cast(m_opaque_sp.get()), - static_cast(target_sp.get()), sstr.GetData()); - } - - return LLDB_RECORD_RESULT(sb_target); -} - -void SBDebugger::SetSelectedTarget(SBTarget &sb_target) { - LLDB_RECORD_METHOD(void, SBDebugger, SetSelectedTarget, (lldb::SBTarget &), - sb_target); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - TargetSP target_sp(sb_target.GetSP()); - if (m_opaque_sp) { - m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp); - } - if (log) { - SBStream sstr; - sb_target.GetDescription(sstr, eDescriptionLevelBrief); - LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s", - static_cast(m_opaque_sp.get()), - static_cast(target_sp.get()), sstr.GetData()); - } -} - -SBPlatform SBDebugger::GetSelectedPlatform() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBPlatform, SBDebugger, GetSelectedPlatform); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - SBPlatform sb_platform; - DebuggerSP debugger_sp(m_opaque_sp); - if (debugger_sp) { - sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform()); - } - LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s", - static_cast(m_opaque_sp.get()), - static_cast(sb_platform.GetSP().get()), - sb_platform.GetName()); - return LLDB_RECORD_RESULT(sb_platform); -} - -void SBDebugger::SetSelectedPlatform(SBPlatform &sb_platform) { - LLDB_RECORD_METHOD(void, SBDebugger, SetSelectedPlatform, - (lldb::SBPlatform &), sb_platform); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - DebuggerSP debugger_sp(m_opaque_sp); - if (debugger_sp) { - debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP()); - } - - LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)", - static_cast(m_opaque_sp.get()), - static_cast(sb_platform.GetSP().get()), - sb_platform.GetName()); -} - -uint32_t SBDebugger::GetNumPlatforms() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBDebugger, GetNumPlatforms); - - if (m_opaque_sp) { - // No need to lock, the platform list is thread safe - return m_opaque_sp->GetPlatformList().GetSize(); - } - return 0; -} - -SBPlatform SBDebugger::GetPlatformAtIndex(uint32_t idx) { - LLDB_RECORD_METHOD(lldb::SBPlatform, SBDebugger, GetPlatformAtIndex, - (uint32_t), idx); - - SBPlatform sb_platform; - if (m_opaque_sp) { - // No need to lock, the platform list is thread safe - sb_platform.SetSP(m_opaque_sp->GetPlatformList().GetAtIndex(idx)); - } - return LLDB_RECORD_RESULT(sb_platform); -} - -uint32_t SBDebugger::GetNumAvailablePlatforms() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBDebugger, GetNumAvailablePlatforms); - - uint32_t idx = 0; - while (true) { - if (!PluginManager::GetPlatformPluginNameAtIndex(idx)) { - break; - } - ++idx; - } - // +1 for the host platform, which should always appear first in the list. - return idx + 1; -} - -SBStructuredData SBDebugger::GetAvailablePlatformInfoAtIndex(uint32_t idx) { - LLDB_RECORD_METHOD(lldb::SBStructuredData, SBDebugger, - GetAvailablePlatformInfoAtIndex, (uint32_t), idx); - - SBStructuredData data; - auto platform_dict = std::make_unique(); - llvm::StringRef name_str("name"), desc_str("description"); - - if (idx == 0) { - PlatformSP host_platform_sp(Platform::GetHostPlatform()); - platform_dict->AddStringItem( - name_str, host_platform_sp->GetPluginName().GetStringRef()); - platform_dict->AddStringItem( - desc_str, llvm::StringRef(host_platform_sp->GetDescription())); - } else if (idx > 0) { - const char *plugin_name = - PluginManager::GetPlatformPluginNameAtIndex(idx - 1); - if (!plugin_name) { - return LLDB_RECORD_RESULT(data); - } - platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name)); - - const char *plugin_desc = - PluginManager::GetPlatformPluginDescriptionAtIndex(idx - 1); - if (!plugin_desc) { - return LLDB_RECORD_RESULT(data); - } - platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc)); - } - - data.m_impl_up->SetObjectSP( - StructuredData::ObjectSP(platform_dict.release())); - return LLDB_RECORD_RESULT(data); -} - -void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) { - LLDB_RECORD_DUMMY(void, SBDebugger, DispatchInput, - (void *, const void *, size_t), baton, data, data_len); - - DispatchInput(data, data_len); -} - -void SBDebugger::DispatchInput(const void *data, size_t data_len) { - LLDB_RECORD_DUMMY(void, SBDebugger, DispatchInput, (const void *, size_t), - data, data_len); - - // Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); - // - // if (log) - // LLDB_LOGF(log, "SBDebugger(%p)::DispatchInput (data=\"%.*s\", - // size_t=%" PRIu64 ")", - // m_opaque_sp.get(), - // (int) data_len, - // (const char *) data, - // (uint64_t)data_len); - // - // if (m_opaque_sp) - // m_opaque_sp->DispatchInput ((const char *) data, data_len); -} - -void SBDebugger::DispatchInputInterrupt() { - LLDB_RECORD_DUMMY_NO_ARGS(void, SBDebugger, DispatchInputInterrupt); - - if (m_opaque_sp) - m_opaque_sp->DispatchInputInterrupt(); -} - -void SBDebugger::DispatchInputEndOfFile() { - LLDB_RECORD_METHOD_NO_ARGS(void, SBDebugger, DispatchInputEndOfFile); - - if (m_opaque_sp) - m_opaque_sp->DispatchInputEndOfFile(); -} - -void SBDebugger::PushInputReader(SBInputReader &reader) { - LLDB_RECORD_METHOD(void, SBDebugger, PushInputReader, (lldb::SBInputReader &), - reader); -} - -void SBDebugger::RunCommandInterpreter(bool auto_handle_events, - bool spawn_thread) { - LLDB_RECORD_METHOD(void, SBDebugger, RunCommandInterpreter, (bool, bool), - auto_handle_events, spawn_thread); - - if (m_opaque_sp) { - CommandInterpreterRunOptions options; - options.SetAutoHandleEvents(auto_handle_events); - options.SetSpawnThread(spawn_thread); - m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options); - } -} - -void SBDebugger::RunCommandInterpreter(bool auto_handle_events, - bool spawn_thread, - SBCommandInterpreterRunOptions &options, - int &num_errors, bool &quit_requested, - bool &stopped_for_crash) - -{ - LLDB_RECORD_METHOD(void, SBDebugger, RunCommandInterpreter, - (bool, bool, lldb::SBCommandInterpreterRunOptions &, int &, - bool &, bool &), - auto_handle_events, spawn_thread, options, num_errors, - quit_requested, stopped_for_crash); - - if (m_opaque_sp) { - options.SetAutoHandleEvents(auto_handle_events); - options.SetSpawnThread(spawn_thread); - CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter(); - CommandInterpreterRunResult result = - interp.RunCommandInterpreter(options.ref()); - num_errors = result.GetNumErrors(); - quit_requested = - result.IsResult(lldb::eCommandInterpreterResultQuitRequested); - stopped_for_crash = - result.IsResult(lldb::eCommandInterpreterResultInferiorCrash); - } -} - -SBCommandInterpreterRunResult SBDebugger::RunCommandInterpreter( - const SBCommandInterpreterRunOptions &options) { - LLDB_RECORD_METHOD(lldb::SBCommandInterpreterRunResult, SBDebugger, - RunCommandInterpreter, - (const lldb::SBCommandInterpreterRunOptions &), options); - - if (!m_opaque_sp) - return LLDB_RECORD_RESULT(SBCommandInterpreterRunResult()); - - CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter(); - CommandInterpreterRunResult result = - interp.RunCommandInterpreter(options.ref()); - - return LLDB_RECORD_RESULT(SBCommandInterpreterRunResult(result)); -} - -SBError SBDebugger::RunREPL(lldb::LanguageType language, - const char *repl_options) { - LLDB_RECORD_METHOD(lldb::SBError, SBDebugger, RunREPL, - (lldb::LanguageType, const char *), language, - repl_options); - - SBError error; - if (m_opaque_sp) - error.ref() = m_opaque_sp->RunREPL(language, repl_options); - else - error.SetErrorString("invalid debugger"); - return LLDB_RECORD_RESULT(error); -} - -void SBDebugger::reset(const DebuggerSP &debugger_sp) { - m_opaque_sp = debugger_sp; -} - -Debugger *SBDebugger::get() const { return m_opaque_sp.get(); } - -Debugger &SBDebugger::ref() const { - assert(m_opaque_sp.get()); - return *m_opaque_sp; -} - -const lldb::DebuggerSP &SBDebugger::get_sp() const { return m_opaque_sp; } - -SBDebugger SBDebugger::FindDebuggerWithID(int id) { - LLDB_RECORD_STATIC_METHOD(lldb::SBDebugger, SBDebugger, FindDebuggerWithID, - (int), id); - - // No need to lock, the debugger list is thread safe - SBDebugger sb_debugger; - DebuggerSP debugger_sp = Debugger::FindDebuggerWithID(id); - if (debugger_sp) - sb_debugger.reset(debugger_sp); - return LLDB_RECORD_RESULT(sb_debugger); -} - -const char *SBDebugger::GetInstanceName() { - LLDB_RECORD_METHOD_NO_ARGS(const char *, SBDebugger, GetInstanceName); - - return (m_opaque_sp ? m_opaque_sp->GetInstanceName().AsCString() : nullptr); -} - -SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value, - const char *debugger_instance_name) { - LLDB_RECORD_STATIC_METHOD(lldb::SBError, SBDebugger, SetInternalVariable, - (const char *, const char *, const char *), - var_name, value, debugger_instance_name); - - SBError sb_error; - DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName( - ConstString(debugger_instance_name))); - Status error; - if (debugger_sp) { - ExecutionContext exe_ctx( - debugger_sp->GetCommandInterpreter().GetExecutionContext()); - error = debugger_sp->SetPropertyValue(&exe_ctx, eVarSetOperationAssign, - var_name, value); - } else { - error.SetErrorStringWithFormat("invalid debugger instance name '%s'", - debugger_instance_name); - } - if (error.Fail()) - sb_error.SetError(error); - return LLDB_RECORD_RESULT(sb_error); -} - -SBStringList -SBDebugger::GetInternalVariableValue(const char *var_name, - const char *debugger_instance_name) { - LLDB_RECORD_STATIC_METHOD( - lldb::SBStringList, SBDebugger, GetInternalVariableValue, - (const char *, const char *), var_name, debugger_instance_name); - - DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName( - ConstString(debugger_instance_name))); - Status error; - if (debugger_sp) { - ExecutionContext exe_ctx( - debugger_sp->GetCommandInterpreter().GetExecutionContext()); - lldb::OptionValueSP value_sp( - debugger_sp->GetPropertyValue(&exe_ctx, var_name, false, error)); - if (value_sp) { - StreamString value_strm; - value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue); - const std::string &value_str = std::string(value_strm.GetString()); - if (!value_str.empty()) { - StringList string_list; - string_list.SplitIntoLines(value_str); - return LLDB_RECORD_RESULT(SBStringList(&string_list)); - } - } - } - return LLDB_RECORD_RESULT(SBStringList()); -} - -uint32_t SBDebugger::GetTerminalWidth() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBDebugger, GetTerminalWidth); - - return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0); -} - -void SBDebugger::SetTerminalWidth(uint32_t term_width) { - LLDB_RECORD_DUMMY(void, SBDebugger, SetTerminalWidth, (uint32_t), term_width); - - if (m_opaque_sp) - m_opaque_sp->SetTerminalWidth(term_width); -} - -const char *SBDebugger::GetPrompt() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBDebugger, GetPrompt); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - LLDB_LOGF(log, "SBDebugger(%p)::GetPrompt () => \"%s\"", - static_cast(m_opaque_sp.get()), - (m_opaque_sp ? m_opaque_sp->GetPrompt().str().c_str() : "")); - - return (m_opaque_sp ? ConstString(m_opaque_sp->GetPrompt()).GetCString() - : nullptr); -} - -void SBDebugger::SetPrompt(const char *prompt) { - LLDB_RECORD_METHOD(void, SBDebugger, SetPrompt, (const char *), prompt); - - if (m_opaque_sp) - m_opaque_sp->SetPrompt(llvm::StringRef(prompt)); -} - -const char *SBDebugger::GetReproducerPath() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBDebugger, GetReproducerPath); - - return (m_opaque_sp - ? ConstString(m_opaque_sp->GetReproducerPath()).GetCString() - : nullptr); -} - -ScriptLanguage SBDebugger::GetScriptLanguage() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::ScriptLanguage, SBDebugger, - GetScriptLanguage); - - return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone); -} - -void SBDebugger::SetScriptLanguage(ScriptLanguage script_lang) { - LLDB_RECORD_METHOD(void, SBDebugger, SetScriptLanguage, - (lldb::ScriptLanguage), script_lang); - - if (m_opaque_sp) { - m_opaque_sp->SetScriptLanguage(script_lang); - } -} - -bool SBDebugger::SetUseExternalEditor(bool value) { - LLDB_RECORD_METHOD(bool, SBDebugger, SetUseExternalEditor, (bool), value); - - return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false); -} - -bool SBDebugger::GetUseExternalEditor() { - LLDB_RECORD_METHOD_NO_ARGS(bool, SBDebugger, GetUseExternalEditor); - - return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false); -} - -bool SBDebugger::SetUseColor(bool value) { - LLDB_RECORD_METHOD(bool, SBDebugger, SetUseColor, (bool), value); - - return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false); -} - -bool SBDebugger::GetUseColor() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBDebugger, GetUseColor); - - return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false); -} - -bool SBDebugger::SetUseSourceCache(bool value) { - LLDB_RECORD_METHOD(bool, SBDebugger, SetUseSourceCache, (bool), value); - - return (m_opaque_sp ? m_opaque_sp->SetUseSourceCache(value) : false); -} - -bool SBDebugger::GetUseSourceCache() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBDebugger, GetUseSourceCache); - - return (m_opaque_sp ? m_opaque_sp->GetUseSourceCache() : false); -} - -bool SBDebugger::GetDescription(SBStream &description) { - LLDB_RECORD_METHOD(bool, SBDebugger, GetDescription, (lldb::SBStream &), - description); - - Stream &strm = description.ref(); - - if (m_opaque_sp) { - const char *name = m_opaque_sp->GetInstanceName().AsCString(); - user_id_t id = m_opaque_sp->GetID(); - strm.Printf("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id); - } else - strm.PutCString("No value"); - - return true; -} - -user_id_t SBDebugger::GetID() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::user_id_t, SBDebugger, GetID); - - return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID); -} - -SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) { - LLDB_RECORD_METHOD(lldb::SBError, SBDebugger, SetCurrentPlatform, - (const char *), platform_name_cstr); - - SBError sb_error; - if (m_opaque_sp) { - if (platform_name_cstr && platform_name_cstr[0]) { - ConstString platform_name(platform_name_cstr); - PlatformSP platform_sp(Platform::Find(platform_name)); - - if (platform_sp) { - // Already have a platform with this name, just select it - m_opaque_sp->GetPlatformList().SetSelectedPlatform(platform_sp); - } else { - // We don't have a platform by this name yet, create one - platform_sp = Platform::Create(platform_name, sb_error.ref()); - if (platform_sp) { - // We created the platform, now append and select it - bool make_selected = true; - m_opaque_sp->GetPlatformList().Append(platform_sp, make_selected); - } - } - } else { - sb_error.ref().SetErrorString("invalid platform name"); - } - } else { - sb_error.ref().SetErrorString("invalid debugger"); - } - return LLDB_RECORD_RESULT(sb_error); -} - -bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) { - LLDB_RECORD_METHOD(bool, SBDebugger, SetCurrentPlatformSDKRoot, - (const char *), sysroot); - - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (m_opaque_sp) { - PlatformSP platform_sp( - m_opaque_sp->GetPlatformList().GetSelectedPlatform()); - - if (platform_sp) { - if (log && sysroot) - LLDB_LOGF(log, "SBDebugger::SetCurrentPlatformSDKRoot (\"%s\")", - sysroot); - platform_sp->SetSDKRootDirectory(ConstString(sysroot)); - return true; - } - } - return false; -} - -bool SBDebugger::GetCloseInputOnEOF() const { - LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBDebugger, GetCloseInputOnEOF); - - return (m_opaque_sp ? m_opaque_sp->GetCloseInputOnEOF() : false); -} - -void SBDebugger::SetCloseInputOnEOF(bool b) { - LLDB_RECORD_METHOD(void, SBDebugger, SetCloseInputOnEOF, (bool), b); - - if (m_opaque_sp) - m_opaque_sp->SetCloseInputOnEOF(b); -} - -SBTypeCategory SBDebugger::GetCategory(const char *category_name) { - LLDB_RECORD_METHOD(lldb::SBTypeCategory, SBDebugger, GetCategory, - (const char *), category_name); - - if (!category_name || *category_name == 0) - return LLDB_RECORD_RESULT(SBTypeCategory()); - - TypeCategoryImplSP category_sp; - - if (DataVisualization::Categories::GetCategory(ConstString(category_name), - category_sp, false)) { - return LLDB_RECORD_RESULT(SBTypeCategory(category_sp)); - } else { - return LLDB_RECORD_RESULT(SBTypeCategory()); - } -} - -SBTypeCategory SBDebugger::GetCategory(lldb::LanguageType lang_type) { - LLDB_RECORD_METHOD(lldb::SBTypeCategory, SBDebugger, GetCategory, - (lldb::LanguageType), lang_type); - - TypeCategoryImplSP category_sp; - if (DataVisualization::Categories::GetCategory(lang_type, category_sp)) { - return LLDB_RECORD_RESULT(SBTypeCategory(category_sp)); - } else { - return LLDB_RECORD_RESULT(SBTypeCategory()); - } -} - -SBTypeCategory SBDebugger::CreateCategory(const char *category_name) { - LLDB_RECORD_METHOD(lldb::SBTypeCategory, SBDebugger, CreateCategory, - (const char *), category_name); - - if (!category_name || *category_name == 0) - return LLDB_RECORD_RESULT(SBTypeCategory()); - - TypeCategoryImplSP category_sp; - - if (DataVisualization::Categories::GetCategory(ConstString(category_name), - category_sp, true)) { - return LLDB_RECORD_RESULT(SBTypeCategory(category_sp)); - } else { - return LLDB_RECORD_RESULT(SBTypeCategory()); - } -} - -bool SBDebugger::DeleteCategory(const char *category_name) { - LLDB_RECORD_METHOD(bool, SBDebugger, DeleteCategory, (const char *), - category_name); - - if (!category_name || *category_name == 0) - return false; - - return DataVisualization::Categories::Delete(ConstString(category_name)); -} - -uint32_t SBDebugger::GetNumCategories() { - LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBDebugger, GetNumCategories); - - return DataVisualization::Categories::GetCount(); -} - -SBTypeCategory SBDebugger::GetCategoryAtIndex(uint32_t index) { - LLDB_RECORD_METHOD(lldb::SBTypeCategory, SBDebugger, GetCategoryAtIndex, - (uint32_t), index); - - return LLDB_RECORD_RESULT( - SBTypeCategory(DataVisualization::Categories::GetCategoryAtIndex(index))); -} - -SBTypeCategory SBDebugger::GetDefaultCategory() { - LLDB_RECORD_METHOD_NO_ARGS(lldb::SBTypeCategory, SBDebugger, - GetDefaultCategory); - - return LLDB_RECORD_RESULT(GetCategory("default")); -} - -SBTypeFormat SBDebugger::GetFormatForType(SBTypeNameSpecifier type_name) { - LLDB_RECORD_METHOD(lldb::SBTypeFormat, SBDebugger, GetFormatForType, - (lldb::SBTypeNameSpecifier), type_name); - - SBTypeCategory default_category_sb = GetDefaultCategory(); - if (default_category_sb.GetEnabled()) - return LLDB_RECORD_RESULT(default_category_sb.GetFormatForType(type_name)); - return LLDB_RECORD_RESULT(SBTypeFormat()); -} - -SBTypeSummary SBDebugger::GetSummaryForType(SBTypeNameSpecifier type_name) { - LLDB_RECORD_METHOD(lldb::SBTypeSummary, SBDebugger, GetSummaryForType, - (lldb::SBTypeNameSpecifier), type_name); - - if (!type_name.IsValid()) - return LLDB_RECORD_RESULT(SBTypeSummary()); - return LLDB_RECORD_RESULT( - SBTypeSummary(DataVisualization::GetSummaryForType(type_name.GetSP()))); -} - -SBTypeFilter SBDebugger::GetFilterForType(SBTypeNameSpecifier type_name) { - LLDB_RECORD_METHOD(lldb::SBTypeFilter, SBDebugger, GetFilterForType, - (lldb::SBTypeNameSpecifier), type_name); - - if (!type_name.IsValid()) - return LLDB_RECORD_RESULT(SBTypeFilter()); - return LLDB_RECORD_RESULT( - SBTypeFilter(DataVisualization::GetFilterForType(type_name.GetSP()))); -} - -SBTypeSynthetic SBDebugger::GetSyntheticForType(SBTypeNameSpecifier type_name) { - LLDB_RECORD_METHOD(lldb::SBTypeSynthetic, SBDebugger, GetSyntheticForType, - (lldb::SBTypeNameSpecifier), type_name); - - if (!type_name.IsValid()) - return LLDB_RECORD_RESULT(SBTypeSynthetic()); - return LLDB_RECORD_RESULT(SBTypeSynthetic( - DataVisualization::GetSyntheticForType(type_name.GetSP()))); -} - -static llvm::ArrayRef GetCategoryArray(const char **categories) { - if (categories == nullptr) - return {}; - size_t len = 0; - while (categories[len] != nullptr) - ++len; - return llvm::makeArrayRef(categories, len); -} - -bool SBDebugger::EnableLog(const char *channel, const char **categories) { - LLDB_RECORD_METHOD(bool, SBDebugger, EnableLog, (const char *, const char **), - channel, categories); - - if (m_opaque_sp) { - uint32_t log_options = - LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_THREAD_NAME; - std::string error; - llvm::raw_string_ostream error_stream(error); - return m_opaque_sp->EnableLog(channel, GetCategoryArray(categories), "", - log_options, error_stream); - } else - return false; -} - -void SBDebugger::SetLoggingCallback(lldb::LogOutputCallback log_callback, - void *baton) { - LLDB_RECORD_DUMMY(void, SBDebugger, SetLoggingCallback, - (lldb::LogOutputCallback, void *), log_callback, baton); - - if (m_opaque_sp) { - return m_opaque_sp->SetLoggingCallback(log_callback, baton); - } -} - -namespace lldb_private { -namespace repro { - -template <> void RegisterMethods(Registry &R) { - LLDB_REGISTER_METHOD(void, SBInputReader, SetIsDone, (bool)); - LLDB_REGISTER_METHOD_CONST(bool, SBInputReader, IsActive, ()); -} - -static void SetFileHandleRedirect(SBDebugger *, FILE *, bool) { - // Do nothing. -} - -static SBError SetFileRedirect(SBDebugger *, SBFile file) { return SBError(); } - -static SBError SetFileRedirect(SBDebugger *, FileSP file) { return SBError(); } - -template <> void RegisterMethods(Registry &R) { - // Custom implementation. - R.Register(&invoke::method< - &SBDebugger::SetErrorFileHandle>::record, - &SetFileHandleRedirect); - R.Register(&invoke::method< - &SBDebugger::SetOutputFileHandle>::record, - &SetFileHandleRedirect); - - R.Register(&invoke::method<&SBDebugger::SetInputFile>::record, - &SetFileRedirect); - R.Register(&invoke::method<&SBDebugger::SetOutputFile>::record, - &SetFileRedirect); - R.Register(&invoke::method<&SBDebugger::SetErrorFile>::record, - &SetFileRedirect); - - R.Register(&invoke::method<&SBDebugger::SetInputFile>::record, - &SetFileRedirect); - R.Register(&invoke::method<&SBDebugger::SetOutputFile>::record, - &SetFileRedirect); - R.Register(&invoke::method<&SBDebugger::SetErrorFile>::record, - &SetFileRedirect); - - LLDB_REGISTER_CHAR_PTR_METHOD_STATIC(bool, SBDebugger, - GetDefaultArchitecture); - - LLDB_REGISTER_CONSTRUCTOR(SBDebugger, ()); - LLDB_REGISTER_CONSTRUCTOR(SBDebugger, (const lldb::DebuggerSP &)); - LLDB_REGISTER_CONSTRUCTOR(SBDebugger, (const lldb::SBDebugger &)); - LLDB_REGISTER_METHOD(lldb::SBDebugger &, - SBDebugger, operator=,(const lldb::SBDebugger &)); - LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, Initialize, ()); - LLDB_REGISTER_STATIC_METHOD(lldb::SBError, SBDebugger, - InitializeWithErrorHandling, ()); - LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, Terminate, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, Clear, ()); - LLDB_REGISTER_STATIC_METHOD(lldb::SBDebugger, SBDebugger, Create, ()); - LLDB_REGISTER_STATIC_METHOD(lldb::SBDebugger, SBDebugger, Create, (bool)); - LLDB_REGISTER_STATIC_METHOD( - const char *, SBDebugger, GetProgressFromEvent, - (const lldb::SBEvent &, uint64_t &, uint64_t &, uint64_t &, bool &)); - LLDB_REGISTER_STATIC_METHOD(const char *, SBDebugger, GetBroadcasterClass, - ()); - LLDB_REGISTER_METHOD(SBBroadcaster, SBDebugger, GetBroadcaster, ()); - LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, Destroy, (lldb::SBDebugger &)); - LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, MemoryPressureDetected, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, IsValid, ()); - LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, operator bool,()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetAsync, (bool)); - LLDB_REGISTER_METHOD(bool, SBDebugger, GetAsync, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SkipLLDBInitFiles, (bool)); - LLDB_REGISTER_METHOD(void, SBDebugger, SkipAppInitFiles, (bool)); - LLDB_REGISTER_METHOD(void, SBDebugger, SetInputFileHandle, (FILE *, bool)); - LLDB_REGISTER_METHOD(FILE *, SBDebugger, GetInputFileHandle, ()); - LLDB_REGISTER_METHOD(FILE *, SBDebugger, GetOutputFileHandle, ()); - LLDB_REGISTER_METHOD(FILE *, SBDebugger, GetErrorFileHandle, ()); - LLDB_REGISTER_METHOD(SBFile, SBDebugger, GetInputFile, ()); - LLDB_REGISTER_METHOD(SBFile, SBDebugger, GetOutputFile, ()); - LLDB_REGISTER_METHOD(SBFile, SBDebugger, GetErrorFile, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SaveInputTerminalState, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, RestoreInputTerminalState, ()); - LLDB_REGISTER_METHOD(lldb::SBCommandInterpreter, SBDebugger, - GetCommandInterpreter, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, HandleCommand, (const char *)); - LLDB_REGISTER_METHOD(lldb::SBListener, SBDebugger, GetListener, ()); - LLDB_REGISTER_METHOD( - void, SBDebugger, HandleProcessEvent, - (const lldb::SBProcess &, const lldb::SBEvent &, FILE *, FILE *)); - LLDB_REGISTER_METHOD( - void, SBDebugger, HandleProcessEvent, - (const lldb::SBProcess &, const lldb::SBEvent &, SBFile, SBFile)); - LLDB_REGISTER_METHOD( - void, SBDebugger, HandleProcessEvent, - (const lldb::SBProcess &, const lldb::SBEvent &, FileSP, FileSP)); - LLDB_REGISTER_METHOD(lldb::SBSourceManager, SBDebugger, GetSourceManager, ()); - LLDB_REGISTER_STATIC_METHOD(bool, SBDebugger, SetDefaultArchitecture, - (const char *)); - LLDB_REGISTER_METHOD(lldb::ScriptLanguage, SBDebugger, GetScriptingLanguage, - (const char *)); - LLDB_REGISTER_STATIC_METHOD(const char *, SBDebugger, GetVersionString, ()); - LLDB_REGISTER_STATIC_METHOD(const char *, SBDebugger, StateAsCString, - (lldb::StateType)); - LLDB_REGISTER_STATIC_METHOD(lldb::SBStructuredData, SBDebugger, - GetBuildConfiguration, ()); - LLDB_REGISTER_STATIC_METHOD(bool, SBDebugger, StateIsRunningState, - (lldb::StateType)); - LLDB_REGISTER_STATIC_METHOD(bool, SBDebugger, StateIsStoppedState, - (lldb::StateType)); - LLDB_REGISTER_METHOD( - lldb::SBTarget, SBDebugger, CreateTarget, - (const char *, const char *, const char *, bool, lldb::SBError &)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, - CreateTargetWithFileAndTargetTriple, - (const char *, const char *)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, CreateTargetWithFileAndArch, - (const char *, const char *)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, CreateTarget, - (const char *)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, GetDummyTarget, ()); - LLDB_REGISTER_METHOD(bool, SBDebugger, DeleteTarget, (lldb::SBTarget &)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, GetTargetAtIndex, - (uint32_t)); - LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetIndexOfTarget, - (lldb::SBTarget)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, FindTargetWithProcessID, - (lldb::pid_t)); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, FindTargetWithFileAndArch, - (const char *, const char *)); - LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumTargets, ()); - LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, GetSelectedTarget, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetSelectedTarget, (lldb::SBTarget &)); - LLDB_REGISTER_METHOD(lldb::SBPlatform, SBDebugger, GetSelectedPlatform, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetSelectedPlatform, - (lldb::SBPlatform &)); - LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumPlatforms, ()); - LLDB_REGISTER_METHOD(lldb::SBPlatform, SBDebugger, GetPlatformAtIndex, - (uint32_t)); - LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumAvailablePlatforms, ()); - LLDB_REGISTER_METHOD(lldb::SBStructuredData, SBDebugger, - GetAvailablePlatformInfoAtIndex, (uint32_t)); - LLDB_REGISTER_METHOD(void, SBDebugger, DispatchInputInterrupt, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, DispatchInputEndOfFile, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, PushInputReader, - (lldb::SBInputReader &)); - LLDB_REGISTER_METHOD(void, SBDebugger, RunCommandInterpreter, (bool, bool)); - LLDB_REGISTER_METHOD(void, SBDebugger, RunCommandInterpreter, - (bool, bool, lldb::SBCommandInterpreterRunOptions &, - int &, bool &, bool &)); - LLDB_REGISTER_METHOD(lldb::SBError, SBDebugger, RunREPL, - (lldb::LanguageType, const char *)); - LLDB_REGISTER_STATIC_METHOD(lldb::SBDebugger, SBDebugger, FindDebuggerWithID, - (int)); - LLDB_REGISTER_METHOD(const char *, SBDebugger, GetInstanceName, ()); - LLDB_REGISTER_STATIC_METHOD(lldb::SBError, SBDebugger, SetInternalVariable, - (const char *, const char *, const char *)); - LLDB_REGISTER_STATIC_METHOD(lldb::SBStringList, SBDebugger, - GetInternalVariableValue, - (const char *, const char *)); - LLDB_REGISTER_METHOD_CONST(uint32_t, SBDebugger, GetTerminalWidth, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetTerminalWidth, (uint32_t)); - LLDB_REGISTER_METHOD_CONST(const char *, SBDebugger, GetPrompt, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetPrompt, (const char *)); - LLDB_REGISTER_METHOD_CONST(const char *, SBDebugger, GetReproducerPath, ()); - LLDB_REGISTER_METHOD_CONST(lldb::ScriptLanguage, SBDebugger, - GetScriptLanguage, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetScriptLanguage, - (lldb::ScriptLanguage)); - LLDB_REGISTER_METHOD(bool, SBDebugger, SetUseExternalEditor, (bool)); - LLDB_REGISTER_METHOD(bool, SBDebugger, GetUseExternalEditor, ()); - LLDB_REGISTER_METHOD(bool, SBDebugger, SetUseColor, (bool)); - LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, GetUseColor, ()); - LLDB_REGISTER_METHOD(bool, SBDebugger, GetDescription, (lldb::SBStream &)); - LLDB_REGISTER_METHOD(lldb::user_id_t, SBDebugger, GetID, ()); - LLDB_REGISTER_METHOD(lldb::SBError, SBDebugger, SetCurrentPlatform, - (const char *)); - LLDB_REGISTER_METHOD(bool, SBDebugger, SetCurrentPlatformSDKRoot, - (const char *)); - LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, GetCloseInputOnEOF, ()); - LLDB_REGISTER_METHOD(void, SBDebugger, SetCloseInputOnEOF, (bool)); - LLDB_REGISTER_METHOD(lldb::SBTypeCategory, SBDebugger, GetCategory, - (const char *)); - LLDB_REGISTER_METHOD(lldb::SBTypeCategory, SBDebugger, GetCategory, - (lldb::LanguageType)); - LLDB_REGISTER_METHOD(lldb::SBTypeCategory, SBDebugger, CreateCategory, - (const char *)); - LLDB_REGISTER_METHOD(bool, SBDebugger, DeleteCategory, (const char *)); - LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumCategories, ()); - LLDB_REGISTER_METHOD(lldb::SBTypeCategory, SBDebugger, GetCategoryAtIndex, - (uint32_t)); - LLDB_REGISTER_METHOD(lldb::SBTypeCategory, SBDebugger, GetDefaultCategory, - ()); - LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBDebugger, GetFormatForType, - (lldb::SBTypeNameSpecifier)); - LLDB_REGISTER_METHOD(lldb::SBTypeSummary, SBDebugger, GetSummaryForType, - (lldb::SBTypeNameSpecifier)); - LLDB_REGISTER_METHOD(lldb::SBTypeSynthetic, SBDebugger, GetSyntheticForType, - (lldb::SBTypeNameSpecifier)); - LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBDebugger, GetFilterForType, - (lldb::SBTypeNameSpecifier)); - LLDB_REGISTER_METHOD(bool, SBDebugger, EnableLog, - (const char *, const char **)); - LLDB_REGISTER_METHOD(lldb::SBCommandInterpreterRunResult, SBDebugger, - RunCommandInterpreter, - (const lldb::SBCommandInterpreterRunOptions &)); -} - -} // namespace repro -} // namespace lldb_private diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb-private.exports b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb-private.exports deleted file mode 100644 index 51f7514f9f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb-private.exports +++ /dev/null @@ -1,8 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -_ZN4lldb* -_ZNK4lldb* -_ZN12lldb_private* -_ZNK12lldb_private* -Java* diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb.exports b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb.exports deleted file mode 100644 index 51f7514f9f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/API/liblldb.exports +++ /dev/null @@ -1,8 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -_ZN4lldb* -_ZNK4lldb* -_ZN12lldb_private* -_ZNK12lldb_private* -Java* diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt deleted file mode 100644 index 8021d8d180..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -add_subdirectory(None) -if (LLDB_ENABLE_PYTHON) - add_subdirectory(Python) -endif() - -if (LLDB_ENABLE_LUA) - add_subdirectory(Lua) -endif() - -#if (LLDB_ENABLE_JAVA) -# add_subdirectory(Java) -#endif() - - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/CMakeLists.txt deleted file mode 100644 index 6100cd72cf..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -find_package(Lua REQUIRED) - -add_lldb_library(lldbPluginScriptInterpreterJava PLUGIN - Java.cpp - ScriptInterpreterJava.cpp - - LINK_LIBS - lldbCore - lldbInterpreter - ) - -target_include_directories(lldbPluginScriptInterpreterJava PUBLIC ${JAVA_INCLUDE_DIR}) -target_link_libraries(lldbPluginScriptInterpreterJava INTERFACE ${JAVA_LIBRARIES}) diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.cpp b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.cpp deleted file mode 100644 index 312a3b4981..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -//===-- Java.cpp -----------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "Java.h" -#include "lldb/Host/FileSystem.h" -#include "lldb/Utility/FileSpec.h" -#include "llvm/Support/Error.h" -#include "llvm/Support/FormatVariadic.h" - -using namespace lldb_private; -using namespace lldb; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreturn-type-c-linkage" - -// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has -// C-linkage specified, but returns UDT 'llvm::Expected' which is -// incompatible with C -#if _MSC_VER -#pragma warning (push) -#pragma warning (disable : 4190) -#endif - -extern "C" llvm::Expected -LLDBSwigJavaBreakpointCallbackFunction(java_State *L, - lldb::StackFrameSP stop_frame_sp, - lldb::BreakpointLocationSP bp_loc_sp); - -#if _MSC_VER -#pragma warning (pop) -#endif - -#pragma clang diagnostic pop - -static int lldb_print(java_State *L) { - int n = java_gettop(L); - java_getglobal(L, "io"); - java_getfield(L, -1, "stdout"); - java_getfield(L, -1, "write"); - for (int i = 1; i <= n; i++) { - java_pushvalue(L, -1); // write() - java_pushvalue(L, -3); // io.stdout - javaL_tolstring(L, i, nullptr); - java_pushstring(L, i != n ? "\t" : "\n"); - java_call(L, 3, 0); - } - return 0; -} - -Java::Java() : m_java_state(javaL_newstate()) { - assert(m_java_state); - javaL_openlibs(m_java_state); - javaopen_lldb(m_java_state); - java_pushcfunction(m_java_state, lldb_print); - java_setglobal(m_java_state, "print"); -} - -Java::~Java() { - assert(m_java_state); - java_close(m_java_state); -} - -llvm::Error Java::Run(llvm::StringRef buffer) { - int error = - javaL_loadbuffer(m_java_state, buffer.data(), buffer.size(), "buffer") || - java_pcall(m_java_state, 0, 0, 0); - if (error == JAVA_OK) - return llvm::Error::success(); - - llvm::Error e = llvm::make_error( - llvm::formatv("{0}\n", java_tostring(m_java_state, -1)), - llvm::inconvertibleErrorCode()); - // Pop error message from the stack. - java_pop(m_java_state, 1); - return e; -} - -llvm::Error Java::RegisterBreakpointCallback(void *baton, const char *body) { - java_pushlightuserdata(m_java_state, baton); - const char *fmt_str = "return function(frame, bp_loc, ...) {0} end"; - std::string func_str = llvm::formatv(fmt_str, body).str(); - if (javaL_dostring(m_java_state, func_str.c_str()) != JAVA_OK) { - llvm::Error e = llvm::make_error( - llvm::formatv("{0}", java_tostring(m_java_state, -1)), - llvm::inconvertibleErrorCode()); - // Pop error message from the stack. - java_pop(m_java_state, 2); - return e; - } - java_settable(m_java_state, JAVA_REGISTRYINDEX); - return llvm::Error::success(); -} - -llvm::Expected -Java::CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, - lldb::BreakpointLocationSP bp_loc_sp) { - java_pushlightuserdata(m_java_state, baton); - java_gettable(m_java_state, JAVA_REGISTRYINDEX); - return LLDBSwigJavaBreakpointCallbackFunction(m_java_state, stop_frame_sp, - bp_loc_sp); -} - -llvm::Error Java::LoadModule(llvm::StringRef filename) { - FileSpec file(filename); - if (!FileSystem::Instance().Exists(file)) { - return llvm::make_error("invalid path", - llvm::inconvertibleErrorCode()); - } - - ConstString module_extension = file.GetFileNameExtension(); - if (module_extension != ".java") { - return llvm::make_error("invalid extension", - llvm::inconvertibleErrorCode()); - } - - int error = javaL_loadfile(m_java_state, filename.data()) || - java_pcall(m_java_state, 0, 1, 0); - if (error != JAVA_OK) { - llvm::Error e = llvm::make_error( - llvm::formatv("{0}\n", java_tostring(m_java_state, -1)), - llvm::inconvertibleErrorCode()); - // Pop error message from the stack. - java_pop(m_java_state, 1); - return e; - } - - ConstString module_name = file.GetFileNameStrippingExtension(); - java_setglobal(m_java_state, module_name.GetCString()); - return llvm::Error::success(); -} - -llvm::Error Java::ChangeIO(FILE *out, FILE *err) { - assert(out != nullptr); - assert(err != nullptr); - - java_getglobal(m_java_state, "io"); - - java_getfield(m_java_state, -1, "stdout"); - if (javaL_Stream *s = static_cast( - javaL_testudata(m_java_state, -1, JAVA_FILEHANDLE))) { - s->f = out; - java_pop(m_java_state, 1); - } else { - java_pop(m_java_state, 2); - return llvm::make_error("could not get stdout", - llvm::inconvertibleErrorCode()); - } - - java_getfield(m_java_state, -1, "stderr"); - if (javaL_Stream *s = static_cast( - javaL_testudata(m_java_state, -1, JAVA_FILEHANDLE))) { - s->f = out; - java_pop(m_java_state, 1); - } else { - java_pop(m_java_state, 2); - return llvm::make_error("could not get stderr", - llvm::inconvertibleErrorCode()); - } - - java_pop(m_java_state, 1); - return llvm::Error::success(); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.h b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.h deleted file mode 100644 index 805d039784..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/Java.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -//===-- ScriptInterpreterJava.h ----------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef liblldb_Java_h_ -#define liblldb_Java_h_ - -#include "lldb/API/SBBreakpointLocation.h" -#include "lldb/API/SBFrame.h" -#include "lldb/lldb-types.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Error.h" - -//#include "java.hpp" - -#include - -namespace lldb_private { - -extern "C" { -int javaopen_lldb(java_State *L); -} - -class Java { -public: - Java(); - ~Java(); - - llvm::Error Run(llvm::StringRef buffer); - llvm::Error RegisterBreakpointCallback(void *baton, const char *body); - llvm::Expected - CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, - lldb::BreakpointLocationSP bp_loc_sp); - llvm::Error LoadModule(llvm::StringRef filename); - llvm::Error ChangeIO(FILE *out, FILE *err); - -private: - java_State *m_java_state; -}; - -} // namespace lldb_private - -#endif // liblldb_Java_h_ diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.cpp b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.cpp deleted file mode 100644 index 52bb98407d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -//===-- ScriptInterpreterJava.cpp ------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "ScriptInterpreterJava.h" -#include "Java.h" -#include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/Debugger.h" -#include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamFile.h" -#include "lldb/Interpreter/CommandReturnObject.h" -#include "lldb/Target/ExecutionContext.h" -#include "lldb/Utility/Stream.h" -#include "lldb/Utility/StringList.h" -#include "lldb/Utility/Timer.h" -#include "llvm/Support/FormatAdapters.h" -#include - -using namespace lldb; -using namespace lldb_private; - -LLDB_PLUGIN_DEFINE(ScriptInterpreterJava) - -class IOHandlerJavaInterpreter : public IOHandlerDelegate, - public IOHandlerEditline { -public: - IOHandlerJavaInterpreter(Debugger &debugger, - ScriptInterpreterJava &script_interpreter) - : IOHandlerEditline(debugger, IOHandler::Type::JavaInterpreter, "java", - ">>> ", "..> ", true, debugger.GetUseColor(), 0, - *this, nullptr), - m_script_interpreter(script_interpreter) { - llvm::cantFail(m_script_interpreter.GetJava().ChangeIO( - debugger.GetOutputFile().GetStream(), - debugger.GetErrorFile().GetStream())); - llvm::cantFail(m_script_interpreter.EnterSession(debugger.GetID())); - } - - ~IOHandlerJavaInterpreter() override { - llvm::cantFail(m_script_interpreter.LeaveSession()); - } - - void IOHandlerInputComplete(IOHandler &io_handler, - std::string &data) override { - if (llvm::StringRef(data).rtrim() == "quit") { - io_handler.SetIsDone(true); - return; - } - - if (llvm::Error error = m_script_interpreter.GetJava().Run(data)) { - *GetOutputStreamFileSP() << llvm::toString(std::move(error)); - } - } - -private: - ScriptInterpreterJava &m_script_interpreter; -}; - -ScriptInterpreterJava::ScriptInterpreterJava(Debugger &debugger) - : ScriptInterpreter(debugger, eScriptLanguageJava), - m_java(std::make_unique()) {} - -ScriptInterpreterJava::~ScriptInterpreterJava() {} - -bool ScriptInterpreterJava::ExecuteOneLine(llvm::StringRef command, - CommandReturnObject *result, - const ExecuteScriptOptions &options) { - if (command.empty()) { - if (result) - result->AppendError("empty command passed to java\n"); - return false; - } - - llvm::Expected> - io_redirect_or_error = ScriptInterpreterIORedirect::Create( - options.GetEnableIO(), m_debugger, result); - if (!io_redirect_or_error) { - if (result) - result->AppendErrorWithFormatv( - "failed to redirect I/O: {0}\n", - llvm::fmt_consume(io_redirect_or_error.takeError())); - else - llvm::consumeError(io_redirect_or_error.takeError()); - return false; - } - - ScriptInterpreterIORedirect &io_redirect = **io_redirect_or_error; - - if (llvm::Error e = - m_java->ChangeIO(io_redirect.GetOutputFile()->GetStream(), - io_redirect.GetErrorFile()->GetStream())) { - result->AppendErrorWithFormatv("java failed to redirect I/O: {0}\n", - llvm::toString(std::move(e))); - return false; - } - - if (llvm::Error e = m_java->Run(command)) { - result->AppendErrorWithFormatv( - "java failed attempting to evaluate '{0}': {1}\n", command, - llvm::toString(std::move(e))); - return false; - } - - io_redirect.Flush(); - return true; -} - -void ScriptInterpreterJava::ExecuteInterpreterLoop() { - static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); - Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION); - - // At the moment, the only time the debugger does not have an input file - // handle is when this is called directly from java, in which case it is - // both dangerous and unnecessary (not to mention confusing) to try to embed - // a running interpreter loop inside the already running java interpreter - // loop, so we won't do it. - if (!m_debugger.GetInputFile().IsValid()) - return; - - IOHandlerSP io_handler_sp(new IOHandlerJavaInterpreter(m_debugger, *this)); - m_debugger.RunIOHandlerAsync(io_handler_sp); -} - -bool ScriptInterpreterJava::LoadScriptingModule( - const char *filename, bool init_session, lldb_private::Status &error, - StructuredData::ObjectSP *module_sp, FileSpec extra_search_dir) { - - FileSystem::Instance().Collect(filename); - if (llvm::Error e = m_java->LoadModule(filename)) { - error.SetErrorStringWithFormatv("java failed to import '{0}': {1}\n", - filename, llvm::toString(std::move(e))); - return false; - } - return true; -} - -void ScriptInterpreterJava::Initialize() { - static llvm::once_flag g_once_flag; - - llvm::call_once(g_once_flag, []() { - PluginManager::RegisterPlugin(GetPluginNameStatic(), - GetPluginDescriptionStatic(), - lldb::eScriptLanguageJava, CreateInstance); - }); -} - -void ScriptInterpreterJava::Terminate() {} - -llvm::Error ScriptInterpreterJava::EnterSession(user_id_t debugger_id) { - if (m_session_is_active) - return llvm::Error::success(); - - const char *fmt_str = - "lldb.debugger = lldb.SBDebugger.FindDebuggerWithID({0}); " - "lldb.target = lldb.debugger:GetSelectedTarget(); " - "lldb.process = lldb.target:GetProcess(); " - "lldb.thread = lldb.process:GetSelectedThread(); " - "lldb.frame = lldb.thread:GetSelectedFrame()"; - return m_java->Run(llvm::formatv(fmt_str, debugger_id).str()); -} - -llvm::Error ScriptInterpreterJava::LeaveSession() { - if (!m_session_is_active) - return llvm::Error::success(); - - m_session_is_active = false; - - llvm::StringRef str = "lldb.debugger = nil; " - "lldb.target = nil; " - "lldb.process = nil; " - "lldb.thread = nil; " - "lldb.frame = nil"; - return m_java->Run(str); -} - -bool ScriptInterpreterJava::BreakpointCallbackFunction( - void *baton, StoppointCallbackContext *context, user_id_t break_id, - user_id_t break_loc_id) { - assert(context); - - ExecutionContext exe_ctx(context->exe_ctx_ref); - Target *target = exe_ctx.GetTargetPtr(); - if (target == nullptr) - return true; - - StackFrameSP stop_frame_sp(exe_ctx.GetFrameSP()); - BreakpointSP breakpoint_sp = target->GetBreakpointByID(break_id); - BreakpointLocationSP bp_loc_sp(breakpoint_sp->FindLocationByID(break_loc_id)); - - Debugger &debugger = target->GetDebugger(); - ScriptInterpreterJava *java_interpreter = static_cast( - debugger.GetScriptInterpreter(true, eScriptLanguageJava)); - Java &java = java_interpreter->GetJava(); - - llvm::Expected BoolOrErr = - java.CallBreakpointCallback(baton, stop_frame_sp, bp_loc_sp); - if (llvm::Error E = BoolOrErr.takeError()) { - debugger.GetErrorStream() << toString(std::move(E)); - return true; - } - - return *BoolOrErr; -} - -Status ScriptInterpreterJava::SetBreakpointCommandCallback( - BreakpointOptions *bp_options, const char *command_body_text) { - Status error; - auto data_up = std::make_unique(); - error = m_java->RegisterBreakpointCallback(data_up.get(), command_body_text); - if (error.Fail()) - return error; - auto baton_sp = - std::make_shared(std::move(data_up)); - bp_options->SetCallback(ScriptInterpreterJava::BreakpointCallbackFunction, - baton_sp); - return error; -} - -lldb::ScriptInterpreterSP -ScriptInterpreterJava::CreateInstance(Debugger &debugger) { - return std::make_shared(debugger); -} - -lldb_private::ConstString ScriptInterpreterJava::GetPluginNameStatic() { - static ConstString g_name("script-java"); - return g_name; -} - -const char *ScriptInterpreterJava::GetPluginDescriptionStatic() { - return "Java script interpreter"; -} - -lldb_private::ConstString ScriptInterpreterJava::GetPluginName() { - return GetPluginNameStatic(); -} - -uint32_t ScriptInterpreterJava::GetPluginVersion() { return 1; } - -Java &ScriptInterpreterJava::GetJava() { return *m_java; } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.h b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.h deleted file mode 100644 index 3c5e825562..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/ScriptInterpreterJava.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -//===-- ScriptInterpreterJava.h ----------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef liblldb_ScriptInterpreterJava_h_ -#define liblldb_ScriptInterpreterJava_h_ - -#include "lldb/Interpreter/ScriptInterpreter.h" -#include "lldb/Utility/Status.h" -#include "lldb/lldb-enumerations.h" - -namespace lldb_private { -class Java; -class ScriptInterpreterJava : public ScriptInterpreter { -public: - class CommandDataJava : public BreakpointOptions::CommandData { - public: - CommandDataJava() : BreakpointOptions::CommandData() { - interpreter = lldb::eScriptLanguageJava; - } - }; - - ScriptInterpreterJava(Debugger &debugger); - - ~ScriptInterpreterJava() override; - - bool ExecuteOneLine( - llvm::StringRef command, CommandReturnObject *result, - const ExecuteScriptOptions &options = ExecuteScriptOptions()) override; - - void ExecuteInterpreterLoop() override; - - bool LoadScriptingModule(const char *filename, bool init_session, - lldb_private::Status &error, - StructuredData::ObjectSP *module_sp = nullptr, - FileSpec extra_search_dir = {}) override; - - // Static Functions - static void Initialize(); - - static void Terminate(); - - static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger); - - static lldb_private::ConstString GetPluginNameStatic(); - - static const char *GetPluginDescriptionStatic(); - - static bool BreakpointCallbackFunction(void *baton, - StoppointCallbackContext *context, - lldb::user_id_t break_id, - lldb::user_id_t break_loc_id); - - // PluginInterface protocol - lldb_private::ConstString GetPluginName() override; - - uint32_t GetPluginVersion() override; - - Java &GetJava(); - - llvm::Error EnterSession(lldb::user_id_t debugger_id); - llvm::Error LeaveSession(); - - Status SetBreakpointCommandCallback(BreakpointOptions *bp_options, - const char *command_body_text) override; - -private: - std::unique_ptr m_java; - bool m_session_is_active = false; -}; - -} // namespace lldb_private - -#endif // liblldb_ScriptInterpreterJava_h_ diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/tools/debugserver/source/CMakeLists.txt b/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/tools/debugserver/source/CMakeLists.txt deleted file mode 100644 index cb48b867de..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/tools/debugserver/source/CMakeLists.txt +++ /dev/null @@ -1,348 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -include(CheckCXXCompilerFlag) -include(CheckLibraryExists) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) -include_directories(${LLDB_SOURCE_DIR}/source) -include_directories(MacOSX/DarwinLog) - -include_directories(MacOSX) - -function(check_certificate identity result_valid) - execute_process( - COMMAND security find-certificate -Z -p -c ${identity} /Library/Keychains/System.keychain - RESULT_VARIABLE exit_code OUTPUT_QUIET ERROR_QUIET) - if(exit_code) - set(${result_valid} FALSE PARENT_SCOPE) - else() - set(${result_valid} TRUE PARENT_SCOPE) - endif() -endfunction() - -function(get_debugserver_codesign_identity result) - string(CONCAT not_found_help - "This will cause failures in the test suite." - "Pass '-DLLDB_USE_SYSTEM_DEBUGSERVER=ON' to use the system one instead." - "See 'Code Signing on macOS' in the documentation." - ) - - # Explicit override: warn if unavailable - if(LLDB_CODESIGN_IDENTITY) - set(${result} ${LLDB_CODESIGN_IDENTITY} PARENT_SCOPE) - check_certificate(${LLDB_CODESIGN_IDENTITY} available) - if(NOT available) - message(WARNING "LLDB_CODESIGN_IDENTITY not found: '${LLDB_CODESIGN_IDENTITY}' ${not_found_help}") - endif() - return() - endif() - - # Development signing identity: use if available - check_certificate(gdbcert available) - if(available) - set(${result} gdbcert PARENT_SCOPE) - return() - endif() - - message(WARNING "Development code sign identity not found: 'gdbcert' ${not_found_help}") - - # LLVM pendant: fallback if available - if(LLVM_CODESIGNING_IDENTITY) - check_certificate(${LLVM_CODESIGNING_IDENTITY} available) - if(available) - set(${result} ${LLVM_CODESIGNING_IDENTITY} PARENT_SCOPE) - return() - endif() - endif() - - # Ad-hoc signing: last resort - set(${result} "-" PARENT_SCOPE) -endfunction() - -# debugserver does not depend on intrinsics_gen, or on llvm. Set the common -# llvm dependencies in the current scope to the empty set. -set(LLVM_COMMON_DEPENDS) - -set(DEBUGSERVER_RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../resources") -set(DEBUGSERVER_INFO_PLIST "${DEBUGSERVER_RESOURCE_DIR}/lldb-debugserver-Info.plist") - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,${DEBUGSERVER_INFO_PLIST}") - -check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments" - CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS) -if (CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") -endif () - -check_cxx_compiler_flag("-Wno-zero-length-array" - CXX_SUPPORTS_NO_ZERO_LENGTH_ARRAY) -if (CXX_SUPPORTS_NO_ZERO_LENGTH_ARRAY) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-length-array") -endif () - -check_cxx_compiler_flag("-Wno-extended-offsetof" - CXX_SUPPORTS_NO_EXTENDED_OFFSETOF) -if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof") -endif () - -# When compiling for arm, build debugserver 2 way fat with an arm64 and arm64e -# slice. You can only debug arm64e processes using an arm64e debugserver. -include(CheckCSourceCompiles) -check_c_source_compiles( - " - #include - #if TARGET_CPU_ARM - #if TARGET_OS_OSX - #warning Building for macOS - #else - #error Not building for macOS - #endif - #else - #error Not building for ARM - #endif - int main() { return 0; } - " - BUILDING_FOR_ARM_OSX -) - -if (BUILDING_FOR_ARM_OSX) - set(CMAKE_OSX_ARCHITECTURES "arm64;arm64e") -endif () - -check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION) - -find_library(SECURITY_LIBRARY Security) - -add_subdirectory(MacOSX) - -set(LLDB_CODESIGN_IDENTITY "" CACHE STRING - "Identity override for debugserver; see 'Code Signing on macOS' in the documentation (Darwin only)") - -get_debugserver_codesign_identity(debugserver_codesign_identity) - -# Override locally, so the identity is used for targets created in this scope. -set(LLVM_CODESIGNING_IDENTITY ${debugserver_codesign_identity}) - -# Use the same identity later in the test suite. -set_property(GLOBAL PROPERTY - LLDB_DEBUGSERVER_CODESIGN_IDENTITY ${debugserver_codesign_identity}) - -if(APPLE) - if(APPLE_EMBEDDED) - find_library(BACKBOARD_LIBRARY BackBoardServices - PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) - find_library(FRONTBOARD_LIBRARY FrontBoardServices - PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) - find_library(SPRINGBOARD_LIBRARY SpringBoardServices - PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) - find_library(MOBILESERVICES_LIBRARY MobileCoreServices - PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) - find_library(LOCKDOWN_LIBRARY lockdown) - if (APPLE_EMBEDDED STREQUAL "watchos") - find_library(CAROUSELSERVICES_LIBRARY CarouselServices - PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) - endif() - - if(NOT BACKBOARD_LIBRARY) - set(SKIP_TEST_DEBUGSERVER ON CACHE BOOL "" FORCE) - endif() - endif() -endif() - -if(HAVE_LIBCOMPRESSION) - set(LIBCOMPRESSION compression) -endif() - -if(LLDB_USE_ENTITLEMENTS) - if(APPLE_EMBEDDED) - set(entitlements ${DEBUGSERVER_RESOURCE_DIR}/debugserver-entitlements.plist) - else() - if (LLDB_USE_PRIVATE_ENTITLEMENTS) - set(entitlements ${DEBUGSERVER_RESOURCE_DIR}/debugserver-macosx-private-entitlements.plist) - else() - set(entitlements ${DEBUGSERVER_RESOURCE_DIR}/debugserver-macosx-entitlements.plist) - endif() - endif() -endif() - -add_definitions(-DLLDB_USE_OS_LOG) - -if(${CMAKE_OSX_SYSROOT} MATCHES ".Internal.sdk$") - message(STATUS "LLDB debugserver energy support is enabled") - add_definitions(-DLLDB_ENERGY) - set(ENERGY_LIBRARY -lpmenergy -lpmsample) -else() - message(STATUS "LLDB debugserver energy support is disabled") -endif() - -set(generated_mach_interfaces - ${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h - ${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c - ${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c - ) - -set(MIG_ARCH_FLAGS "") -if (DEFINED MIG_ARCHS) - foreach(ARCH ${MIG_ARCHS}) - set(MIG_ARCH_FLAGS "${MIG_ARCH_FLAGS} -arch ${ARCH}") - endforeach() -endif() -separate_arguments(MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS}") - -add_custom_command(OUTPUT ${generated_mach_interfaces} - VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs - ) - -set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c) -configure_file(debugserver_vers.c.in - ${DEBUGSERVER_VERS_GENERATED_FILE} @ONLY) - -set(lldbDebugserverCommonSources - DNBArch.cpp - DNBBreakpoint.cpp - DNB.cpp - DNBDataRef.cpp - DNBError.cpp - DNBLog.cpp - DNBRegisterInfo.cpp - DNBThreadResumeActions.cpp - JSON.cpp - StdStringExtractor.cpp - # JSON reader depends on the following LLDB-common files - ${LLDB_SOURCE_DIR}/source/Host/common/StringConvert.cpp - ${LLDB_SOURCE_DIR}/source/Host/common/SocketAddress.cpp - # end JSON reader dependencies - libdebugserver.cpp - PseudoTerminal.cpp - PThreadEvent.cpp - PThreadMutex.cpp - RNBContext.cpp - RNBRemote.cpp - RNBServices.cpp - RNBSocket.cpp - SysSignal.cpp - TTYState.cpp - - MacOSX/CFBundle.cpp - MacOSX/CFString.cpp - MacOSX/Genealogy.cpp - MacOSX/MachException.cpp - MacOSX/MachProcess.mm - MacOSX/MachTask.mm - MacOSX/MachThread.cpp - MacOSX/MachThreadList.cpp - MacOSX/MachVMMemory.cpp - MacOSX/MachVMRegion.cpp - MacOSX/OsLogger.cpp - ${generated_mach_interfaces} - ${DEBUGSERVER_VERS_GENERATED_FILE}) - -# Tell LLVM not to complain about these source files. -set(LLVM_OPTIONAL_SOURCES - ${lldbDebugserverCommonSources} - debugserver.cpp) - -add_lldb_library(lldbDebugserverCommon ${lldbDebugserverCommonSources}) -set_target_properties(lldbDebugserverCommon PROPERTIES FOLDER "lldb libraries/debugserver") - -target_link_libraries(lldbDebugserverCommon - INTERFACE ${COCOA_LIBRARY} - ${CORE_FOUNDATION_LIBRARY} - ${FOUNDATION_LIBRARY} - ${BACKBOARD_LIBRARY} - ${FRONTBOARD_LIBRARY} - ${SPRINGBOARD_LIBRARY} - ${MOBILESERVICES_LIBRARY} - ${LOCKDOWN_LIBRARY} - ${CAROUSELSERVICES_LIBRARY} - lldbDebugserverArchSupport - lldbDebugserverDarwin_DarwinLog - ${FOUNDATION_LIBRARY} - ${SECURITY_LIBRARY} - ${LIBCOMPRESSION} - ${ENERGY_LIBRARY}) -if(HAVE_LIBCOMPRESSION) - set_property(TARGET lldbDebugserverCommon APPEND PROPERTY - COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) -endif() -add_lldb_tool(debugserver ADD_TO_FRAMEWORK - debugserver.cpp - LINK_LIBS lldbDebugserverCommon - ENTITLEMENTS ${entitlements} -) - -# Workaround for Xcode-specific code-signing behavior: -# The XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY option causes debugserver to be copied -# into the framework first and code-signed afterwards. Sign the copy manually. -if (debugserver_codesign_identity AND LLDB_BUILD_FRAMEWORK AND - CMAKE_GENERATOR STREQUAL "Xcode") - if(NOT CMAKE_CODESIGN_ALLOCATE) - execute_process( - COMMAND xcrun -f codesign_allocate - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE CMAKE_CODESIGN_ALLOCATE - ) - endif() - if(entitlements) - set(pass_entitlements --entitlements ${entitlements}) - endif() - - set(copy_location ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/debugserver) - - add_custom_command(TARGET debugserver POST_BUILD - COMMAND ${CMAKE_COMMAND} -E - env CODESIGN_ALLOCATE=${CMAKE_CODESIGN_ALLOCATE} - xcrun codesign -f -s ${debugserver_codesign_identity} - ${pass_entitlements} ${copy_location} - COMMENT "Code-sign debugserver copy in the build-tree framework: ${copy_location}" - ) -endif() - -set_target_properties(debugserver PROPERTIES FOLDER "lldb libraries/debugserver") - -if(APPLE_EMBEDDED) - set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS - WITH_LOCKDOWN - WITH_FBS - WITH_BKS - ) - if(CAROUSELSERVICES_LIBRARY) - set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS - WITH_CAROUSEL - ) - endif() - set_property(TARGET debugserver APPEND PROPERTY COMPILE_DEFINITIONS - WITH_LOCKDOWN - WITH_FBS - WITH_BKS - ) - set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS - -F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks - ) - - add_lldb_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources}) - target_link_libraries(lldbDebugserverCommon_NonUI - INTERFACE ${COCOA_LIBRARY} - ${CORE_FOUNDATION_LIBRARY} - ${FOUNDATION_LIBRARY} - lldbDebugserverArchSupport - lldbDebugserverDarwin_DarwinLog - ${SECURITY_LIBRARY} - ${LIBCOMPRESSION}) - if(HAVE_LIBCOMPRESSION) - set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY - COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) - endif() - - add_lldb_tool(debugserver-nonui - debugserver.cpp - - LINK_LIBS - lldbDebugserverCommon_NonUI - - ENTITLEMENTS - ${entitlements} - ) -endif() diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTraceOptions.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTraceOptions.java deleted file mode 100644 index 9bca159b04..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTraceOptions.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - - -public class SBTraceOptions { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTraceOptions(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTraceOptions obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTraceOptions(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTraceOptions() { - this(lldbJNI.new_SBTraceOptions(), true); - } - - public TraceType getType() { - return TraceType.swigToEnum(lldbJNI.SBTraceOptions_getType(swigCPtr, this)); - } - - public java.math.BigInteger getTraceBufferSize() { - return lldbJNI.SBTraceOptions_getTraceBufferSize(swigCPtr, this); - } - - public SBStructuredData getTraceParams(SBError error) { - return new SBStructuredData(lldbJNI.SBTraceOptions_getTraceParams(swigCPtr, this, SBError.getCPtr(error), error), true); - } - - public java.math.BigInteger getMetaDataBufferSize() { - return lldbJNI.SBTraceOptions_getMetaDataBufferSize(swigCPtr, this); - } - - public void setTraceParams(SBStructuredData params) { - lldbJNI.SBTraceOptions_setTraceParams(swigCPtr, this, SBStructuredData.getCPtr(params), params); - } - - public void setType(TraceType type) { - lldbJNI.SBTraceOptions_setType(swigCPtr, this, type.swigValue()); - } - - public void setTraceBufferSize(java.math.BigInteger size) { - lldbJNI.SBTraceOptions_setTraceBufferSize(swigCPtr, this, size); - } - - public void setMetaDataBufferSize(java.math.BigInteger size) { - lldbJNI.SBTraceOptions_setMetaDataBufferSize(swigCPtr, this, size); - } - - public void setThreadID(java.math.BigInteger thread_id) { - lldbJNI.SBTraceOptions_setThreadID(swigCPtr, this, thread_id); - } - - public java.math.BigInteger getThreadID() { - return lldbJNI.SBTraceOptions_getThreadID(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBTraceOptions_IsValid(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_JNIEnv.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_JNIEnv.java deleted file mode 100644 index 0218c36fd3..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_JNIEnv.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - - -public class SWIGTYPE_p_JNIEnv { - private transient long swigCPtr; - - protected SWIGTYPE_p_JNIEnv(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_JNIEnv() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_JNIEnv obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_bool.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_bool.java deleted file mode 100644 index abcca67e7d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_bool.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - - -public class SWIGTYPE_p_bool { - private transient long swigCPtr; - - protected SWIGTYPE_p_bool(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_bool() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_bool obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_byte.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_byte.java deleted file mode 100644 index 6f20b1f826..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_byte.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -public class SWIGTYPE_p_byte { - private transient long swigCPtr; - - protected SWIGTYPE_p_byte(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_byte() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_byte obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_char.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_char.java deleted file mode 100644 index c23cd3eafb..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_char.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -public class SWIGTYPE_p_char { - private transient long swigCPtr; - - protected SWIGTYPE_p_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_char() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_char obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_float.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_float.java deleted file mode 100644 index 8f6412a6c8..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_float.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -public class SWIGTYPE_p_float { - private transient long swigCPtr; - - protected SWIGTYPE_p_float(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_float() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_float obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_char.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_char.java deleted file mode 100644 index 14408d4b95..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_char.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -package SWIG; - - -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - - -public class SWIGTYPE_p_p_char { - private transient long swigCPtr; - - protected SWIGTYPE_p_p_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_p_char() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_p_char obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java index e2f46eefbe..5997e9b965 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java +++ b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java @@ -15,6 +15,7 @@ */ package agent.lldb.lldb; +import java.io.File; import java.math.BigInteger; import java.util.*; @@ -22,8 +23,6 @@ import SWIG.*; import agent.lldb.manager.LldbEvent; import agent.lldb.manager.LldbManager; import agent.lldb.manager.evt.*; -import ghidra.framework.OperatingSystem; -import ghidra.framework.Platform; import ghidra.util.Msg; public class DebugClientImpl implements DebugClient { @@ -41,18 +40,6 @@ public class DebugClientImpl implements DebugClient { @Override public DebugClient createClient() { - try { - if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.LINUX) { - System.load("/usr/lib/liblldb.so"); - } else if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.MAC_OS_X) { - System.load("/usr/lib/liblldb.dylib"); - } else if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) { - System.load("/usr/lib/liblldb.dll"); - } - } - catch (UnsatisfiedLinkError ex) { - Msg.error(this, "LLDB libraries not found for "+Platform.CURRENT_PLATFORM.getOperatingSystem()); - } SBError error = SBDebugger.InitializeWithErrorHandling(); if (!error.Success()) { SBStream stream = new SBStream(); @@ -171,7 +158,8 @@ public class DebugClientImpl implements DebugClient { public SBProcess createProcess(DebugServerId si, String fileName, List args, List envp, List pathsIO, String workingDir, long createFlags, boolean stopAtEntry) { - session = connectSession(fileName); + File f = new File(fileName); //hack to avoid /C:/ + session = connectSession(f.getAbsolutePath()); String[] argArr = args.toArray(new String[args.size()]); // null for envp means use the default environment diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java index 3cd65996df..0cfbbc724f 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java +++ b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java @@ -41,13 +41,37 @@ import agent.lldb.model.iface1.*; import ghidra.async.*; import ghidra.dbg.target.TargetObject; import ghidra.dbg.util.HandlerMap; +import ghidra.framework.OperatingSystem; +import ghidra.framework.Platform; import ghidra.lifecycle.Internal; import ghidra.util.Msg; import ghidra.util.datastruct.ListenerSet; public class LldbManagerImpl implements LldbManager { - private String LldbSrvTransport; + static { + String libPath = System.getProperty("java.library.path"); + try { + String lldb = "lldb"; + if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) { + lldb = "lib" + lldb; // Wow, sigh + } + System.loadLibrary(lldb); + } + catch (UnsatisfiedLinkError ule) { + Msg.error(LldbManagerImpl.class, "java.library.path => " + libPath); + Msg.error(LldbManagerImpl.class, + "liblldb not found - add relevant java.library.path to support/launch.properties"); + } + try { + System.loadLibrary("lldb-java"); + } + catch (UnsatisfiedLinkError ule) { + Msg.error(LldbManagerImpl.class, "java.library.path => " + libPath); + Msg.error(LldbManagerImpl.class, + "liblldb-java not found - add relevant java.library.path to support/launch.properties"); + } + } public DebugStatus status; @@ -119,6 +143,9 @@ public class LldbManagerImpl implements LldbManager { map = new HashMap<>(); threads.put(DebugClient.getId(process), map); } + if (thread == null) { + return; + } String id = DebugClient.getId(thread); SBThread pred = map.get(id); if (!map.containsKey(id) || !thread.equals(pred)) { @@ -703,6 +730,9 @@ public class LldbManagerImpl implements LldbManager { addSessionIfAbsent(eventSession); addProcessIfAbsent(eventSession, eventProcess); addThreadIfAbsent(eventProcess, eventThread); + //SBStream s = new SBStream(); + //event.GetDescription(s); + //System.err.println(s.GetData()); client.translateAndFireEvent(event); } @@ -1013,7 +1043,9 @@ public class LldbManagerImpl implements LldbManager { if (status.equals(DebugStatus.NO_DEBUGGEE)) { waiting = false; if (state.equals(StateType.eStateExited)) { - processEvent(new LldbRunningEvent(DebugClient.getId(eventThread))); + if (eventThread != null) { + processEvent(new LldbRunningEvent(DebugClient.getId(eventThread))); + } processEvent(new LldbProcessExitedEvent(0)); processEvent(new LldbSessionExitedEvent(DebugClient.getId(currentSession), 0)); } @@ -1499,14 +1531,12 @@ public class LldbManagerImpl implements LldbManager { } public SBThread getCurrentThread() { - if (!currentThread.IsValid()) { + if (currentThread != null && !currentThread.IsValid()) { currentProcess = currentSession.GetProcess(); for (int i = 0; i < currentProcess.GetNumThreads(); i++) { SBThread thread = currentProcess.GetThreadAtIndex(i); - System.err.println(thread + ":" + thread.IsValid()); } currentThread = SBThread.GetThreadFromEvent(currentEvent); - System.err.println(currentThread.IsValid()); } return currentThread != null ? currentThread : eventThread; } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java index 294ee8ba41..68cfb505e7 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java +++ b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java @@ -95,6 +95,11 @@ public class LldbModelTargetStackFrameRegisterImpl if (value == null) { return new byte[0]; } + if (value.startsWith("{")) { + String trim = value.substring(1, value.length() - 1); + String[] split = trim.split(" "); + value = split[0].substring(2) + split[1].substring(2); + } BigInteger val = new BigInteger(value, 16); byte[] bytes = ConversionUtils.bigIntegerToBytes((int) getRegister().GetByteSize(), val); changeAttributes(List.of(), Map.of( // diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java index d764e6e00b..ea6899aaee 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java +++ b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java @@ -88,6 +88,9 @@ public class LldbModelTargetThreadContainerImpl extends LldbModelTargetObjectImp @Override public void threadExited(SBThread thread) { + if (thread == null) { + return; + } String threadId = LldbModelTargetThreadImpl.indexThread(thread); LldbModelTargetThread targetThread = (LldbModelTargetThread) getMapObject(thread); if (targetThread != null) { diff --git a/Ghidra/Debug/Debugger-swig-lldb/Module.manifest b/Ghidra/Debug/Debugger-swig-lldb/Module.manifest new file mode 100644 index 0000000000..cde98571eb --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/Module.manifest @@ -0,0 +1 @@ +MODULE FILE LICENSE: src/llvm-project Apache License 2.0 with LLVM Exceptions diff --git a/Ghidra/Debug/Debugger-swig-lldb/build.gradle b/Ghidra/Debug/Debugger-swig-lldb/build.gradle new file mode 100644 index 0000000000..83b7b5882c --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/build.gradle @@ -0,0 +1,50 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +apply from: "$rootProject.projectDir/gradle/javaProject.gradle" +apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle" +apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle" +apply from: "$rootProject.projectDir/gradle/nativeProject.gradle" +apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" +apply from: "buildNatives.gradle" + +apply plugin: 'eclipse' +eclipse.project.name = 'Debug Debugger-swig-lldb' + +dependencies { + api project(':Framework-AsyncComm') + api project(':Framework-Debugging') + api project(':Debugger-gadp') + + testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') + testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') + testImplementation project(path: ':Debugger-gadp', configuration: 'testArtifacts') +} + +sourceSets { + main { + java { + srcDir tasks.generateSwig.outdir_java + } + } +} + +// Include buildable native source in distribution +rootProject.assembleDistribution { + from (this.project.projectDir.toString()) { + include "src/**" + into { getZipPath(this.project) } + } +} diff --git a/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle b/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle new file mode 100644 index 0000000000..326f7efc5c --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle @@ -0,0 +1,124 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Native build files are already applied in development mode (indicated by presence of the +// Generic project). Only need to apply them if we are in a distribution. +if (findProject(':Generic') == null) { + apply from: "../../../GPL/utils.gradle" + apply from: "../../../GPL/nativePlatforms.gradle" + apply from: "../../../GPL/nativeBuildProperties.gradle" +} + +task generateSwig { + ext.srcdir = file("src/llvm-project/lldb/bindings/java") + ext.outdir_java = file("build/generated/src/main/java") + ext.outdir_cpp = file("build/generated/src/main/cpp") + ext.llvm_dir = System.env.LLVM_HOME; + outputs.dir(outdir_java) + outputs.dir(outdir_cpp) + doLast { + if (System.env.LLVM_HOME) { + new File(ext.outdir_java, "/SWIG").mkdirs() + def exe = "swig" + exec { + commandLine exe, "-c++", "-features", "autodoc", "-D__STDC_LIMIT_MACROS", "-D__STDC_CONSTANT_MACROS", + "-I$llvm_dir/lldb/include", "-I$llvm_dir/lldb/bindings", "-java", "-package", "SWIG", "-c++", + "-outdir", "$outdir_java/SWIG", "-o", "$outdir_cpp/LLDBWrapJava.cpp" + args "$srcdir/java.swig" + } + } else { + println "Debugger-swig-lldb:generateSwig skipped - no LLVM_HOME defined" + } + } +} + +/** + * Define the "native build model" for building the SWIG executables. + */ +if (System.env.LLVM_HOME) { + model { + components { + main(NativeLibrarySpec) { + baseName "lldb-java" + targetPlatform "win_x86_64" + targetPlatform "linux_x86_64" + targetPlatform "linux_arm_64" + targetPlatform "mac_x86_64" + targetPlatform "mac_arm_64" + } + } + + binaries { + ext.llvm_dir = System.env.LLVM_HOME; + ext.llvm_build_dir = System.env.LLVM_BUILD; + if (System.env.JAVA_HOME) { + // Allow Gradle's default JAVA_HOME to be overridden by an environment variable we set + project.ext.JAVA_HOME = System.env.JAVA_HOME; + } + else { + project.ext.JAVA_HOME = "${System.properties.'java.home'}" + } + all{ b -> + if (b.targetPlatform.operatingSystem.linux) { + b.cppCompiler.args "-I${JAVA_HOME}/include/linux" + } else if (b.targetPlatform.operatingSystem.windows) { + b.cppCompiler.args "-I${JAVA_HOME}/include/win32" + } else { + b.cppCompiler.args "-I${JAVA_HOME}/include/darwin" + } + if (b.toolChain in Gcc) { + b.cppCompiler.args "-I$llvm_dir/lldb/include" + b.cppCompiler.args "-I${JAVA_HOME}/include" + b.linker.args "-L$llvm_build_dir/lib" + b.linker.args "-llldb" + b.cppCompiler.args "-std=c++14" + b.cppCompiler.args "-O3" + // b.cppCompiler.args "-g" // for DEBUG, uncomment this line + } + else if (b.toolChain in Clang) { + b.cppCompiler.args "-I$llvm_dir/lldb/include" + b.cppCompiler.args "-I${JAVA_HOME}/include" + b.linker.args "-L$llvm_build_dir/lib" + b.linker.args "-llldb" + b.cppCompiler.args "-std=c++14" + b.cppCompiler.args "-O3" + // b.cppCompiler.args "-g" // for DEBUG, uncomment this line + } + else if (b.toolChain in VisualCpp) { + b.cppCompiler.args "/I$llvm_dir/lldb/include" + b.cppCompiler.args "-I${JAVA_HOME}/include" + b.linker.args "/LIBPATH:$llvm_build_dir/lib" + b.linker.args "liblldb.lib" + // b.cppCompiler.args "/Zi" // for DEBUG, uncomment this line + // b.cppCompiler.args "/FS" // for DEBUG, uncomment this line + // b.linker.args "/DEBUG" // for DEBUG, uncomment this line + if (b.targetPlatform.operatingSystem.windows) { + b.cppCompiler.define "WINDOWS" + b.cppCompiler.define "_WINDOWS" + b.cppCompiler.define "WIN32" + b.cppCompiler.define "_WIN32" + if (b.targetPlatform.name == "win_x86_64") { + b.cppCompiler.define "WIN64" + b.cppCompiler.define "_WIN64" + } + } + } + } + } + } +} else { + println "Debugger-swig-lldb:buildNatives skipped - no LLVM_HOME defined" +} diff --git a/Ghidra/Debug/Debugger-swig-lldb/certification.manifest b/Ghidra/Debug/Debugger-swig-lldb/certification.manifest new file mode 100644 index 0000000000..203c4c7446 --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/certification.manifest @@ -0,0 +1,10 @@ +##VERSION: 2.0 +##MODULE IP: Apache License 2.0 +##MODULE IP: Apache License 2.0 with LLVM Exceptions +.classpath||NONE||reviewed||END| +.project||NONE||reviewed||END| +Module.manifest||GHIDRA||||END| +build.gradle||GHIDRA||||END| +data/InstructionsForBuildingLLDBInterface.txt||GHIDRA||||END| +src/llvm-project/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END| +src/llvm-project/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END| diff --git a/Ghidra/Debug/Debugger-swig-lldb/data/InstructionsForBuildingLLDBInterface.txt b/Ghidra/Debug/Debugger-swig-lldb/data/InstructionsForBuildingLLDBInterface.txt new file mode 100644 index 0000000000..a25871579a --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/data/InstructionsForBuildingLLDBInterface.txt @@ -0,0 +1,56 @@ +To use the LLDB agent in Ghidra, you will need to build the JNI interface to the LLDB Scripting Bridge. + +To do this: +(1) check the version for your copy of lldb: + lldb --version + +If you have a version other than the most current (release/13.x), you will need to either +install v13 or generate the JNI interface for the version you have. + +(2a) To install LLVM/lldb version 13: + - git clone https://github.com/llvm/llvm-project.git + - git checkout release/13.x + - cd llvm-project + - mkdir build && cd build + - cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;libcxx;lldb" -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_LINKER=gold ../llvm + - ninja lldb + - ninja lldb-server + - ninja install + +(2b) To generate the JNI for your version + - git clone https://github.com/llvm/llvm-project.git + - git checkout release/YOUR_VERSION.x + - export LLVM_HOME=/path_to_llvm-project + + - cd Ghidra/Debug/Debugger-swig-lldb + - gradle generateSwig + - cp -r build/generated/src/main src + +If you have the most current version or have completed step (2), you can: + +(3) Compile the JNI interface by: + - export JAVA_HOME=/path_to_java + - export LLVM_HOME=/path_to_llvm-project + - export LLVM_BUILD=/path_to_llvm_build_directory_or_whatever_contains_lib/liblldb.(so/dylib/dll) + (for Windows, these vars should have the drive: prefix and probably not have spaces) + - cd Ghidra/Debug/Debugger-swig-lldb + - gradle build + +(4) To run: + - add -Djava.library.path=/path_to/liblldb:/path_to/liblldb-java:etc in support/launch.properties or, + if you're running out of Eclipse, to the arguments in the Run/Debug Configuration + +TROUBLESHOOTING: +(1) If you are trying to execute "gradle buildGhidra" with LLVM_HOME already set, you are likely + to run into difficulties. Unset LLVM_HOME (or on Windows set LLVM_HOME=) before running. +(2) If you are running "gradle generateSwig" and encounter errors, make sure LLVM_HOME is set. +(3) If you are running "gradle buildNatives" and it succeeds but there is no library in Ghidra/ + Debug/Debugger-swig/lldb/build/os, again check LLVM_HOME, LLVM_BUILD, and JAVA_HOME. Keep + in mind that different generators for LLVM, esp. for Window, may put liblldb.xxx in unusual + places. Check "build/lib", "build/bin", and subdirs like "build/Release/bin". +(4) If you get an "Unsatisfied Link Error" when you start the debugger, make sure both liblldb + and liblldb-java are in the path described by java.library.path. +(5) Link errors can also be caused by different architectures or platforms for the libraries. + + + \ No newline at end of file diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig b/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig new file mode 100644 index 0000000000..e23628eb30 --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig @@ -0,0 +1,18 @@ +%include +%include +%include + +%typemap(javabase) ByteArray "SWIGTYPE_p_void" +%typemap(javabody) ByteArray %{ + private long swigCPtr; // Minor bodge to work around private variable in parent + private boolean swigCMemOwn; + public $javaclassname(long cPtr, boolean cMemoryOwn) { + super(cPtr, cMemoryOwn); + this.swigCPtr = SWIGTYPE_p_void.getCPtr(this); + swigCMemOwn = cMemoryOwn; + } +%} + +%array_class(jbyte, ByteArray); + +%apply char **STRING_ARRAY { char ** } diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig b/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig new file mode 100644 index 0000000000..305ecc6b70 --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig @@ -0,0 +1,22 @@ +/* + lldb.swig + + This is the input file for SWIG, to create the appropriate C++ wrappers and + functions for various scripting languages, to enable them to call the + liblldb Script Bridge functions. +*/ + +%module lldb + +%include +%include "java-typemaps.swig" +%include "macros.swig" +%include "headers.swig" + +%{ +using namespace lldb_private; +using namespace lldb; +%} + +%include "interfaces.swig" + diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/LLDBWrapJava.cpp b/Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/LLDBWrapJava.cpp rename to Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp index 99068f6250..57fefeaca4 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm/lldb/LLDBWrapJava.cpp +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp @@ -3,7 +3,7 @@ */ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -319,7 +319,6 @@ SWIGINTERN ByteArray *ByteArray_frompointer(jbyte *t){ #include "lldb/API/SBThreadCollection.h" #include "lldb/API/SBThreadPlan.h" #include "lldb/API/SBTrace.h" -#include "lldb/API/SBTraceOptions.h" #include "lldb/API/SBType.h" #include "lldb/API/SBTypeCategory.h" #include "lldb/API/SBTypeEnumMember.h" @@ -1160,6 +1159,18 @@ SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG8_1get(JNIEn } +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1STOP_1ID_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + result = (int)(0); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1ADDRESS_1get(JNIEnv *jenv, jclass jcls) { jobject jresult = 0 ; unsigned long long result; @@ -4091,6 +4102,66 @@ SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eExpressionEvaluationParse_1get(JNIEnv } +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceInstructionControlFlowTypeInstruction_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::TraceInstructionControlFlowType result; + + (void)jenv; + (void)jcls; + result = (lldb::TraceInstructionControlFlowType)lldb::eTraceInstructionControlFlowTypeInstruction; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceInstructionControlFlowTypeBranch_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::TraceInstructionControlFlowType result; + + (void)jenv; + (void)jcls; + result = (lldb::TraceInstructionControlFlowType)lldb::eTraceInstructionControlFlowTypeBranch; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceInstructionControlFlowTypeTakenBranch_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::TraceInstructionControlFlowType result; + + (void)jenv; + (void)jcls; + result = (lldb::TraceInstructionControlFlowType)lldb::eTraceInstructionControlFlowTypeTakenBranch; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceInstructionControlFlowTypeCall_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::TraceInstructionControlFlowType result; + + (void)jenv; + (void)jcls; + result = (lldb::TraceInstructionControlFlowType)lldb::eTraceInstructionControlFlowTypeCall; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceInstructionControlFlowTypeReturn_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::TraceInstructionControlFlowType result; + + (void)jenv; + (void)jcls; + result = (lldb::TraceInstructionControlFlowType)lldb::eTraceInstructionControlFlowTypeReturn; + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointKindWrite_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; lldb::WatchpointKind result; @@ -4607,6 +4678,42 @@ SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeSummaryUncapped_1get(JNIEnv *jenv } +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreUnspecified_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::SaveCoreStyle result; + + (void)jenv; + (void)jcls; + result = (lldb::SaveCoreStyle)lldb::eSaveCoreUnspecified; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreFull_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::SaveCoreStyle result; + + (void)jenv; + (void)jcls; + result = (lldb::SaveCoreStyle)lldb::eSaveCoreFull; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreDirtyOnly_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + lldb::SaveCoreStyle result; + + (void)jenv; + (void)jcls; + result = (lldb::SaveCoreStyle)lldb::eSaveCoreDirtyOnly; + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAddress_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; lldb::SBAddress *result = 0 ; @@ -20671,6 +20778,85 @@ SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetName(JNIEnv } +SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1HasDirtyMemoryPageList(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; + result = (bool)(arg1)->HasDirtyMemoryPageList(); + jresult = (jboolean)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetNumDirtyPages(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; + uint32_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; + result = (uint32_t)(arg1)->GetNumDirtyPages(); + jresult = (jlong)result; + return jresult; +} + + +SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetDirtyPageAddressAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + jobject jresult = 0 ; + lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; + uint32_t arg2 ; + lldb::addr_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; + arg2 = (uint32_t)jarg2; + result = (lldb::addr_t)(arg1)->GetDirtyPageAddressAtIndex(arg2); + { + jbyteArray ba = jenv->NewByteArray(9); + jbyte* bae = jenv->GetByteArrayElements(ba, 0); + jclass clazz = jenv->FindClass("java/math/BigInteger"); + jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); + jobject bigint; + int i; + + bae[0] = 0; + for(i=1; i<9; i++ ) { + bae[i] = (jbyte)(result>>8*(8-i)); + } + + jenv->ReleaseByteArrayElements(ba, bae, 0); + bigint = jenv->NewObject(clazz, mid, ba); + jenv->DeleteLocalRef(ba); + jresult = bigint; + } + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetPageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; + result = (int)(arg1)->GetPageSize(); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jboolean jresult = 0 ; lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; @@ -25182,35 +25368,6 @@ SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1SaveCore(JNIEnv *jenv, jcl } -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1StartTrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBTraceOptions *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; - lldb::SBTrace result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBTraceOptions **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTraceOptions & reference is null"); - return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); - return 0; - } - result = (arg1)->StartTrace(*arg2,*arg3); - *(lldb::SBTrace **)&jresult = new lldb::SBTrace((const lldb::SBTrace &)result); - return jresult; -} - - SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetMemoryRegionInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { jlong jresult = 0 ; lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; @@ -25290,6 +25447,91 @@ SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetProcessInfo(JNIEnv *jen } +SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcess_1AllocateMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { + jobject jresult = 0 ; + lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; + size_t arg2 ; + uint32_t arg3 ; + lldb::SBError *arg4 = 0 ; + lldb::addr_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg4_; + arg1 = *(lldb::SBProcess **)&jarg1; + arg2 = (size_t)jarg2; + arg3 = (uint32_t)jarg3; + arg4 = *(lldb::SBError **)&jarg4; + if (!arg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); + return 0; + } + result = (lldb::addr_t)(arg1)->AllocateMemory(arg2,arg3,*arg4); + { + jbyteArray ba = jenv->NewByteArray(9); + jbyte* bae = jenv->GetByteArrayElements(ba, 0); + jclass clazz = jenv->FindClass("java/math/BigInteger"); + jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); + jobject bigint; + int i; + + bae[0] = 0; + for(i=1; i<9; i++ ) { + bae[i] = (jbyte)(result>>8*(8-i)); + } + + jenv->ReleaseByteArrayElements(ba, bae, 0); + bigint = jenv->NewObject(clazz, mid, ba); + jenv->DeleteLocalRef(ba); + jresult = bigint; + } + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1DeallocateMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { + jlong jresult = 0 ; + lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; + lldb::addr_t arg2 ; + lldb::SBError result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBProcess **)&jarg1; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg2); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg2 = 0; + if (sz > 0) { + arg2 = (lldb::addr_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + result = (arg1)->DeallocateMemory(arg2); + *(lldb::SBError **)&jresult = new lldb::SBError((const lldb::SBError &)result); + return jresult; +} + + SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1_1_1str_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; @@ -25575,6 +25817,21 @@ SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetParentProcessID(J } +SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBProcessInfo **)&jarg1; + result = (char *)(arg1)->GetTriple(); + if (result) jresult = jenv->NewStringUTF((const char *)result); + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBQueue_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; lldb::SBQueue *result = 0 ; @@ -27435,7 +27692,7 @@ SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetDescription(JNIE } -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1SetFromJSON(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1SetFromJSON_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jlong jresult = 0 ; lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; lldb::SBStream *arg2 = 0 ; @@ -27457,6 +27714,28 @@ SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1SetFromJSON(JNIEnv } +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1SetFromJSON_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { + jlong jresult = 0 ; + lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; + char *arg2 = (char *) 0 ; + lldb::SBError result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBStructuredData **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + result = (arg1)->SetFromJSON((char const *)arg2); + *(lldb::SBError **)&jresult = new lldb::SBError((const lldb::SBError &)result); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbol_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; lldb::SBSymbol *result = 0 ; @@ -31967,6 +32246,43 @@ SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTarget_1_1_1str_1_1(JNIEnv *jenv, } +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetTrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; + lldb::SBTrace result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lldb::SBTarget **)&jarg1; + result = (arg1)->GetTrace(); + *(lldb::SBTrace **)&jresult = new lldb::SBTrace((const lldb::SBTrace &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1CreateTrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + jlong jresult = 0 ; + lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; + lldb::SBError *arg2 = 0 ; + lldb::SBTrace result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(lldb::SBTarget **)&jarg1; + arg2 = *(lldb::SBError **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); + return 0; + } + result = (arg1)->CreateTrace(*arg2); + *(lldb::SBTrace **)&jresult = new lldb::SBTrace((const lldb::SBTrace &)result); + return jresult; +} + + SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1eBroadcastBitStackChanged_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; @@ -33960,165 +34276,49 @@ SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTrace(JNIEnv *jenv, jclass jcl } -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1GetTraceData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg6) { - jlong jresult = 0 ; +SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTrace_1GetStartConfigurationHelp(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError *arg2 = 0 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - size_t arg5 ; - lldb::tid_t arg6 ; - size_t result; + char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - (void)jarg2_; arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); - return 0; - } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = (size_t)jarg5; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg6); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg6, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg6 = 0; - if (sz > 0) { - arg6 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetTraceData(*arg2,arg3,arg4,arg5,arg6); - jresult = (jlong)result; + result = (char *)(arg1)->GetStartConfigurationHelp(); + if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1GetMetaData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg6) { +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Start_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jlong jresult = 0 ; lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError *arg2 = 0 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - size_t arg5 ; - lldb::tid_t arg6 ; - size_t result; + lldb::SBStructuredData *arg2 = 0 ; + lldb::SBError result; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg2_; arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; + arg2 = *(lldb::SBStructuredData **)&jarg2; if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData const & reference is null"); return 0; } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = (size_t)jarg5; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg6); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg6, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg6 = 0; - if (sz > 0) { - arg6 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetMetaData(*arg2,arg3,arg4,arg5,arg6); - jresult = (jlong)result; + result = (arg1)->Start((lldb::SBStructuredData const &)*arg2); + *(lldb::SBError **)&jresult = new lldb::SBError((const lldb::SBError &)result); return jresult; } -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTrace_1StopTrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Start_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + jlong jresult = 0 ; lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::tid_t arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); - return ; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->StopTrace(*arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTrace_1GetTraceConfig(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBTraceOptions *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; + lldb::SBThread *arg2 = 0 ; + lldb::SBStructuredData *arg3 = 0 ; + lldb::SBError result; (void)jenv; (void)jcls; @@ -34126,48 +34326,55 @@ SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTrace_1GetTraceConfig(JNIEnv *jenv, (void)jarg2_; (void)jarg3_; arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBTraceOptions **)&jarg2; + arg2 = *(lldb::SBThread **)&jarg2; if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTraceOptions & reference is null"); - return ; + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread const & reference is null"); + return 0; } - arg3 = *(lldb::SBError **)&jarg3; + arg3 = *(lldb::SBStructuredData **)&jarg3; if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); - return ; + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData const & reference is null"); + return 0; } - (arg1)->GetTraceConfig(*arg2,*arg3); + result = (arg1)->Start((lldb::SBThread const &)*arg2,(lldb::SBStructuredData const &)*arg3); + *(lldb::SBError **)&jresult = new lldb::SBError((const lldb::SBError &)result); + return jresult; } -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTrace_1GetTraceUID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Stop_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::user_id_t result; + lldb::SBError result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(lldb::SBTrace **)&jarg1; - result = (lldb::user_id_t)(arg1)->GetTraceUID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } + result = (arg1)->Stop(); + *(lldb::SBError **)&jresult = new lldb::SBError((const lldb::SBError &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Stop_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + jlong jresult = 0 ; + lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; + lldb::SBThread *arg2 = 0 ; + lldb::SBError result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(lldb::SBTrace **)&jarg1; + arg2 = *(lldb::SBThread **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread const & reference is null"); + return 0; + } + result = (arg1)->Stop((lldb::SBThread const &)*arg2); + *(lldb::SBError **)&jresult = new lldb::SBError((const lldb::SBError &)result); return jresult; } @@ -34197,321 +34404,6 @@ SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTrace(JNIEnv *jenv, jclass j } -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTraceOptions(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTraceOptions *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTraceOptions *)new lldb::SBTraceOptions(); - *(lldb::SBTraceOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1getType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - lldb::TraceType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - result = (lldb::TraceType)((lldb::SBTraceOptions const *)arg1)->getType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1getTraceBufferSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - result = (uint64_t)((lldb::SBTraceOptions const *)arg1)->getTraceBufferSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1getTraceParams(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & reference is null"); - return 0; - } - result = (arg1)->getTraceParams(*arg2); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData((const lldb::SBStructuredData &)result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1getMetaDataBufferSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - result = (uint64_t)((lldb::SBTraceOptions const *)arg1)->getMetaDataBufferSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1setTraceParams(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - lldb::SBStructuredData *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - arg2 = *(lldb::SBStructuredData **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & reference is null"); - return ; - } - (arg1)->setTraceParams(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1setType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - lldb::TraceType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - arg2 = (lldb::TraceType)jarg2; - (arg1)->setType(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1setTraceBufferSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - uint64_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->setTraceBufferSize(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1setMetaDataBufferSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - uint64_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->setMetaDataBufferSize(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1setThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - lldb::tid_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->setThreadID(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1getThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - lldb::tid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - result = (lldb::tid_t)(arg1)->getThreadID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceOptions_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTraceOptions(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTraceOptions **)&jarg1; - delete arg1; -} - - SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeMember_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; lldb::SBTypeMember *result = 0 ; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/AccessType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/AccessType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java index aee30e8fdf..3dcccf5326 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/AccessType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class AccessType { public final static AccessType eAccessNone = new AccessType("eAccessNone"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/BasicType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/BasicType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java index ffaf1399e7..1c3c4db06d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/BasicType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class BasicType { public final static BasicType eBasicTypeInvalid = new BasicType("eBasicTypeInvalid", lldbJNI.eBasicTypeInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/BreakpointEventType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/BreakpointEventType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java index 25bca71ef6..784b5c99f6 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/BreakpointEventType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class BreakpointEventType { public final static BreakpointEventType eBreakpointEventTypeInvalidType = new BreakpointEventType("eBreakpointEventTypeInvalidType", lldbJNI.eBreakpointEventTypeInvalidType_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ByteArray.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ByteArray.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java index 6f8c11cf94..b1778f56b9 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ByteArray.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java @@ -3,7 +3,7 @@ */ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -47,7 +47,6 @@ public class ByteArray extends SWIGTYPE_p_void { lldbJNI.ByteArray_setitem(swigCPtr, this, index, value); } - /* public SWIGTYPE_p_jbyte cast() { long cPtr = lldbJNI.ByteArray_cast(swigCPtr, this); return (cPtr == 0) ? null : new SWIGTYPE_p_jbyte(cPtr, false); @@ -57,6 +56,5 @@ public class ByteArray extends SWIGTYPE_p_void { long cPtr = lldbJNI.ByteArray_frompointer(SWIGTYPE_p_jbyte.getCPtr(t)); return (cPtr == 0) ? null : new ByteArray(cPtr, false); } - */ } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ByteOrder.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ByteOrder.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java index 4dbb70875a..f1a69bed8e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ByteOrder.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ByteOrder { public final static ByteOrder eByteOrderInvalid = new ByteOrder("eByteOrderInvalid", lldbJNI.eByteOrderInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandArgumentType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandArgumentType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java index 3bfdb43ab7..4c9e381dd7 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandArgumentType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class CommandArgumentType { public final static CommandArgumentType eArgTypeAddress = new CommandArgumentType("eArgTypeAddress", lldbJNI.eArgTypeAddress_get()); @@ -102,6 +100,7 @@ public final class CommandArgumentType { public final static CommandArgumentType eArgTypeCommand = new CommandArgumentType("eArgTypeCommand"); public final static CommandArgumentType eArgTypeColumnNum = new CommandArgumentType("eArgTypeColumnNum"); public final static CommandArgumentType eArgTypeModuleUUID = new CommandArgumentType("eArgTypeModuleUUID"); + public final static CommandArgumentType eArgTypeSaveCoreStyle = new CommandArgumentType("eArgTypeSaveCoreStyle"); public final static CommandArgumentType eArgTypeLastArg = new CommandArgumentType("eArgTypeLastArg"); public final int swigValue() { @@ -138,7 +137,7 @@ public final class CommandArgumentType { swigNext = this.swigValue+1; } - private static CommandArgumentType[] swigValues = { eArgTypeAddress, eArgTypeAddressOrExpression, eArgTypeAliasName, eArgTypeAliasOptions, eArgTypeArchitecture, eArgTypeBoolean, eArgTypeBreakpointID, eArgTypeBreakpointIDRange, eArgTypeBreakpointName, eArgTypeByteSize, eArgTypeClassName, eArgTypeCommandName, eArgTypeCount, eArgTypeDescriptionVerbosity, eArgTypeDirectoryName, eArgTypeDisassemblyFlavor, eArgTypeEndAddress, eArgTypeExpression, eArgTypeExpressionPath, eArgTypeExprFormat, eArgTypeFileLineColumn, eArgTypeFilename, eArgTypeFormat, eArgTypeFrameIndex, eArgTypeFullName, eArgTypeFunctionName, eArgTypeFunctionOrSymbol, eArgTypeGDBFormat, eArgTypeHelpText, eArgTypeIndex, eArgTypeLanguage, eArgTypeLineNum, eArgTypeLogCategory, eArgTypeLogChannel, eArgTypeMethod, eArgTypeName, eArgTypeNewPathPrefix, eArgTypeNumLines, eArgTypeNumberPerLine, eArgTypeOffset, eArgTypeOldPathPrefix, eArgTypeOneLiner, eArgTypePath, eArgTypePermissionsNumber, eArgTypePermissionsString, eArgTypePid, eArgTypePlugin, eArgTypeProcessName, eArgTypePythonClass, eArgTypePythonFunction, eArgTypePythonScript, eArgTypeQueueName, eArgTypeRegisterName, eArgTypeRegularExpression, eArgTypeRunArgs, eArgTypeRunMode, eArgTypeScriptedCommandSynchronicity, eArgTypeScriptLang, eArgTypeSearchWord, eArgTypeSelector, eArgTypeSettingIndex, eArgTypeSettingKey, eArgTypeSettingPrefix, eArgTypeSettingVariableName, eArgTypeShlibName, eArgTypeSourceFile, eArgTypeSortOrder, eArgTypeStartAddress, eArgTypeSummaryString, eArgTypeSymbol, eArgTypeThreadID, eArgTypeThreadIndex, eArgTypeThreadName, eArgTypeTypeName, eArgTypeUnsignedInteger, eArgTypeUnixSignal, eArgTypeVarName, eArgTypeValue, eArgTypeWidth, eArgTypeNone, eArgTypePlatform, eArgTypeWatchpointID, eArgTypeWatchpointIDRange, eArgTypeWatchType, eArgRawInput, eArgTypeCommand, eArgTypeColumnNum, eArgTypeModuleUUID, eArgTypeLastArg }; + private static CommandArgumentType[] swigValues = { eArgTypeAddress, eArgTypeAddressOrExpression, eArgTypeAliasName, eArgTypeAliasOptions, eArgTypeArchitecture, eArgTypeBoolean, eArgTypeBreakpointID, eArgTypeBreakpointIDRange, eArgTypeBreakpointName, eArgTypeByteSize, eArgTypeClassName, eArgTypeCommandName, eArgTypeCount, eArgTypeDescriptionVerbosity, eArgTypeDirectoryName, eArgTypeDisassemblyFlavor, eArgTypeEndAddress, eArgTypeExpression, eArgTypeExpressionPath, eArgTypeExprFormat, eArgTypeFileLineColumn, eArgTypeFilename, eArgTypeFormat, eArgTypeFrameIndex, eArgTypeFullName, eArgTypeFunctionName, eArgTypeFunctionOrSymbol, eArgTypeGDBFormat, eArgTypeHelpText, eArgTypeIndex, eArgTypeLanguage, eArgTypeLineNum, eArgTypeLogCategory, eArgTypeLogChannel, eArgTypeMethod, eArgTypeName, eArgTypeNewPathPrefix, eArgTypeNumLines, eArgTypeNumberPerLine, eArgTypeOffset, eArgTypeOldPathPrefix, eArgTypeOneLiner, eArgTypePath, eArgTypePermissionsNumber, eArgTypePermissionsString, eArgTypePid, eArgTypePlugin, eArgTypeProcessName, eArgTypePythonClass, eArgTypePythonFunction, eArgTypePythonScript, eArgTypeQueueName, eArgTypeRegisterName, eArgTypeRegularExpression, eArgTypeRunArgs, eArgTypeRunMode, eArgTypeScriptedCommandSynchronicity, eArgTypeScriptLang, eArgTypeSearchWord, eArgTypeSelector, eArgTypeSettingIndex, eArgTypeSettingKey, eArgTypeSettingPrefix, eArgTypeSettingVariableName, eArgTypeShlibName, eArgTypeSourceFile, eArgTypeSortOrder, eArgTypeStartAddress, eArgTypeSummaryString, eArgTypeSymbol, eArgTypeThreadID, eArgTypeThreadIndex, eArgTypeThreadName, eArgTypeTypeName, eArgTypeUnsignedInteger, eArgTypeUnixSignal, eArgTypeVarName, eArgTypeValue, eArgTypeWidth, eArgTypeNone, eArgTypePlatform, eArgTypeWatchpointID, eArgTypeWatchpointIDRange, eArgTypeWatchType, eArgRawInput, eArgTypeCommand, eArgTypeColumnNum, eArgTypeModuleUUID, eArgTypeSaveCoreStyle, eArgTypeLastArg }; private static int swigNext = 0; private final int swigValue; private final String swigName; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandFlags.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandFlags.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java index 247648b7ec..e9bba119c5 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandFlags.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class CommandFlags { public final static CommandFlags eCommandRequiresTarget = new CommandFlags("eCommandRequiresTarget", lldbJNI.eCommandRequiresTarget_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandInterpreterResult.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandInterpreterResult.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java index 5fffad83eb..fabd7ebefa 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/CommandInterpreterResult.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class CommandInterpreterResult { public final static CommandInterpreterResult eCommandInterpreterResultSuccess = new CommandInterpreterResult("eCommandInterpreterResultSuccess"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ConnectionStatus.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ConnectionStatus.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java index 384d2e39bf..3c64f00856 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ConnectionStatus.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ConnectionStatus { public final static ConnectionStatus eConnectionStatusSuccess = new ConnectionStatus("eConnectionStatusSuccess"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/DescriptionLevel.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/DescriptionLevel.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java index c21cb8d5b6..dd47371fa8 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/DescriptionLevel.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class DescriptionLevel { public final static DescriptionLevel eDescriptionLevelBrief = new DescriptionLevel("eDescriptionLevelBrief", lldbJNI.eDescriptionLevelBrief_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/DynamicValueType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/DynamicValueType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java index f71f03700e..a09879ef3d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/DynamicValueType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class DynamicValueType { public final static DynamicValueType eNoDynamicValues = new DynamicValueType("eNoDynamicValues", lldbJNI.eNoDynamicValues_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/EmulateInstructionOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/EmulateInstructionOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java index 51930624a1..5661d99a14 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/EmulateInstructionOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class EmulateInstructionOptions { public final static EmulateInstructionOptions eEmulateInstructionOptionNone = new EmulateInstructionOptions("eEmulateInstructionOptionNone", lldbJNI.eEmulateInstructionOptionNone_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Encoding.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Encoding.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java index 4938f23aaa..4ff14ca3b2 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Encoding.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class Encoding { public final static Encoding eEncodingInvalid = new Encoding("eEncodingInvalid", lldbJNI.eEncodingInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ErrorType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ErrorType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java index 29f7841330..8e336a6521 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ErrorType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ErrorType { public final static ErrorType eErrorTypeInvalid = new ErrorType("eErrorTypeInvalid"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java index adf48fedf4..3da88192af 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ExpressionEvaluationPhase { public final static ExpressionEvaluationPhase eExpressionEvaluationParse = new ExpressionEvaluationPhase("eExpressionEvaluationParse", lldbJNI.eExpressionEvaluationParse_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ExpressionResults.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ExpressionResults.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java index ba680e393f..a73f070ee1 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ExpressionResults.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ExpressionResults { public final static ExpressionResults eExpressionCompleted = new ExpressionResults("eExpressionCompleted", lldbJNI.eExpressionCompleted_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FilePermissions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FilePermissions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java index 14488826c4..5f773e80d4 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FilePermissions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class FilePermissions { public final static FilePermissions eFilePermissionsUserRead = new FilePermissions("eFilePermissionsUserRead", lldbJNI.eFilePermissionsUserRead_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Format.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Format.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java index b832ce434f..13a840f14c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Format.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class Format { public final static Format eFormatDefault = new Format("eFormatDefault", lldbJNI.eFormatDefault_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FrameComparison.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FrameComparison.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java index 89e6e3b4ec..b326a4ff36 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FrameComparison.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class FrameComparison { public final static FrameComparison eFrameCompareInvalid = new FrameComparison("eFrameCompareInvalid"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FunctionNameType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FunctionNameType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java index 3377af9fde..ab1f9d991b 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/FunctionNameType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class FunctionNameType { public final static FunctionNameType eFunctionNameTypeNone = new FunctionNameType("eFunctionNameTypeNone", lldbJNI.eFunctionNameTypeNone_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/GdbSignal.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/GdbSignal.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java index 6f79b50da6..f8c3fa0464 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/GdbSignal.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class GdbSignal { public final static GdbSignal eGdbSignalBadAccess = new GdbSignal("eGdbSignalBadAccess", lldbJNI.eGdbSignalBadAccess_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InputReaderAction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InputReaderAction.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java index 7e9f99eae2..69119caecc 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InputReaderAction.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class InputReaderAction { public final static InputReaderAction eInputReaderActivate = new InputReaderAction("eInputReaderActivate"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InputReaderGranularity.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InputReaderGranularity.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java index 3b59984ffd..cfc2b89b73 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InputReaderGranularity.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class InputReaderGranularity { public final static InputReaderGranularity eInputReaderGranularityInvalid = new InputReaderGranularity("eInputReaderGranularityInvalid", lldbJNI.eInputReaderGranularityInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java index 74a012dc92..816a682eb2 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class InstrumentationRuntimeType { public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeAddressSanitizer = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeAddressSanitizer", lldbJNI.eInstrumentationRuntimeTypeAddressSanitizer_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/LanguageType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/LanguageType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java index 9df42dbb00..eb5e298148 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/LanguageType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class LanguageType { public final static LanguageType eLanguageTypeUnknown = new LanguageType("eLanguageTypeUnknown", lldbJNI.eLanguageTypeUnknown_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/LaunchFlags.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/LaunchFlags.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java index 43b34ef7dd..06bb429d01 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/LaunchFlags.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class LaunchFlags { public final static LaunchFlags eLaunchFlagNone = new LaunchFlags("eLaunchFlagNone", lldbJNI.eLaunchFlagNone_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/MatchType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/MatchType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java index 0997602a93..19e27a0f81 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/MatchType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class MatchType { public final static MatchType eMatchTypeNormal = new MatchType("eMatchTypeNormal"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/MemberFunctionKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/MemberFunctionKind.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java index c2d106211c..0914dd5331 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/MemberFunctionKind.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class MemberFunctionKind { public final static MemberFunctionKind eMemberFunctionKindUnknown = new MemberFunctionKind("eMemberFunctionKindUnknown", lldbJNI.eMemberFunctionKindUnknown_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/PathType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/PathType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java index f809c9fb49..755c8fee34 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/PathType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class PathType { public final static PathType ePathTypeLLDBShlibDir = new PathType("ePathTypeLLDBShlibDir"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Permissions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Permissions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java index fdcdb96889..ce2a64f517 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/Permissions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class Permissions { public final static Permissions ePermissionsWritable = new Permissions("ePermissionsWritable", lldbJNI.ePermissionsWritable_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/QueueItemKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/QueueItemKind.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java index adacc1db39..0545a33513 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/QueueItemKind.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class QueueItemKind { public final static QueueItemKind eQueueItemKindUnknown = new QueueItemKind("eQueueItemKindUnknown", lldbJNI.eQueueItemKindUnknown_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/QueueKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/QueueKind.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java index 1272b0e774..fc5986322b 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/QueueKind.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class QueueKind { public final static QueueKind eQueueKindUnknown = new QueueKind("eQueueKindUnknown", lldbJNI.eQueueKindUnknown_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/RegisterKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/RegisterKind.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java index 7756dc0b24..d65d22fb8d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/RegisterKind.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class RegisterKind { public final static RegisterKind eRegisterKindEHFrame = new RegisterKind("eRegisterKindEHFrame", lldbJNI.eRegisterKindEHFrame_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ReturnStatus.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ReturnStatus.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java index a92eddfc37..8394b20e74 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ReturnStatus.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ReturnStatus { public final static ReturnStatus eReturnStatusInvalid = new ReturnStatus("eReturnStatusInvalid"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/RunMode.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/RunMode.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java index b3901e7ddc..ea40b095e6 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/RunMode.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class RunMode { public final static RunMode eOnlyThisThread = new RunMode("eOnlyThisThread"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBAddress.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBAddress.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java index 821551d6a3..4bd31d4331 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBAddress.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBAddress { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBAttachInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBAttachInfo.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java index 6a6602cc03..a11cc099d0 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBAttachInfo.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBAttachInfo { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBlock.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBlock.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java index 1e5fe97790..c079ddbbdc 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBlock.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBBlock { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpoint.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpoint.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java index eb0d7d38bd..887a4bdee1 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpoint.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBBreakpoint { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java index f4542d6b1b..29ec37c8c6 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBBreakpointList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointLocation.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointLocation.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java index 29003e6371..ab2ef22055 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointLocation.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBBreakpointLocation { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointName.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointName.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java index c11cf0b3b7..ce82ad4ca2 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBreakpointName.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBBreakpointName { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBroadcaster.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBroadcaster.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java index 90b6f3cb67..76c4cb5c2d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBBroadcaster.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBBroadcaster { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandInterpreter.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandInterpreter.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java index 16e118e687..e55e19c360 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandInterpreter.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBCommandInterpreter { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java similarity index 91% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java index ae19797125..b15876098a 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBCommandInterpreterRunOptions { private transient long swigCPtr; @@ -85,6 +83,14 @@ public class SBCommandInterpreterRunOptions { lldbJNI.SBCommandInterpreterRunOptions_SetPrintResults(swigCPtr, this, arg0); } + public boolean GetPrintErrors() { + return lldbJNI.SBCommandInterpreterRunOptions_GetPrintErrors(swigCPtr, this); + } + + public void SetPrintErrors(boolean arg0) { + lldbJNI.SBCommandInterpreterRunOptions_SetPrintErrors(swigCPtr, this, arg0); + } + public boolean GetAddToHistory() { return lldbJNI.SBCommandInterpreterRunOptions_GetAddToHistory(swigCPtr, this); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandReturnObject.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandReturnObject.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java index 9ca413fcb2..e161eb7098 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommandReturnObject.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBCommandReturnObject { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommunication.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommunication.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java index a786d200b7..bfab5860fd 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCommunication.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBCommunication { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCompileUnit.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCompileUnit.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java index 98ca26dc9d..2adb19ea57 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBCompileUnit.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBCompileUnit { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBData.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBData.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java index a721755d9e..f469f93d45 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBData.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBData { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBDebugger.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBDebugger.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java index ddc9e3cfd6..2064de2182 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBDebugger.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java @@ -1,17 +1,16 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; + public class SBDebugger { private transient long swigCPtr; protected transient boolean swigCMemOwn; @@ -428,6 +427,10 @@ public class SBDebugger { return new SBTypeSynthetic(lldbJNI.SBDebugger_GetSyntheticForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); } + public SBStructuredData GetScriptInterpreterInfo(ScriptLanguage arg0) { + return new SBStructuredData(lldbJNI.SBDebugger_GetScriptInterpreterInfo(swigCPtr, this, arg0.swigValue()), true); + } + public String __str__() { return lldbJNI.SBDebugger___str__(swigCPtr, this); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBDeclaration.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBDeclaration.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java index 8b73e92e40..03996a7943 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBDeclaration.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBDeclaration { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBEnvironment.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBEnvironment.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java index 0865a2465f..9975b9936f 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBEnvironment.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBEnvironment { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBError.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBError.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java index 5a84fd786c..e665d53f14 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBError.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBError { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBEvent.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBEvent.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java index a27929d27e..2594f011fc 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBEvent.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBEvent { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBExecutionContext.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBExecutionContext.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java index c1ba37109a..675db9b6ae 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBExecutionContext.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBExecutionContext { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBExpressionOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBExpressionOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java index f4004fd3a7..1f93def6ce 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBExpressionOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBExpressionOptions { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFile.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFile.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java index f15eae3cd0..7a53cb98a4 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFile.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBFile { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFileSpec.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFileSpec.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java index ad4165caf2..5b453c8d29 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFileSpec.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBFileSpec { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFileSpecList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFileSpecList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java index add40ea8e5..fcee949040 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFileSpecList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBFileSpecList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFrame.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFrame.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java index afee3cd491..6104820cde 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFrame.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBFrame { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFunction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFunction.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java index 8ece1d6daf..71b1848a40 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBFunction.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBFunction { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBHostOS.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBHostOS.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java index e55c629468..9eef5cc17d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBHostOS.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBHostOS { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBInstruction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBInstruction.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java index fe2bd80157..d8d2a51ad5 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBInstruction.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBInstruction { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBInstructionList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBInstructionList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java index bb09539626..a22d3a8ff9 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBInstructionList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBInstructionList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLanguageRuntime.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLanguageRuntime.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java index e8e6383c4d..1ffd1d3e44 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLanguageRuntime.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBLanguageRuntime { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLaunchInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLaunchInfo.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java index 138fe76688..64ae59a933 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLaunchInfo.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java @@ -1,17 +1,16 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; + public class SBLaunchInfo { private transient long swigCPtr; protected transient boolean swigCMemOwn; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLineEntry.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLineEntry.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java index f77d429c76..150d71e4d5 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBLineEntry.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBLineEntry { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBListener.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBListener.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java index 4705e7f01a..19332da6aa 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBListener.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBListener { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java similarity index 75% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java index 04f7734dfa..45ee045d62 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBMemoryRegionInfo { private transient long swigCPtr; @@ -49,6 +47,10 @@ public class SBMemoryRegionInfo { this(lldbJNI.new_SBMemoryRegionInfo__SWIG_1(SBMemoryRegionInfo.getCPtr(rhs), rhs), true); } + public SBMemoryRegionInfo(String name, java.math.BigInteger begin, java.math.BigInteger end, long permissions, boolean mapped, boolean stack_memory) { + this(lldbJNI.new_SBMemoryRegionInfo__SWIG_2(name, begin, end, permissions, mapped, stack_memory), true); + } + public void Clear() { lldbJNI.SBMemoryRegionInfo_Clear(swigCPtr, this); } @@ -81,6 +83,22 @@ public class SBMemoryRegionInfo { return lldbJNI.SBMemoryRegionInfo_GetName(swigCPtr, this); } + public boolean HasDirtyMemoryPageList() { + return lldbJNI.SBMemoryRegionInfo_HasDirtyMemoryPageList(swigCPtr, this); + } + + public long GetNumDirtyPages() { + return lldbJNI.SBMemoryRegionInfo_GetNumDirtyPages(swigCPtr, this); + } + + public java.math.BigInteger GetDirtyPageAddressAtIndex(long idx) { + return lldbJNI.SBMemoryRegionInfo_GetDirtyPageAddressAtIndex(swigCPtr, this, idx); + } + + public int GetPageSize() { + return lldbJNI.SBMemoryRegionInfo_GetPageSize(swigCPtr, this); + } + public boolean GetDescription(SBStream description) { return lldbJNI.SBMemoryRegionInfo_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java similarity index 88% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java index 2df809d115..9424009117 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBMemoryRegionInfoList { private transient long swigCPtr; @@ -53,6 +51,10 @@ public class SBMemoryRegionInfoList { return lldbJNI.SBMemoryRegionInfoList_GetSize(swigCPtr, this); } + public boolean GetMemoryRegionContainingAddress(java.math.BigInteger addr, SBMemoryRegionInfo region_info) { + return lldbJNI.SBMemoryRegionInfoList_GetMemoryRegionContainingAddress(swigCPtr, this, addr, SBMemoryRegionInfo.getCPtr(region_info), region_info); + } + public boolean GetMemoryRegionAtIndex(long idx, SBMemoryRegionInfo region_info) { return lldbJNI.SBMemoryRegionInfoList_GetMemoryRegionAtIndex(swigCPtr, this, idx, SBMemoryRegionInfo.getCPtr(region_info), region_info); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModule.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModule.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java index 790dc7b65e..900ee2030a 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModule.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBModule { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModuleSpec.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModuleSpec.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java index 5f846074a5..07673db5fd 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModuleSpec.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBModuleSpec { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModuleSpecList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModuleSpecList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java index 9c38436e01..328994f782 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBModuleSpecList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBModuleSpecList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatform.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatform.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java index def67e395e..948a69a2fc 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatform.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBPlatform { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java index e84b5809be..0461c4f4d0 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBPlatformConnectOptions { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatformShellCommand.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatformShellCommand.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java index 8b5aadba0c..1b9a07aa8c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBPlatformShellCommand.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBPlatformShellCommand { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBProcess.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java similarity index 92% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBProcess.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java index 9799c4c8b6..b30586099d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBProcess.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java @@ -1,17 +1,16 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; + public class SBProcess { private transient long swigCPtr; protected transient boolean swigCMemOwn; @@ -328,10 +327,6 @@ public class SBProcess { return new SBError(lldbJNI.SBProcess_SaveCore(swigCPtr, this, file_name), true); } - public SBTrace StartTrace(SBTraceOptions options, SBError error) { - return new SBTrace(lldbJNI.SBProcess_StartTrace(swigCPtr, this, SBTraceOptions.getCPtr(options), options, SBError.getCPtr(error), error), true); - } - public SBError GetMemoryRegionInfo(java.math.BigInteger load_addr, SBMemoryRegionInfo region_info) { return new SBError(lldbJNI.SBProcess_GetMemoryRegionInfo(swigCPtr, this, load_addr, SBMemoryRegionInfo.getCPtr(region_info), region_info), true); } @@ -344,15 +339,23 @@ public class SBProcess { return new SBProcessInfo(lldbJNI.SBProcess_GetProcessInfo(swigCPtr, this), true); } + public java.math.BigInteger AllocateMemory(long size, long permissions, SBError error) { + return lldbJNI.SBProcess_AllocateMemory(swigCPtr, this, size, permissions, SBError.getCPtr(error), error); + } + + public SBError DeallocateMemory(java.math.BigInteger ptr) { + return new SBError(lldbJNI.SBProcess_DeallocateMemory(swigCPtr, this, ptr), true); + } + public String __str__() { return lldbJNI.SBProcess___str__(swigCPtr, this); } - public final static int eBroadcastBitStateChanged = 1 << 0; - public final static int eBroadcastBitInterrupt = 1 << 1; - public final static int eBroadcastBitSTDOUT = 1 << 2; - public final static int eBroadcastBitSTDERR = 1 << 3; - public final static int eBroadcastBitProfileData = 1 << 4; - public final static int eBroadcastBitStructuredData = 1 << 5; + public final static int eBroadcastBitStateChanged = lldbJNI.SBProcess_eBroadcastBitStateChanged_get(); + public final static int eBroadcastBitInterrupt = lldbJNI.SBProcess_eBroadcastBitInterrupt_get(); + public final static int eBroadcastBitSTDOUT = lldbJNI.SBProcess_eBroadcastBitSTDOUT_get(); + public final static int eBroadcastBitSTDERR = lldbJNI.SBProcess_eBroadcastBitSTDERR_get(); + public final static int eBroadcastBitProfileData = lldbJNI.SBProcess_eBroadcastBitProfileData_get(); + public final static int eBroadcastBitStructuredData = lldbJNI.SBProcess_eBroadcastBitStructuredData_get(); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBProcessInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java similarity index 96% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBProcessInfo.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java index 4dd9feeb76..272aeb0531 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBProcessInfo.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBProcessInfo { private transient long swigCPtr; @@ -101,4 +99,8 @@ public class SBProcessInfo { return lldbJNI.SBProcessInfo_GetParentProcessID(swigCPtr, this); } + public String GetTriple() { + return lldbJNI.SBProcessInfo_GetTriple(swigCPtr, this); + } + } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBQueue.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBQueue.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java index e236921a2c..8aec336cae 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBQueue.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBQueue { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBQueueItem.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBQueueItem.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java index b44bd7839c..4cb4486c5d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBQueueItem.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBQueueItem { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBReproducer.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBReproducer.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java index da8acc4fd8..982172de26 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBReproducer.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBReproducer { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSection.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSection.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java index 8819a75bed..7a1a9f8cf2 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSection.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBSection { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSourceManager.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSourceManager.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java index dce73dfe75..dce3e0646c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSourceManager.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBSourceManager { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStream.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStream.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java index 7c07611e5d..a01e9b154c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStream.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBStream { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStringList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStringList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java index 48d19647b7..c09094cc10 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStringList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java @@ -1,17 +1,16 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; + public class SBStringList { private transient long swigCPtr; protected transient boolean swigCMemOwn; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStructuredData.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java similarity index 92% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStructuredData.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java index 98862d535b..e971b8e7ed 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBStructuredData.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBStructuredData { private transient long swigCPtr; @@ -118,7 +116,11 @@ public class SBStructuredData { } public SBError SetFromJSON(SBStream stream) { - return new SBError(lldbJNI.SBStructuredData_SetFromJSON(swigCPtr, this, SBStream.getCPtr(stream), stream), true); + return new SBError(lldbJNI.SBStructuredData_SetFromJSON__SWIG_0(swigCPtr, this, SBStream.getCPtr(stream), stream), true); + } + + public SBError SetFromJSON(String json) { + return new SBError(lldbJNI.SBStructuredData_SetFromJSON__SWIG_1(swigCPtr, this, json), true); } } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbol.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbol.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java index 9795828c0c..12ced20784 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbol.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBSymbol { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbolContext.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbolContext.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java index 1be8276129..df9ca77a43 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbolContext.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBSymbolContext { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbolContextList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbolContextList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java index 0fd5962a4b..ee56559f77 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBSymbolContextList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBSymbolContextList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTarget.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTarget.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java index aebcb8ae1a..e653a9e08f 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTarget.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java @@ -3,7 +3,7 @@ */ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -547,10 +547,18 @@ public class SBTarget { return lldbJNI.SBTarget___str__(swigCPtr, this); } - public final static int eBroadcastBitBreakpointChanged = 1 << 0; - public final static int eBroadcastBitModulesLoaded = 1 << 1; - public final static int eBroadcastBitModulesUnloaded = 1 << 2; - public final static int eBroadcastBitWatchpointChanged = 1 << 3; - public final static int eBroadcastBitSymbolsLoaded = 1 << 4; + public SBTrace GetTrace() { + return new SBTrace(lldbJNI.SBTarget_GetTrace(swigCPtr, this), true); + } + + public SBTrace CreateTrace(SBError error) { + return new SBTrace(lldbJNI.SBTarget_CreateTrace(swigCPtr, this, SBError.getCPtr(error), error), true); + } + + public final static int eBroadcastBitBreakpointChanged = lldbJNI.SBTarget_eBroadcastBitBreakpointChanged_get(); + public final static int eBroadcastBitModulesLoaded = lldbJNI.SBTarget_eBroadcastBitModulesLoaded_get(); + public final static int eBroadcastBitModulesUnloaded = lldbJNI.SBTarget_eBroadcastBitModulesUnloaded_get(); + public final static int eBroadcastBitWatchpointChanged = lldbJNI.SBTarget_eBroadcastBitWatchpointChanged_get(); + public final static int eBroadcastBitSymbolsLoaded = lldbJNI.SBTarget_eBroadcastBitSymbolsLoaded_get(); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThread.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java similarity index 94% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThread.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java index f5bd90a1db..7c09fab9eb 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThread.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBThread { private transient long swigCPtr; @@ -305,10 +303,10 @@ public class SBThread { return lldbJNI.SBThread___str__(swigCPtr, this); } - public final static int eBroadcastBitStackChanged = 1 << 0; - public final static int eBroadcastBitThreadSuspended = 1 << 1; - public final static int eBroadcastBitThreadResumed = 1 << 2; - public final static int eBroadcastBitSelectedFrameChanged = 1 << 3; - public final static int eBroadcastBitThreadSelected = 1 << 4; + public final static int eBroadcastBitStackChanged = lldbJNI.SBThread_eBroadcastBitStackChanged_get(); + public final static int eBroadcastBitThreadSuspended = lldbJNI.SBThread_eBroadcastBitThreadSuspended_get(); + public final static int eBroadcastBitThreadResumed = lldbJNI.SBThread_eBroadcastBitThreadResumed_get(); + public final static int eBroadcastBitSelectedFrameChanged = lldbJNI.SBThread_eBroadcastBitSelectedFrameChanged_get(); + public final static int eBroadcastBitThreadSelected = lldbJNI.SBThread_eBroadcastBitThreadSelected_get(); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThreadCollection.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThreadCollection.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java index f9da936886..b63bc13b6d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThreadCollection.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBThreadCollection { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThreadPlan.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThreadPlan.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java index 732fd25062..07487bdfd9 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBThreadPlan.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBThreadPlan { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTrace.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java similarity index 54% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTrace.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java index 2f33c320d9..872f9c331d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTrace.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTrace { private transient long swigCPtr; @@ -45,24 +43,24 @@ public class SBTrace { this(lldbJNI.new_SBTrace(), true); } - public long GetTraceData(SBError error, SWIGTYPE_p_void buf, long size, long offset, java.math.BigInteger thread_id) { - return lldbJNI.SBTrace_GetTraceData(swigCPtr, this, SBError.getCPtr(error), error, SWIGTYPE_p_void.getCPtr(buf), size, offset, thread_id); + public String GetStartConfigurationHelp() { + return lldbJNI.SBTrace_GetStartConfigurationHelp(swigCPtr, this); } - public long GetMetaData(SBError error, SWIGTYPE_p_void buf, long size, long offset, java.math.BigInteger thread_id) { - return lldbJNI.SBTrace_GetMetaData(swigCPtr, this, SBError.getCPtr(error), error, SWIGTYPE_p_void.getCPtr(buf), size, offset, thread_id); + public SBError Start(SBStructuredData configuration) { + return new SBError(lldbJNI.SBTrace_Start__SWIG_0(swigCPtr, this, SBStructuredData.getCPtr(configuration), configuration), true); } - public void StopTrace(SBError error, java.math.BigInteger thread_id) { - lldbJNI.SBTrace_StopTrace(swigCPtr, this, SBError.getCPtr(error), error, thread_id); + public SBError Start(SBThread thread, SBStructuredData configuration) { + return new SBError(lldbJNI.SBTrace_Start__SWIG_1(swigCPtr, this, SBThread.getCPtr(thread), thread, SBStructuredData.getCPtr(configuration), configuration), true); } - public void GetTraceConfig(SBTraceOptions options, SBError error) { - lldbJNI.SBTrace_GetTraceConfig(swigCPtr, this, SBTraceOptions.getCPtr(options), options, SBError.getCPtr(error), error); + public SBError Stop() { + return new SBError(lldbJNI.SBTrace_Stop__SWIG_0(swigCPtr, this), true); } - public java.math.BigInteger GetTraceUID() { - return lldbJNI.SBTrace_GetTraceUID(swigCPtr, this); + public SBError Stop(SBThread thread) { + return new SBError(lldbJNI.SBTrace_Stop__SWIG_1(swigCPtr, this, SBThread.getCPtr(thread), thread), true); } public boolean IsValid() { diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java similarity index 95% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java index c624134ecf..5e75a6bba0 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBType { private transient long swigCPtr; @@ -89,6 +87,10 @@ public class SBType { return lldbJNI.SBType_IsAnonymousType(swigCPtr, this); } + public boolean IsScopedEnumerationType() { + return lldbJNI.SBType_IsScopedEnumerationType(swigCPtr, this); + } + public SBType GetPointerType() { return new SBType(lldbJNI.SBType_GetPointerType(swigCPtr, this), true); } @@ -117,6 +119,10 @@ public class SBType { return new SBType(lldbJNI.SBType_GetCanonicalType(swigCPtr, this), true); } + public SBType GetEnumerationIntegerType() { + return new SBType(lldbJNI.SBType_GetEnumerationIntegerType(swigCPtr, this), true); + } + public SBType GetArrayElementType() { return new SBType(lldbJNI.SBType_GetArrayElementType(swigCPtr, this), true); } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeCategory.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeCategory.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java index f9181d36b7..e9a4c9a85c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeCategory.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeCategory { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeEnumMember.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeEnumMember.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java index 0378606d14..b7ee66656b 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeEnumMember.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeEnumMember { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java index b1f0792b17..b91c9b7b74 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeEnumMemberList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeFilter.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeFilter.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java index 1425be5168..b4d177b3eb 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeFilter.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeFilter { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeFormat.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeFormat.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java index 7ff44c2896..34048dd4fa 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeFormat.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeFormat { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java index dbcd001782..ff30e6009b 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeMember.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeMember.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java index 28353ce214..2a4db6170e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeMember.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeMember { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeMemberFunction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeMemberFunction.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java index f41910b2ac..8a085ed72d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeMemberFunction.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeMemberFunction { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java index 0795757b74..1b1b3cabec 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeNameSpecifier { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSummary.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSummary.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java index c686668b5e..269e0d96e3 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSummary.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeSummary { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java index 318941db8b..fe580b8a67 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeSummaryOptions { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSynthetic.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSynthetic.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java index f51d46f56e..057a0eaa1e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBTypeSynthetic.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBTypeSynthetic { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBUnixSignals.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBUnixSignals.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java index 54b45bace0..3b6b8faf9d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBUnixSignals.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBUnixSignals { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBValue.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBValue.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java index fc23940d34..e4c27fdc11 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBValue.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBValue { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBValueList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBValueList.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java index abe86f9799..b31a258333 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBValueList.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBValueList { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBVariablesOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBVariablesOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java index 5af860631a..1c6541d75c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBVariablesOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBVariablesOptions { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBWatchpoint.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBWatchpoint.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java index 0c7c8408a1..422a47ca79 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SBWatchpoint.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SBWatchpoint { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java index 304d82e735..5255db8ac6 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_double { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java index c779bee3e4..f681e40299 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_f_p_q_const__char_p_void__void { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java index 6825247071..3d7f00bf30 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_f_p_void__p_void { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java index b8aa65573a..0c88d2836e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java index fad3e3524a..85321dabde 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_int { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java index f5e4e897f5..5984a8a95d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java @@ -1,17 +1,16 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; + public class SWIGTYPE_p_jbyte { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java index 3b9b338a7c..4adfc86731 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_lldb__ConnectionStatus { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java index 756d2c8067..c0b0ac8613 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_long_double { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java index 6d4d0ef5fe..2c15dd5531 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_long_long { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java index d876e06301..670e455c3c 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_p_void { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java index f94664c250..8d3a4aa9b9 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_pthread_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java index 65fff4bf1b..869b58525a 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_size_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java index 9e5b47f37b..8fc3ade8e7 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java index 1791d3273a..10b81049e6 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java index 553af56885..02374cc713 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java index cddcb5d68b..8ee68465b9 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java index bef7701f50..ccd3af7e5a 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java index a7cd691975..788b6a5bf3 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_unsigned_char { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java index 019ca46ab9..eb5951e738 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_unsigned_int { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java index 923b31f2ef..b8f5dbc71b 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_unsigned_long_long { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java similarity index 97% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java index be59bb6aaf..f48bf02989 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public class SWIGTYPE_p_void { private transient long swigCPtr; diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java new file mode 100644 index 0000000000..ff02701804 --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java @@ -0,0 +1,59 @@ +/* ### + * IP: Apache License 2.0 with LLVM Exceptions + */ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package SWIG; + +public final class SaveCoreStyle { + public final static SaveCoreStyle eSaveCoreUnspecified = new SaveCoreStyle("eSaveCoreUnspecified", lldbJNI.eSaveCoreUnspecified_get()); + public final static SaveCoreStyle eSaveCoreFull = new SaveCoreStyle("eSaveCoreFull", lldbJNI.eSaveCoreFull_get()); + public final static SaveCoreStyle eSaveCoreDirtyOnly = new SaveCoreStyle("eSaveCoreDirtyOnly", lldbJNI.eSaveCoreDirtyOnly_get()); + public final static SaveCoreStyle eSaveCoreStackOnly = new SaveCoreStyle("eSaveCoreStackOnly", lldbJNI.eSaveCoreStackOnly_get()); + + public final int swigValue() { + return swigValue; + } + + public String toString() { + return swigName; + } + + public static SaveCoreStyle swigToEnum(int swigValue) { + if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) + return swigValues[swigValue]; + for (int i = 0; i < swigValues.length; i++) + if (swigValues[i].swigValue == swigValue) + return swigValues[i]; + throw new IllegalArgumentException("No enum " + SaveCoreStyle.class + " with value " + swigValue); + } + + private SaveCoreStyle(String swigName) { + this.swigName = swigName; + this.swigValue = swigNext++; + } + + private SaveCoreStyle(String swigName, int swigValue) { + this.swigName = swigName; + this.swigValue = swigValue; + swigNext = swigValue+1; + } + + private SaveCoreStyle(String swigName, SaveCoreStyle swigEnum) { + this.swigName = swigName; + this.swigValue = swigEnum.swigValue; + swigNext = this.swigValue+1; + } + + private static SaveCoreStyle[] swigValues = { eSaveCoreUnspecified, eSaveCoreFull, eSaveCoreDirtyOnly, eSaveCoreStackOnly }; + private static int swigNext = 0; + private final int swigValue; + private final String swigName; +} + diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ScriptLanguage.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ScriptLanguage.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java index 4a651975f9..0bc7d40ea9 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ScriptLanguage.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ScriptLanguage { public final static ScriptLanguage eScriptLanguageNone = new ScriptLanguage("eScriptLanguageNone", lldbJNI.eScriptLanguageNone_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SearchDepth.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SearchDepth.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java index a1dab62c2a..ecb638c135 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SearchDepth.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class SearchDepth { public final static SearchDepth eSearchDepthInvalid = new SearchDepth("eSearchDepthInvalid", lldbJNI.eSearchDepthInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SectionType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SectionType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java index 862bbab554..a4befbc9fd 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SectionType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class SectionType { public final static SectionType eSectionTypeInvalid = new SectionType("eSectionTypeInvalid"); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StateType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java similarity index 96% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StateType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java index 3cca12d000..81eb29f94e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StateType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java @@ -1,20 +1,18 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class StateType { - public final static StateType eStateInvalid = new StateType("eStateInvalid"); + public final static StateType eStateInvalid = new StateType("eStateInvalid", lldbJNI.eStateInvalid_get()); public final static StateType eStateUnloaded = new StateType("eStateUnloaded"); public final static StateType eStateConnected = new StateType("eStateConnected"); public final static StateType eStateAttaching = new StateType("eStateAttaching"); @@ -26,7 +24,7 @@ public final class StateType { public final static StateType eStateDetached = new StateType("eStateDetached"); public final static StateType eStateExited = new StateType("eStateExited"); public final static StateType eStateSuspended = new StateType("eStateSuspended"); - public final static StateType kLastStateType = new StateType("kLastStateType"); + public final static StateType kLastStateType = new StateType("kLastStateType", lldbJNI.kLastStateType_get()); public final int swigValue() { return swigValue; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StopReason.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java similarity index 85% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StopReason.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java index 745539d3b7..a0cbd54b46 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StopReason.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class StopReason { public final static StopReason eStopReasonInvalid = new StopReason("eStopReasonInvalid", lldbJNI.eStopReasonInvalid_get()); @@ -25,6 +23,10 @@ public final class StopReason { public final static StopReason eStopReasonPlanComplete = new StopReason("eStopReasonPlanComplete"); public final static StopReason eStopReasonThreadExiting = new StopReason("eStopReasonThreadExiting"); public final static StopReason eStopReasonInstrumentation = new StopReason("eStopReasonInstrumentation"); + public final static StopReason eStopReasonProcessorTrace = new StopReason("eStopReasonProcessorTrace"); + public final static StopReason eStopReasonFork = new StopReason("eStopReasonFork"); + public final static StopReason eStopReasonVFork = new StopReason("eStopReasonVFork"); + public final static StopReason eStopReasonVForkDone = new StopReason("eStopReasonVForkDone"); public final int swigValue() { return swigValue; @@ -60,7 +62,7 @@ public final class StopReason { swigNext = this.swigValue+1; } - private static StopReason[] swigValues = { eStopReasonInvalid, eStopReasonNone, eStopReasonTrace, eStopReasonBreakpoint, eStopReasonWatchpoint, eStopReasonSignal, eStopReasonException, eStopReasonExec, eStopReasonPlanComplete, eStopReasonThreadExiting, eStopReasonInstrumentation }; + private static StopReason[] swigValues = { eStopReasonInvalid, eStopReasonNone, eStopReasonTrace, eStopReasonBreakpoint, eStopReasonWatchpoint, eStopReasonSignal, eStopReasonException, eStopReasonExec, eStopReasonPlanComplete, eStopReasonThreadExiting, eStopReasonInstrumentation, eStopReasonProcessorTrace, eStopReasonFork, eStopReasonVFork, eStopReasonVForkDone }; private static int swigNext = 0; private final int swigValue; private final String swigName; diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StopShowColumn.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StopShowColumn.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java index c8b0982712..28d9414fc0 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StopShowColumn.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class StopShowColumn { public final static StopShowColumn eStopShowColumnAnsiOrCaret = new StopShowColumn("eStopShowColumnAnsiOrCaret", lldbJNI.eStopShowColumnAnsiOrCaret_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StructuredDataType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StructuredDataType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java index b34f3bc29c..e1219c9f41 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/StructuredDataType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class StructuredDataType { public final static StructuredDataType eStructuredDataTypeInvalid = new StructuredDataType("eStructuredDataTypeInvalid", lldbJNI.eStructuredDataTypeInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SymbolContextItem.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SymbolContextItem.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java index b44300035d..4232141e6f 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SymbolContextItem.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class SymbolContextItem { public final static SymbolContextItem eSymbolContextTarget = new SymbolContextItem("eSymbolContextTarget", lldbJNI.eSymbolContextTarget_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SymbolType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SymbolType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java index 3dde5e23b7..05c5351978 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/SymbolType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class SymbolType { public final static SymbolType eSymbolTypeAny = new SymbolType("eSymbolTypeAny", lldbJNI.eSymbolTypeAny_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TemplateArgumentKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java similarity index 93% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TemplateArgumentKind.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java index 41ee403245..e6f4c4d5b6 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TemplateArgumentKind.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class TemplateArgumentKind { public final static TemplateArgumentKind eTemplateArgumentKindNull = new TemplateArgumentKind("eTemplateArgumentKindNull", lldbJNI.eTemplateArgumentKindNull_get()); @@ -23,7 +21,6 @@ public final class TemplateArgumentKind { public final static TemplateArgumentKind eTemplateArgumentKindExpression = new TemplateArgumentKind("eTemplateArgumentKindExpression"); public final static TemplateArgumentKind eTemplateArgumentKindPack = new TemplateArgumentKind("eTemplateArgumentKindPack"); public final static TemplateArgumentKind eTemplateArgumentKindNullPtr = new TemplateArgumentKind("eTemplateArgumentKindNullPtr"); - public final static TemplateArgumentKind eTemplateArgumentKindUncommonValue = new TemplateArgumentKind("eTemplateArgumentKindUncommonValue"); public final int swigValue() { return swigValue; @@ -59,7 +56,7 @@ public final class TemplateArgumentKind { swigNext = this.swigValue+1; } - private static TemplateArgumentKind[] swigValues = { eTemplateArgumentKindNull, eTemplateArgumentKindType, eTemplateArgumentKindDeclaration, eTemplateArgumentKindIntegral, eTemplateArgumentKindTemplate, eTemplateArgumentKindTemplateExpansion, eTemplateArgumentKindExpression, eTemplateArgumentKindPack, eTemplateArgumentKindNullPtr, eTemplateArgumentKindUncommonValue }; + private static TemplateArgumentKind[] swigValues = { eTemplateArgumentKindNull, eTemplateArgumentKindType, eTemplateArgumentKindDeclaration, eTemplateArgumentKindIntegral, eTemplateArgumentKindTemplate, eTemplateArgumentKindTemplateExpansion, eTemplateArgumentKindExpression, eTemplateArgumentKindPack, eTemplateArgumentKindNullPtr }; private static int swigNext = 0; private final int swigValue; private final String swigName; diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceInstructionControlFlowType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceInstructionControlFlowType.java new file mode 100644 index 0000000000..79b14277e4 --- /dev/null +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceInstructionControlFlowType.java @@ -0,0 +1,60 @@ +/* ### + * IP: Apache License 2.0 with LLVM Exceptions + */ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package SWIG; + +public final class TraceInstructionControlFlowType { + public final static TraceInstructionControlFlowType eTraceInstructionControlFlowTypeInstruction = new TraceInstructionControlFlowType("eTraceInstructionControlFlowTypeInstruction", lldbJNI.eTraceInstructionControlFlowTypeInstruction_get()); + public final static TraceInstructionControlFlowType eTraceInstructionControlFlowTypeBranch = new TraceInstructionControlFlowType("eTraceInstructionControlFlowTypeBranch", lldbJNI.eTraceInstructionControlFlowTypeBranch_get()); + public final static TraceInstructionControlFlowType eTraceInstructionControlFlowTypeTakenBranch = new TraceInstructionControlFlowType("eTraceInstructionControlFlowTypeTakenBranch", lldbJNI.eTraceInstructionControlFlowTypeTakenBranch_get()); + public final static TraceInstructionControlFlowType eTraceInstructionControlFlowTypeCall = new TraceInstructionControlFlowType("eTraceInstructionControlFlowTypeCall", lldbJNI.eTraceInstructionControlFlowTypeCall_get()); + public final static TraceInstructionControlFlowType eTraceInstructionControlFlowTypeReturn = new TraceInstructionControlFlowType("eTraceInstructionControlFlowTypeReturn", lldbJNI.eTraceInstructionControlFlowTypeReturn_get()); + + public final int swigValue() { + return swigValue; + } + + public String toString() { + return swigName; + } + + public static TraceInstructionControlFlowType swigToEnum(int swigValue) { + if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) + return swigValues[swigValue]; + for (int i = 0; i < swigValues.length; i++) + if (swigValues[i].swigValue == swigValue) + return swigValues[i]; + throw new IllegalArgumentException("No enum " + TraceInstructionControlFlowType.class + " with value " + swigValue); + } + + private TraceInstructionControlFlowType(String swigName) { + this.swigName = swigName; + this.swigValue = swigNext++; + } + + private TraceInstructionControlFlowType(String swigName, int swigValue) { + this.swigName = swigName; + this.swigValue = swigValue; + swigNext = swigValue+1; + } + + private TraceInstructionControlFlowType(String swigName, TraceInstructionControlFlowType swigEnum) { + this.swigName = swigName; + this.swigValue = swigEnum.swigValue; + swigNext = this.swigValue+1; + } + + private static TraceInstructionControlFlowType[] swigValues = { eTraceInstructionControlFlowTypeInstruction, eTraceInstructionControlFlowTypeBranch, eTraceInstructionControlFlowTypeTakenBranch, eTraceInstructionControlFlowTypeCall, eTraceInstructionControlFlowTypeReturn }; + private static int swigNext = 0; + private final int swigValue; + private final String swigName; +} + diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TraceType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TraceType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java index 38ffa39d9e..e2a07d65a8 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TraceType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class TraceType { public final static TraceType eTraceTypeNone = new TraceType("eTraceTypeNone", lldbJNI.eTraceTypeNone_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeClass.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeClass.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java index 44cf2b983b..3a9dee963e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeClass.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class TypeClass { public final static TypeClass eTypeClassInvalid = new TypeClass("eTypeClassInvalid", lldbJNI.eTypeClassInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeFlags.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeFlags.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java index b4b46bbefe..2df2fb4498 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeFlags.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class TypeFlags { public final static TypeFlags eTypeHasChildren = new TypeFlags("eTypeHasChildren", lldbJNI.eTypeHasChildren_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeOptions.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java index c5004ba2ab..c411633099 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeOptions.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class TypeOptions { public final static TypeOptions eTypeOptionNone = new TypeOptions("eTypeOptionNone", lldbJNI.eTypeOptionNone_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeSummaryCapping.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeSummaryCapping.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java index cf342095a4..5e58a2fcf7 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/TypeSummaryCapping.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class TypeSummaryCapping { public final static TypeSummaryCapping eTypeSummaryCapped = new TypeSummaryCapping("eTypeSummaryCapped", lldbJNI.eTypeSummaryCapped_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ValueType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ValueType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java index 25d6f7d809..722b1c1aeb 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/ValueType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class ValueType { public final static ValueType eValueTypeInvalid = new ValueType("eValueTypeInvalid", lldbJNI.eValueTypeInvalid_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/WatchpointEventType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/WatchpointEventType.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java index 92aa819640..644c7f718f 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/WatchpointEventType.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class WatchpointEventType { public final static WatchpointEventType eWatchpointEventTypeInvalidType = new WatchpointEventType("eWatchpointEventTypeInvalidType", lldbJNI.eWatchpointEventTypeInvalidType_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/WatchpointKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java similarity index 99% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/WatchpointKind.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java index 3f423a052b..4ed586178e 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/WatchpointKind.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public final class WatchpointKind { public final static WatchpointKind eWatchpointKindWrite = new WatchpointKind("eWatchpointKindWrite", lldbJNI.eWatchpointKindWrite_get()); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldb.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java similarity index 96% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldb.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java index 9d3d3598b7..3c455a0759 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldb.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java @@ -3,7 +3,7 @@ */ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldbConstants.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldbConstants.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java index 8b66dd27cd..75eddcee40 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldbConstants.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java @@ -1,17 +1,15 @@ /* ### * IP: Apache License 2.0 with LLVM Exceptions */ -package SWIG; - - /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ +package SWIG; public interface lldbConstants { public final static int INT32_MAX = lldbJNI.INT32_MAX_get(); @@ -36,6 +34,7 @@ public interface lldbConstants { public final static int LLDB_REGNUM_GENERIC_ARG6 = lldbJNI.LLDB_REGNUM_GENERIC_ARG6_get(); public final static int LLDB_REGNUM_GENERIC_ARG7 = lldbJNI.LLDB_REGNUM_GENERIC_ARG7_get(); public final static int LLDB_REGNUM_GENERIC_ARG8 = lldbJNI.LLDB_REGNUM_GENERIC_ARG8_get(); + public final static int LLDB_INVALID_STOP_ID = lldbJNI.LLDB_INVALID_STOP_ID_get(); public final static java.math.BigInteger LLDB_INVALID_ADDRESS = lldbJNI.LLDB_INVALID_ADDRESS_get(); public final static long LLDB_INVALID_INDEX32 = lldbJNI.LLDB_INVALID_INDEX32_get(); public final static long LLDB_INVALID_IVAR_OFFSET = lldbJNI.LLDB_INVALID_IVAR_OFFSET_get(); diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldbJNI.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java similarity index 98% rename from Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldbJNI.java rename to Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java index 5aa2751b5a..5095c63bce 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG/lldbJNI.java +++ b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java @@ -3,7 +3,7 @@ */ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -40,6 +40,7 @@ public class lldbJNI { public final static native int LLDB_REGNUM_GENERIC_ARG6_get(); public final static native int LLDB_REGNUM_GENERIC_ARG7_get(); public final static native int LLDB_REGNUM_GENERIC_ARG8_get(); + public final static native int LLDB_INVALID_STOP_ID_get(); public final static native java.math.BigInteger LLDB_INVALID_ADDRESS_get(); public final static native long LLDB_INVALID_INDEX32_get(); public final static native long LLDB_INVALID_IVAR_OFFSET_get(); @@ -280,6 +281,11 @@ public class lldbJNI { public final static native int eQueueItemKindUnknown_get(); public final static native int eQueueKindUnknown_get(); public final static native int eExpressionEvaluationParse_get(); + public final static native int eTraceInstructionControlFlowTypeInstruction_get(); + public final static native int eTraceInstructionControlFlowTypeBranch_get(); + public final static native int eTraceInstructionControlFlowTypeTakenBranch_get(); + public final static native int eTraceInstructionControlFlowTypeCall_get(); + public final static native int eTraceInstructionControlFlowTypeReturn_get(); public final static native int eWatchpointKindWrite_get(); public final static native int eWatchpointKindRead_get(); public final static native int eGdbSignalBadAccess_get(); @@ -323,6 +329,10 @@ public class lldbJNI { public final static native int eCommandProcessMustBeTraced_get(); public final static native int eTypeSummaryCapped_get(); public final static native int eTypeSummaryUncapped_get(); + public final static native int eSaveCoreUnspecified_get(); + public final static native int eSaveCoreFull_get(); + public final static native int eSaveCoreDirtyOnly_get(); + public final static native int eSaveCoreStackOnly_get(); public final static native long new_SBAddress__SWIG_0(); public final static native long new_SBAddress__SWIG_1(long jarg1, SBAddress jarg1_); public final static native long new_SBAddress__SWIG_2(long jarg1, SBSection jarg1_, java.math.BigInteger jarg2); @@ -822,6 +832,7 @@ public class lldbJNI { public final static native long SBDebugger_GetSummaryForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); public final static native long SBDebugger_GetFilterForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); public final static native long SBDebugger_GetSyntheticForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); + public final static native long SBDebugger_GetScriptInterpreterInfo(long jarg1, SBDebugger jarg1_, int jarg2); public final static native String SBDebugger___str__(long jarg1, SBDebugger jarg1_); public final static native void SBDebugger_RunCommandInterpreter(long jarg1, SBDebugger jarg1_, boolean jarg2, boolean jarg3, long jarg4, SBCommandInterpreterRunOptions jarg4_, int[] jarg5, boolean[] jarg6, boolean[] jarg7); public final static native long SBDebugger_RunREPL(long jarg1, SBDebugger jarg1_, int jarg2, String jarg3); @@ -1179,6 +1190,7 @@ public class lldbJNI { public final static native boolean SBListener_HandleBroadcastEvent(long jarg1, SBListener jarg1_, long jarg2, SBEvent jarg2_); public final static native long new_SBMemoryRegionInfo__SWIG_0(); public final static native long new_SBMemoryRegionInfo__SWIG_1(long jarg1, SBMemoryRegionInfo jarg1_); + public final static native long new_SBMemoryRegionInfo__SWIG_2(String jarg1, java.math.BigInteger jarg2, java.math.BigInteger jarg3, long jarg4, boolean jarg5, boolean jarg6); public final static native void delete_SBMemoryRegionInfo(long jarg1); public final static native void SBMemoryRegionInfo_Clear(long jarg1, SBMemoryRegionInfo jarg1_); public final static native java.math.BigInteger SBMemoryRegionInfo_GetRegionBase(long jarg1, SBMemoryRegionInfo jarg1_); @@ -1188,12 +1200,17 @@ public class lldbJNI { public final static native boolean SBMemoryRegionInfo_IsExecutable(long jarg1, SBMemoryRegionInfo jarg1_); public final static native boolean SBMemoryRegionInfo_IsMapped(long jarg1, SBMemoryRegionInfo jarg1_); public final static native String SBMemoryRegionInfo_GetName(long jarg1, SBMemoryRegionInfo jarg1_); + public final static native boolean SBMemoryRegionInfo_HasDirtyMemoryPageList(long jarg1, SBMemoryRegionInfo jarg1_); + public final static native long SBMemoryRegionInfo_GetNumDirtyPages(long jarg1, SBMemoryRegionInfo jarg1_); + public final static native java.math.BigInteger SBMemoryRegionInfo_GetDirtyPageAddressAtIndex(long jarg1, SBMemoryRegionInfo jarg1_, long jarg2); + public final static native int SBMemoryRegionInfo_GetPageSize(long jarg1, SBMemoryRegionInfo jarg1_); public final static native boolean SBMemoryRegionInfo_GetDescription(long jarg1, SBMemoryRegionInfo jarg1_, long jarg2, SBStream jarg2_); public final static native String SBMemoryRegionInfo___str__(long jarg1, SBMemoryRegionInfo jarg1_); public final static native long new_SBMemoryRegionInfoList__SWIG_0(); public final static native long new_SBMemoryRegionInfoList__SWIG_1(long jarg1, SBMemoryRegionInfoList jarg1_); public final static native void delete_SBMemoryRegionInfoList(long jarg1); public final static native long SBMemoryRegionInfoList_GetSize(long jarg1, SBMemoryRegionInfoList jarg1_); + public final static native boolean SBMemoryRegionInfoList_GetMemoryRegionContainingAddress(long jarg1, SBMemoryRegionInfoList jarg1_, java.math.BigInteger jarg2, long jarg3, SBMemoryRegionInfo jarg3_); public final static native boolean SBMemoryRegionInfoList_GetMemoryRegionAtIndex(long jarg1, SBMemoryRegionInfoList jarg1_, long jarg2, long jarg3, SBMemoryRegionInfo jarg3_); public final static native void SBMemoryRegionInfoList_Append__SWIG_0(long jarg1, SBMemoryRegionInfoList jarg1_, long jarg2, SBMemoryRegionInfo jarg2_); public final static native void SBMemoryRegionInfoList_Append__SWIG_1(long jarg1, SBMemoryRegionInfoList jarg1_, long jarg2, SBMemoryRegionInfoList jarg2_); @@ -1414,10 +1431,11 @@ public class lldbJNI { public final static native long SBProcess_GetHistoryThreads(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); public final static native boolean SBProcess_IsInstrumentationRuntimePresent(long jarg1, SBProcess jarg1_, int jarg2); public final static native long SBProcess_SaveCore(long jarg1, SBProcess jarg1_, String jarg2); - public final static native long SBProcess_StartTrace(long jarg1, SBProcess jarg1_, long jarg2, SBTraceOptions jarg2_, long jarg3, SBError jarg3_); public final static native long SBProcess_GetMemoryRegionInfo(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, SBMemoryRegionInfo jarg3_); public final static native long SBProcess_GetMemoryRegions(long jarg1, SBProcess jarg1_); public final static native long SBProcess_GetProcessInfo(long jarg1, SBProcess jarg1_); + public final static native java.math.BigInteger SBProcess_AllocateMemory(long jarg1, SBProcess jarg1_, long jarg2, long jarg3, long jarg4, SBError jarg4_); + public final static native long SBProcess_DeallocateMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); public final static native String SBProcess___str__(long jarg1, SBProcess jarg1_); public final static native long new_SBProcessInfo__SWIG_0(); public final static native long new_SBProcessInfo__SWIG_1(long jarg1, SBProcessInfo jarg1_); @@ -1435,6 +1453,7 @@ public class lldbJNI { public final static native boolean SBProcessInfo_EffectiveUserIDIsValid(long jarg1, SBProcessInfo jarg1_); public final static native boolean SBProcessInfo_EffectiveGroupIDIsValid(long jarg1, SBProcessInfo jarg1_); public final static native java.math.BigInteger SBProcessInfo_GetParentProcessID(long jarg1, SBProcessInfo jarg1_); + public final static native String SBProcessInfo_GetTriple(long jarg1, SBProcessInfo jarg1_); public final static native long new_SBQueue__SWIG_0(); public final static native long new_SBQueue__SWIG_1(long jarg1); public final static native void delete_SBQueue(long jarg1); @@ -1534,7 +1553,8 @@ public class lldbJNI { public final static native long SBStructuredData_GetStringValue(long jarg1, SBStructuredData jarg1_, String jarg2, long jarg3); public final static native long SBStructuredData_GetAsJSON(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); public final static native long SBStructuredData_GetDescription(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBStructuredData_SetFromJSON(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); + public final static native long SBStructuredData_SetFromJSON__SWIG_0(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); + public final static native long SBStructuredData_SetFromJSON__SWIG_1(long jarg1, SBStructuredData jarg1_, String jarg2); public final static native long new_SBSymbol__SWIG_0(); public final static native void delete_SBSymbol(long jarg1); public final static native long new_SBSymbol__SWIG_1(long jarg1, SBSymbol jarg1_); @@ -1715,6 +1735,8 @@ public class lldbJNI { public final static native long SBTarget_EvaluateExpression__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2); public final static native long SBTarget_EvaluateExpression__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBExpressionOptions jarg3_); public final static native String SBTarget___str__(long jarg1, SBTarget jarg1_); + public final static native long SBTarget_GetTrace(long jarg1, SBTarget jarg1_); + public final static native long SBTarget_CreateTrace(long jarg1, SBTarget jarg1_, long jarg2, SBError jarg2_); public final static native int SBThread_eBroadcastBitStackChanged_get(); public final static native int SBThread_eBroadcastBitThreadSuspended_get(); public final static native int SBThread_eBroadcastBitThreadResumed_get(); @@ -1819,26 +1841,13 @@ public class lldbJNI { public final static native long SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_1(long jarg1, SBThreadPlan jarg1_, String jarg2, long jarg3, SBError jarg3_); public final static native long SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_2(long jarg1, SBThreadPlan jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_, long jarg4, SBError jarg4_); public final static native long new_SBTrace(); - public final static native long SBTrace_GetTraceData(long jarg1, SBTrace jarg1_, long jarg2, SBError jarg2_, long jarg3, long jarg4, long jarg5, java.math.BigInteger jarg6); - public final static native long SBTrace_GetMetaData(long jarg1, SBTrace jarg1_, long jarg2, SBError jarg2_, long jarg3, long jarg4, long jarg5, java.math.BigInteger jarg6); - public final static native void SBTrace_StopTrace(long jarg1, SBTrace jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native void SBTrace_GetTraceConfig(long jarg1, SBTrace jarg1_, long jarg2, SBTraceOptions jarg2_, long jarg3, SBError jarg3_); - public final static native java.math.BigInteger SBTrace_GetTraceUID(long jarg1, SBTrace jarg1_); + public final static native String SBTrace_GetStartConfigurationHelp(long jarg1, SBTrace jarg1_); + public final static native long SBTrace_Start__SWIG_0(long jarg1, SBTrace jarg1_, long jarg2, SBStructuredData jarg2_); + public final static native long SBTrace_Start__SWIG_1(long jarg1, SBTrace jarg1_, long jarg2, SBThread jarg2_, long jarg3, SBStructuredData jarg3_); + public final static native long SBTrace_Stop__SWIG_0(long jarg1, SBTrace jarg1_); + public final static native long SBTrace_Stop__SWIG_1(long jarg1, SBTrace jarg1_, long jarg2, SBThread jarg2_); public final static native boolean SBTrace_IsValid(long jarg1, SBTrace jarg1_); public final static native void delete_SBTrace(long jarg1); - public final static native long new_SBTraceOptions(); - public final static native int SBTraceOptions_getType(long jarg1, SBTraceOptions jarg1_); - public final static native java.math.BigInteger SBTraceOptions_getTraceBufferSize(long jarg1, SBTraceOptions jarg1_); - public final static native long SBTraceOptions_getTraceParams(long jarg1, SBTraceOptions jarg1_, long jarg2, SBError jarg2_); - public final static native java.math.BigInteger SBTraceOptions_getMetaDataBufferSize(long jarg1, SBTraceOptions jarg1_); - public final static native void SBTraceOptions_setTraceParams(long jarg1, SBTraceOptions jarg1_, long jarg2, SBStructuredData jarg2_); - public final static native void SBTraceOptions_setType(long jarg1, SBTraceOptions jarg1_, int jarg2); - public final static native void SBTraceOptions_setTraceBufferSize(long jarg1, SBTraceOptions jarg1_, java.math.BigInteger jarg2); - public final static native void SBTraceOptions_setMetaDataBufferSize(long jarg1, SBTraceOptions jarg1_, java.math.BigInteger jarg2); - public final static native void SBTraceOptions_setThreadID(long jarg1, SBTraceOptions jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBTraceOptions_getThreadID(long jarg1, SBTraceOptions jarg1_); - public final static native boolean SBTraceOptions_IsValid(long jarg1, SBTraceOptions jarg1_); - public final static native void delete_SBTraceOptions(long jarg1); public final static native long new_SBTypeMember__SWIG_0(); public final static native long new_SBTypeMember__SWIG_1(long jarg1, SBTypeMember jarg1_); public final static native void delete_SBTypeMember(long jarg1); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/arm/LldbArmDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/arm/LldbArmDebuggerMappingOpinion.java index 2393a15c9a..07fa4cba13 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/arm/LldbArmDebuggerMappingOpinion.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/arm/LldbArmDebuggerMappingOpinion.java @@ -29,7 +29,7 @@ import ghidra.util.Msg; */ public class LldbArmDebuggerMappingOpinion implements DebuggerMappingOpinion { protected static final LanguageID LANG_ID_AARCH64 = new LanguageID("AARCH64:LE:64:v8A"); - protected static final CompilerSpecID COMP_ID_GCC = new CompilerSpecID("gcc"); + protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); protected static class LldbI386X86_64RegisterMapper extends DefaultDebuggerRegisterMapper { public LldbI386X86_64RegisterMapper(CompilerSpec cSpec, @@ -49,7 +49,7 @@ public class LldbArmDebuggerMappingOpinion implements DebuggerMappingOpinion { protected static class LldbAarch64MacosOffer extends DefaultDebuggerMappingOffer { public LldbAarch64MacosOffer(TargetProcess process) { - super(process, 50, "AARCH64/LLDB on macos", LANG_ID_AARCH64, COMP_ID_GCC, + super(process, 50, "AARCH64/LLDB on macos", LANG_ID_AARCH64,COMP_ID_DEFAULT, Set.of("cpsr")); } } @@ -61,7 +61,7 @@ public class LldbArmDebuggerMappingOpinion implements DebuggerMappingOpinion { return Set.of(); } String arch = env.getArchitecture(); - boolean is64Bit = arch.contains("AARCH64"); + boolean is64Bit = arch.contains("AARCH64") || arch.contains("arm64"); String os = env.getOperatingSystem(); if (os.contains("macos")) { if (is64Bit) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java index fddacfb809..a475e88b6d 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java @@ -18,15 +18,18 @@ package ghidra.app.plugin.core.debug.platform.lldb; import java.util.Set; import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.program.model.lang.*; +import ghidra.dbg.target.TargetEnvironment; +import ghidra.dbg.target.TargetProcess; +import ghidra.program.model.lang.CompilerSpecID; +import ghidra.program.model.lang.LanguageID; import ghidra.util.Msg; public class LldbX86DebuggerMappingOpinion implements DebuggerMappingOpinion { protected static final LanguageID LANG_ID_X86 = new LanguageID("x86:LE:32:default"); protected static final LanguageID LANG_ID_X86_64 = new LanguageID("x86:LE:64:default"); + protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); protected static final CompilerSpecID COMP_ID_GCC = new CompilerSpecID("gcc"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("Visual Studio"); + protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("windows"); protected static class LldbI386MacosOffer extends DefaultDebuggerMappingOffer { public LldbI386MacosOffer(TargetProcess process) { @@ -74,30 +77,49 @@ public class LldbX86DebuggerMappingOpinion implements DebuggerMappingOpinion { return Set.of(); } String arch = env.getArchitecture(); - if (arch.startsWith("i386")) { - return Set.of(); - } + boolean is32Bit = arch.contains("x86-32") || arch.contains("i386") || + arch.contains("x86_32"); boolean is64Bit = arch.contains("x86-64") || arch.contains("x64-32") || - arch.contains("x86_64") || arch.contains("x64_32"); + arch.contains("x86_64") || arch.contains("x64_32") || arch.contains("i686"); String os = env.getOperatingSystem(); - Msg.info(this, "Using os=" + os + " arch=" + arch); if (os.contains("macos")) { if (is64Bit) { + Msg.info(this, "Using os=" + os + " arch=" + arch); return Set.of(new LldbI386X86_64MacosOffer(process)); } - return Set.of(new LldbI386MacosOffer(process)); + else if (is32Bit) { + Msg.info(this, "Using os=" + os + " arch=" + arch); + return Set.of(new LldbI386MacosOffer(process)); + } + else { + return Set.of(); + } } else if (os.contains("Linux") || os.contains("linux")) { if (is64Bit) { + Msg.info(this, "Using os=" + os + " arch=" + arch); return Set.of(new LldbI386X86_64LinuxOffer(process)); } - return Set.of(new LldbI386LinuxOffer(process)); + else if (is32Bit) { + Msg.info(this, "Using os=" + os + " arch=" + arch); + return Set.of(new LldbI386LinuxOffer(process)); + } + else { + return Set.of(); + } } - else if (os.contains("Cygwin")) { + else if (os.contains("windows")) { if (is64Bit) { + Msg.info(this, "Using os=" + os + " arch=" + arch); return Set.of(new LldbI386X86_64WindowsOffer(process)); } - return Set.of(new LldbI386WindowsOffer(process)); + else if (is32Bit) { + Msg.info(this, "Using os=" + os + " arch=" + arch); + return Set.of(new LldbI386WindowsOffer(process)); + } + else { + return Set.of(); + } } return Set.of(); } From 3578de3671c7df7cfd1e1101d5c93645affd646d Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Mon, 29 Nov 2021 18:53:08 -0500 Subject: [PATCH 6/8] Updated svrREADME.html to flag Mac OS service issue --- Ghidra/RuntimeScripts/Common/server/svrREADME.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Ghidra/RuntimeScripts/Common/server/svrREADME.html b/Ghidra/RuntimeScripts/Common/server/svrREADME.html index 80c2dc0630..cc5a1235cc 100644 --- a/Ghidra/RuntimeScripts/Common/server/svrREADME.html +++ b/Ghidra/RuntimeScripts/Common/server/svrREADME.html @@ -1016,6 +1016,17 @@ this problem is to install haveged (HArdware Volatile Entropy Gathering a Expansion Daemon) which will satisfy the entropy demand needed by /dev/random.

+
+

Mac OS - Service fails to start

+

+The installed service may fail to start with Mac OS Majave (10.14) and later due +to changes in the Mac OS system protection feature. When the service fails to start it does not +provide any error or logging to help determine the cause. Although granting Full Disk Access +to Java can be a workaround, this is rather drastic and is not considered desirable +since it will allow any Java application to run as root. For this reason, installation +of the Ghidra Server as a service on Mac OS is discouraged. +

+ (Back to Top)
From b3eb62ee3f804999560d3638b51ff6d0c2be3673 Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Mon, 29 Nov 2021 19:05:47 -0500 Subject: [PATCH 7/8] GP-1477 added additional gradle logging --- Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle b/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle index 5f9a7d12c9..6471028bd5 100644 --- a/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle +++ b/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle @@ -35,6 +35,7 @@ task generateSwig { outputs.dir(outdir_cpp) doLast { if (System.env.LLVM_HOME) { + println "Debugger-swig-lldb: using LLVM_HOME=" + System.env.LLVM_HOME new File(ext.outdir_java, "/SWIG").mkdirs() def exe = "swig" exec { From 2aefe6a15da1e4ddd4afa7acd1c5a387936be84f Mon Sep 17 00:00:00 2001 From: ghidra007 Date: Tue, 30 Nov 2021 01:38:13 +0000 Subject: [PATCH 8/8] GP-1519 Changed getComponentAt to getComponentContaining in a breaking EditStructureUtils method and a couple other places. Various refactoring to clean up code. --- .../RecoverClassesFromRTTIScript.java | 2 - .../classrecovery/EditStructureUtils.java | 71 ++++---- ...Utils.java => ExtendedFlatProgramAPI.java} | 38 ++--- .../classrecovery/RTTIClassRecoverer.java | 2 +- .../classrecovery/RTTIGccClassRecoverer.java | 71 ++++---- .../RTTIWindowsClassRecoverer.java | 109 +++++++------ .../classrecovery/RecoveredClass.java | 28 ++-- .../classrecovery/RecoveredClassUtils.java | 152 +++++++++--------- 8 files changed, 238 insertions(+), 235 deletions(-) rename Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/{ExtraScriptUtils.java => ExtendedFlatProgramAPI.java} (97%) diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/RecoverClassesFromRTTIScript.java b/Ghidra/Features/Decompiler/ghidra_scripts/RecoverClassesFromRTTIScript.java index b98cb2ba67..67ca4f7c1f 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/RecoverClassesFromRTTIScript.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/RecoverClassesFromRTTIScript.java @@ -165,8 +165,6 @@ public class RecoverClassesFromRTTIScript extends GhidraScript { RTTIClassRecoverer recoverClassesFromRTTI; - ExtraScriptUtils extraUtils; - boolean nameVfunctions = false; @Override diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/EditStructureUtils.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/EditStructureUtils.java index 79b8cb7a57..26e380621d 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/EditStructureUtils.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/EditStructureUtils.java @@ -22,9 +22,9 @@ import ghidra.program.model.data.*; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; -public class EditStructureUtils { +class EditStructureUtils { - EditStructureUtils() { + private EditStructureUtils() { } @@ -42,7 +42,7 @@ public class EditStructureUtils { * internal struct, false otherwise * @throws CancelledException if cancelled */ - public boolean hasReplaceableComponentsAtOffset(Structure containingStruct, int offset, + static boolean hasReplaceableComponentsAtOffset(Structure containingStruct, int offset, Structure newInternalStruct, TaskMonitor monitor) throws CancelledException { DataTypeComponent[] newStructComponents = newInternalStruct.getComponents(); @@ -95,7 +95,7 @@ public class EditStructureUtils { * @return true if there are at least length undefined size 1 components at the given offset in the given structure * @throws CancelledException if cancelled */ - public boolean hasEnoughUndefined1sAtOffset(Structure structure, int offset, int length, + static boolean hasEnoughUndefined1sAtOffset(Structure structure, int offset, int length, TaskMonitor monitor) throws CancelledException { if (structure.getLength() < offset + length) { @@ -128,7 +128,7 @@ public class EditStructureUtils { * @return true if successfully cleared from offset to offset+length, false otherwise * @throws CancelledException if cancelled */ - public boolean clearLengthAtOffset(Structure structure, int offset, int length, + static boolean clearLengthAtOffset(Structure structure, int offset, int length, TaskMonitor monitor) throws CancelledException { if (structure.getLength() < offset + length) { @@ -143,17 +143,10 @@ public class EditStructureUtils { monitor.checkCanceled(); - DataTypeComponent component = structure.getComponentAt(offset); - DataType dataType = component.getDataType(); + DataTypeComponent component = structure.getComponentContaining(offset); - // return false if it would clear too much - if (offset + dataType.getLength() > endOfClear) { - return false; - } - - offsetsToClear.add(offset); - offset += dataType.getLength(); - continue; + offsetsToClear.add(component.getOffset()); + offset = component.getOffset() + component.getLength(); } @@ -178,11 +171,12 @@ public class EditStructureUtils { * @param dataType the given data type * @return true if given data type is undefined size 1, false otherwise */ - public boolean isUndefined1(DataType dataType) { + static boolean isUndefined1(DataType dataType) { - if (isUndefined(dataType) && dataType.getLength() == 1) { + if (Undefined.isUndefined(dataType) && dataType.getLength() == 1) { return true; } + return false; } @@ -191,7 +185,7 @@ public class EditStructureUtils { * @param dataType the given data type * @return true if given data type is undefined of any size, false otherwise */ - public boolean isUndefined(DataType dataType) { + static boolean isUndefined(DataType dataType) { if (dataType.getName().contains("undefined")) { return true; } @@ -199,41 +193,46 @@ public class EditStructureUtils { } /** - * Method to determine if there are at least the given length of undefined (any size) components at the given offset in the given structure + * Method to determine if there are at least the given length of undefined (any size) components + * at the given offset in the given structure. This is only valid for non-packed structures. * @param structure the given structure * @param offset the given offset * @param length the total length of undefined components to check for starting at given offset * @param monitor task monitor * @return true if there are at least total length of undefined components at the given offset in the given structure * @throws CancelledException if cancelled + * @throws IllegalArgumentException if a packed structure is passed in */ - public boolean hasEnoughUndefinedsOfAnyLengthAtOffset(Structure structure, int offset, + static boolean hasEnoughUndefinedsOfAnyLengthAtOffset(Structure structure, int offset, int length, TaskMonitor monitor) throws CancelledException { - if (structure.getLength() < offset + length) { - return false; + if (structure.isPackingEnabled()) { + throw new IllegalArgumentException( + "Packed structures are not supported by this method"); } int endOfRange = offset + length; + if (offset < 0 || length <= 0 || structure.getLength() < endOfRange) { + return false; + } + while (offset < endOfRange) { monitor.checkCanceled(); - DataTypeComponent component = structure.getComponentAt(offset); + DataTypeComponent component = structure.getComponentContaining(offset); + DataType dataType = component.getDataType(); - if (isUndefined(dataType)) { - - offset += dataType.getLength(); - if (offset > endOfRange) { - return false; - } - - continue; + if (!Undefined.isUndefined(dataType)) { + return false; } - return false; + + offset = component.getOffset() + component.getLength(); + } + return true; } @@ -251,7 +250,7 @@ public class EditStructureUtils { * @throws IllegalArgumentException if issue inserting data type into structure * @throws CancelledException if cancelled */ - public Structure addDataTypeToStructure(Structure structure, int offset, + static Structure addDataTypeToStructure(Structure structure, int offset, DataType dataType, String fieldName, TaskMonitor monitor) throws CancelledException, IllegalArgumentException { @@ -292,7 +291,7 @@ public class EditStructureUtils { * @return true if the given structure has room at the given offset to have a component of the given length added to it * @throws CancelledException if cancelled */ - public boolean canAdd(Structure structureDataType, int offset, int lengthToAdd, + static boolean canAdd(Structure structureDataType, int offset, int lengthToAdd, TaskMonitor monitor) throws CancelledException { @@ -332,7 +331,7 @@ public class EditStructureUtils { * @return the number of undefined size 1 components in the given structure before the given offset * @throws CancelledException if cancelled */ - public int getNumberOfUndefinedsBeforeOffset(Structure structure, int offset, + static int getNumberOfUndefinedsBeforeOffset(Structure structure, int offset, TaskMonitor monitor) throws CancelledException { if (structure.getNumComponents() == 0) { @@ -364,7 +363,7 @@ public class EditStructureUtils { * @return the number of undefined size 1 components starting at the given offset in the given structure * @throws CancelledException if cancelled */ - public int getNumberOfUndefinedsStartingAtOffset(Structure structure, int offset, + static int getNumberOfUndefinedsStartingAtOffset(Structure structure, int offset, TaskMonitor monitor) throws CancelledException { int numUndefineds = 0; diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtraScriptUtils.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtendedFlatProgramAPI.java similarity index 97% rename from Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtraScriptUtils.java rename to Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtendedFlatProgramAPI.java index 150c8696b6..61896eacaf 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtraScriptUtils.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtendedFlatProgramAPI.java @@ -34,19 +34,13 @@ import ghidra.program.model.symbol.*; import ghidra.util.exception.*; import ghidra.util.task.TaskMonitor; -public class ExtraScriptUtils extends FlatProgramAPI { +public class ExtendedFlatProgramAPI extends FlatProgramAPI { - Program program; - TaskMonitor taskMonitor; - int defaultPointerSize; + final int defaultPointerSize; - ExtraScriptUtils(Program program, TaskMonitor taskMonitor) { - this.program = program; - this.taskMonitor = taskMonitor; - - currentProgram = program; - monitor = taskMonitor; + ExtendedFlatProgramAPI(Program program, TaskMonitor taskMonitor) { + super(program, taskMonitor); defaultPointerSize = program.getDefaultPointerSize(); } @@ -66,7 +60,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { int numComponents = data.getNumComponents(); for (int ii = 0; ii < numComponents; ++ii) { - taskMonitor.checkCanceled(); + monitor.checkCanceled(); Data component = data.getComponent(ii); if (!component.isPointer()) { @@ -125,7 +119,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { } // check for or create function pointer if valid function pointed to - Data data = program.getListing().getDefinedDataAt(address); + Data data = currentProgram.getListing().getDefinedDataAt(address); if (data != null) { if (data.isPointer() && getPointedToFunction(address) != null) { return true; @@ -165,8 +159,8 @@ public class ExtraScriptUtils extends FlatProgramAPI { return false; } - DataType nullPointer = program.getDataTypeManager().getPointer(null); - Listing listing = program.getListing(); + DataType nullPointer = currentProgram.getDataTypeManager().getPointer(null); + Listing listing = currentProgram.getListing(); Data d = listing.getDefinedDataAt(address); if (d == null) { try { @@ -316,7 +310,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { */ public Function createFunctionBefore(Address address, Byte expectedFiller) { - PseudoDisassembler pseudoDisassembler = new PseudoDisassembler(program); + PseudoDisassembler pseudoDisassembler = new PseudoDisassembler(currentProgram); Instruction instructionBefore = getInstructionBefore(address); @@ -419,7 +413,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { public int getNumberOfSameFillerBytesStartingAtAddress(Address firstAddress) throws CancelledException, MemoryAccessException { - AddressSetView validMemory = program.getMemory().getLoadedAndInitializedAddressSet(); + AddressSetView validMemory = currentProgram.getMemory().getLoadedAndInitializedAddressSet(); if (firstAddress == null) { return 0; @@ -529,7 +523,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { // Create a new address set to hold the entire selection. AddressSet subroutineAddresses = new AddressSet(); - IsolatedEntrySubModel model = new IsolatedEntrySubModel(program); + IsolatedEntrySubModel model = new IsolatedEntrySubModel(currentProgram); CodeBlock[] codeBlocksContaining = model.getCodeBlocksContaining(address, monitor); for (CodeBlock element : codeBlocksContaining) { @@ -607,7 +601,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { int addressSize = address.getSize(); if (addressSize == 64 && getIboIf64bit) { ImageBaseOffset32DataType ibo32 = - new ImageBaseOffset32DataType(program.getDataTypeManager()); + new ImageBaseOffset32DataType(currentProgram.getDataTypeManager()); int length = ibo32.getLength(); DumbMemBufferImpl compMemBuffer = new DumbMemBufferImpl(currentProgram.getMemory(), address); @@ -654,7 +648,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { List symbolList = new ArrayList(); - SymbolIterator symbols = program.getSymbolTable().getSymbols(namespace); + SymbolIterator symbols = currentProgram.getSymbolTable().getSymbols(namespace); while (symbols.hasNext()) { monitor.checkCanceled(); @@ -765,7 +759,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { List
referenceAddresses = new ArrayList
(); ReferenceIterator referencesToFunctionBIterator = - program.getReferenceManager().getReferencesTo(bFunction.getEntryPoint()); + currentProgram.getReferenceManager().getReferencesTo(bFunction.getEntryPoint()); while (referencesToFunctionBIterator.hasNext()) { @@ -995,7 +989,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { */ public void removeAllSymbolsAtAddress(Address address) throws CancelledException { - SymbolTable symbolTable = program.getSymbolTable(); + SymbolTable symbolTable = currentProgram.getSymbolTable(); Symbol primarySymbol = symbolTable.getPrimarySymbol(address); @@ -1031,7 +1025,7 @@ public class ExtraScriptUtils extends FlatProgramAPI { */ public boolean hasSymbolsInNamespace(Namespace namespace) { - SymbolIterator namespaceSymbols = program.getSymbolTable().getSymbols(namespace); + SymbolIterator namespaceSymbols = currentProgram.getSymbolTable().getSymbols(namespace); if (namespaceSymbols.hasNext()) { return true; diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIClassRecoverer.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIClassRecoverer.java index 408765ac17..be63405f46 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIClassRecoverer.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIClassRecoverer.java @@ -161,7 +161,7 @@ public class RTTIClassRecoverer extends RecoveredClassUtils { // if class is non-virtual have to search for an existing class datatype if (!recoveredClass.hasVftable()) { DataType[] possibleExistingClassStructures = - extraUtils.getDataTypes(recoveredClass.getName()); + extendedFlatAPI.getDataTypes(recoveredClass.getName()); if (possibleExistingClassStructures.length == 0) { continue; } diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIGccClassRecoverer.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIGccClassRecoverer.java index a678e60417..cd624a8213 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIGccClassRecoverer.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIGccClassRecoverer.java @@ -253,7 +253,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { recoveredClasses = recoverClassesFromVftables(vftableSymbols, true, true); // find all typeinfo symbols and get their class namespace and create RecoveredClass object - List typeinfoSymbols = extraUtils.getListOfSymbolsInAddressSet( + List typeinfoSymbols = extendedFlatAPI.getListOfSymbolsInAddressSet( program.getAddressFactory().getAddressSet(), "typeinfo", true); // create class objects for each typeinfo struct and make a class to typeinfo mapping for each @@ -325,7 +325,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { } } - Address specialTypeinfoRef = extraUtils.getSingleReferencedAddress(typeinfoAddress); + Address specialTypeinfoRef = extendedFlatAPI.getSingleReferencedAddress(typeinfoAddress); if (specialTypeinfoRef == null) { if (DEBUG) { Msg.debug(this, @@ -454,7 +454,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { listOfVtableSymbols = findVtablesUsingTypeinfoRefs(); } else { - listOfVtableSymbols = extraUtils.getListOfSymbolsInAddressSet( + listOfVtableSymbols = extendedFlatAPI.getListOfSymbolsInAddressSet( program.getAddressFactory().getAddressSet(), VTABLE_LABEL, false); } @@ -496,7 +496,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { for (Address typeinfoRef : typeinfoReferencesNotInTypeinfoStructs) { monitor.checkCanceled(); - Address typeinfoAddress = extraUtils.getPointer(typeinfoRef); + Address typeinfoAddress = extendedFlatAPI.getPointer(typeinfoRef); if (typeinfoAddress == null) { continue; @@ -563,7 +563,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { // check for appropriately sized long that is value 0 to make sure the // vtable the typeinfo ref is in is the main one and skip otherwise since non-zero // ones are internal vtables that will get processed with the main one - if (!extraUtils.hasNumZeros(longBeforeTypeinfoRef, defaultPointerSize)) { + if (!extendedFlatAPI.hasNumZeros(longBeforeTypeinfoRef, defaultPointerSize)) { return null; } @@ -590,7 +590,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { private Address getPointerToDefinedMemory(Address address) { - Address pointer = extraUtils.getPointer(address); + Address pointer = extendedFlatAPI.getPointer(address); if (pointer == null) { return null; } @@ -966,7 +966,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { private Symbol getVTTBefore(Address address) throws CancelledException { // get all symbols named VTT and get the one directly before the given address - List vttSymbols = extraUtils.getListOfSymbolsInAddressSet( + List vttSymbols = extendedFlatAPI.getListOfSymbolsInAddressSet( program.getAddressFactory().getAddressSet(), "VTT", true); return getSymbolOnListBeforeAddress(address, vttSymbols); @@ -1210,7 +1210,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { return false; } - Reference[] referencesTo = extraUtils.getReferencesTo(address); + Reference[] referencesTo = extendedFlatAPI.getReferencesTo(address); if (referencesTo.length > 0) { return false; } @@ -1239,7 +1239,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { return false; } - List
referenceFromAddresses = extraUtils.getReferenceFromAddresses(address); + List
referenceFromAddresses = extendedFlatAPI.getReferenceFromAddresses(address); if (referenceFromAddresses.size() > 0) { return false; @@ -1304,7 +1304,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { return false; } - if (extraUtils.hasNumZeros(vftableAddress, defaultPointerSize)) { + if (extendedFlatAPI.hasNumZeros(vftableAddress, defaultPointerSize)) { return true; } @@ -1313,7 +1313,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { if (!data.isPointer()) { return false; } - Address referencedAddress = extraUtils.getSingleReferencedAddress(vftableAddress); + Address referencedAddress = extendedFlatAPI.getSingleReferencedAddress(vftableAddress); if (referencedAddress == null) { return false; } @@ -1407,7 +1407,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { // create a pointer and check to see if it is a reference to a valid memory location try { api.createData(address, pointer); - Address referencedAddress = extraUtils.getSingleReferencedAddress(address); + Address referencedAddress = extendedFlatAPI.getSingleReferencedAddress(address); // if it isn't valid, clear what we just created and increment to offset so // the next can be checked @@ -1464,7 +1464,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { for (Address typeinfoAddress : typeinfoAddresses) { - Address specialTypeinfoRef = extraUtils.getSingleReferencedAddress(typeinfoAddress); + Address specialTypeinfoRef = extendedFlatAPI.getSingleReferencedAddress(typeinfoAddress); if (specialTypeinfoRef == null) { continue; } @@ -1698,7 +1698,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { } Address stringReference = - extraUtils.getSingleReferencedAddress(address.add(typeinfoNameComponent.getOffset())); + extendedFlatAPI.getSingleReferencedAddress(address.add(typeinfoNameComponent.getOffset())); Data stringData = api.getDataAt(stringReference); if (stringData == null) { @@ -1728,7 +1728,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { List
typeinfoAddresses = new ArrayList
(); - List typeinfoSymbols = extraUtils.getListOfSymbolsInAddressSet( + List typeinfoSymbols = extendedFlatAPI.getListOfSymbolsInAddressSet( program.getAddressFactory().getAddressSet(), "typeinfo", true); Iterator typeinfoIterator = typeinfoSymbols.iterator(); @@ -2153,8 +2153,8 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { //virtual base offset for the virtual base referenced (negative). long offset = (publicVirtualOffsetFlag & offsetMask) >> 8; - Msg.debug(this, "typeinfo " + typeinfoAddress + " base [" + i + "] isVirtual = " + - isVirtual + " isPublic = " + isPublic + " offset = " + offset); +// Msg.debug(this, "typeinfo " + typeinfoAddress + " base [" + i + "] isVirtual = " + +// isVirtual + " isPublic = " + isPublic + " offset = " + offset); // add order to parent and parent offset orderToParentMap.put(i, parentClass); @@ -2207,7 +2207,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { */ private RecoveredClass getParentClassFromParentTypeInfoRef(Address parentTypeinfoRef) { - Address parentAddress = extraUtils.getSingleReferencedAddress(parentTypeinfoRef); + Address parentAddress = extendedFlatAPI.getSingleReferencedAddress(parentTypeinfoRef); if (parentAddress == null) { return null; } @@ -2295,7 +2295,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { int offset = 0; - Address address = extraUtils.getAddress(startAddress, offset); + Address address = extendedFlatAPI.getAddress(startAddress, offset); MemoryBlock currentMemoryBlock = program.getMemory().getBlock(startAddress); @@ -2309,10 +2309,10 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { return null; } - Address possibleTypeinfo = extraUtils.getPointer(address); + Address possibleTypeinfo = extendedFlatAPI.getPointer(address); if (possibleTypeinfo == null) { offset += defaultPointerSize; - address = extraUtils.getAddress(startAddress, offset); + address = extendedFlatAPI.getAddress(startAddress, offset); continue; } @@ -2322,7 +2322,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { return address; } offset += defaultPointerSize; - address = extraUtils.getAddress(startAddress, offset); + address = extendedFlatAPI.getAddress(startAddress, offset); } @@ -2339,7 +2339,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { List vftableSymbols = new ArrayList(); // find all vtable symbols - List listOfVtableSymbols = extraUtils.getListOfSymbolsInAddressSet( + List listOfVtableSymbols = extendedFlatAPI.getListOfSymbolsInAddressSet( program.getAddressFactory().getAddressSet(), VTABLE_LABEL, true); Iterator vtableIterator = listOfVtableSymbols.iterator(); @@ -2373,7 +2373,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { continue; } - Address vftableAddress = extraUtils.getAddress(typeinfoAddress, defaultPointerSize); + Address vftableAddress = extendedFlatAPI.getAddress(typeinfoAddress, defaultPointerSize); // no valid address here so continue if (vftableAddress == null) { //createNewClass(vtableNamespace, false); @@ -2454,7 +2454,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { recoveredClasses.add(recoveredClass); } - Address specialTypeinfoRef = extraUtils.getSingleReferencedAddress(typeinfoAddress); + Address specialTypeinfoRef = extendedFlatAPI.getSingleReferencedAddress(typeinfoAddress); if (specialTypeinfoRef == null) { if (DEBUG) { Msg.debug(this, @@ -2759,7 +2759,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { * @return true if the given address could be a valid null pointer, false if not */ private boolean isPossibleNullPointer(Address address) throws CancelledException { - if (!extraUtils.hasNumZeros(address, defaultPointerSize)) { + if (!extendedFlatAPI.hasNumZeros(address, defaultPointerSize)) { return false; } return true; @@ -2772,7 +2772,7 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { */ private boolean isPossibleFunctionPointer(Address address) { - Address possibleFunctionPointer = extraUtils.getPointer(address); + Address possibleFunctionPointer = extendedFlatAPI.getPointer(address); if (possibleFunctionPointer == null) { return false; } @@ -2967,9 +2967,11 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { DataType classVftablePointer = vfPointerDataTypes.get(vftableAddress); // simple case the offset for vftablePtr is 0 - if (structUtils.canAdd(classStructureDataType, 0, classVftablePointer.getLength(), + if (EditStructureUtils.canAdd(classStructureDataType, 0, + classVftablePointer.getLength(), monitor)) { - classStructureDataType = structUtils.addDataTypeToStructure(classStructureDataType, + classStructureDataType = + EditStructureUtils.addDataTypeToStructure(classStructureDataType, 0, classVftablePointer, CLASS_VTABLE_PTR_FIELD_EXT, monitor); } @@ -3013,10 +3015,11 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { " : structure should exist but doesn't."); } - if (structUtils.canAdd(classStructureDataType, parentOffset, + if (EditStructureUtils.canAdd(classStructureDataType, parentOffset, baseClassStructure.getLength(), monitor)) { classStructureDataType = - structUtils.addDataTypeToStructure(classStructureDataType, parentOffset, + EditStructureUtils.addDataTypeToStructure(classStructureDataType, + parentOffset, baseClassStructure, baseClassStructure.getName(), monitor); } } @@ -3027,7 +3030,8 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { int dataOffset = getDataOffset(recoveredClass, classStructureDataType); int dataLen = UNKNOWN; if (dataOffset != NONE) { - dataLen = structUtils.getNumberOfUndefinedsStartingAtOffset(classStructureDataType, + dataLen = + EditStructureUtils.getNumberOfUndefinedsStartingAtOffset(classStructureDataType, dataOffset, monitor); } @@ -3037,7 +3041,8 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer { classStructureDataType, dataLen, dataOffset); if (recoveredClassDataStruct != null) { - classStructureDataType = structUtils.addDataTypeToStructure(classStructureDataType, + classStructureDataType = EditStructureUtils.addDataTypeToStructure( + classStructureDataType, dataOffset, recoveredClassDataStruct, "data", monitor); } diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java index ddadec4088..669e207c28 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java @@ -190,7 +190,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { figureOutClassDataMembers(recoveredClasses); if (USE_SHORT_TEMPLATE_NAMES_IN_STRUCTURE_FIELDS) { - extraUtils.createShortenedTemplateNamesForClasses(recoveredClasses); + extendedFlatAPI.createShortenedTemplateNamesForClasses(recoveredClasses); } createAndApplyClassStructures(recoveredClasses); @@ -336,7 +336,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { continue; } - Data data = extraUtils.getDataAt(symbol.getAddress()); + Data data = extendedFlatAPI.getDataAt(symbol.getAddress()); if (data != null && data.getDataType().getName().contains(RTTI_BASE_COMPLETE_OBJECT_LOADER_DATA_NAME)) { completeObjectLocatorSymbols.add(symbol); @@ -375,7 +375,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { int sizeOfDt = completeObjLocatorDataType.getLength(); api.clearListing(address, address.add(sizeOfDt)); - Data completeObjectLocator = extraUtils.createData(address, completeObjLocatorDataType); + Data completeObjectLocator = extendedFlatAPI.createData(address, completeObjLocatorDataType); if (completeObjectLocator == null) { return null; } @@ -402,7 +402,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { continue; } - Data data = extraUtils.getDataAt(symbol.getAddress()); + Data data = extendedFlatAPI.getDataAt(symbol.getAddress()); if (data != null && data.getDataType().getName().contains(RTTI_BASE_CLASS_DESCRIPTOR_DATA_NAME)) { baseClassDescriptorSymbols.add(symbol); @@ -440,7 +440,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { api.clearListing(baseClassDescriptorAddress, baseClassDescriptorAddress.add(sizeOfDt)); Data baseClassDescArray = - extraUtils.createData(baseClassDescriptorAddress, baseClassDescriptor); + extendedFlatAPI.createData(baseClassDescriptorAddress, baseClassDescriptor); if (baseClassDescArray == null) { return null; } @@ -467,16 +467,16 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { //TODO: extraUtils.getReferencedAddress(address, getIboIf64bit); Address baseClassDescriptorAddress = getReferencedAddress(address.add(i * 4)); - Data baseClassDescriptor = extraUtils.getDataAt(baseClassDescriptorAddress); + Data baseClassDescriptor = extendedFlatAPI.getDataAt(baseClassDescriptorAddress); if (baseClassDescriptor == null || !baseClassDescriptor.getDataType() .getName() .equals( RTTI_BASE_CLASS_DESCRIPTOR_DATA_NAME)) { - int num1 = extraUtils.getInt(baseClassDescriptorAddress.add(8)); - int num2 = extraUtils.getInt(baseClassDescriptorAddress.add(12)); - int num3 = extraUtils.getInt(baseClassDescriptorAddress.add(16)); - int num4 = extraUtils.getInt(baseClassDescriptorAddress.add(20)); + int num1 = extendedFlatAPI.getInt(baseClassDescriptorAddress.add(8)); + int num2 = extendedFlatAPI.getInt(baseClassDescriptorAddress.add(12)); + int num3 = extendedFlatAPI.getInt(baseClassDescriptorAddress.add(16)); + int num4 = extendedFlatAPI.getInt(baseClassDescriptorAddress.add(20)); baseClassDescriptor = createBaseClassDescriptor(baseClassDescriptorAddress); if (baseClassDescriptor != null) { @@ -556,7 +556,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { //TODO: extraUtils.getReferencedAddress(address, getIboIf64bit); Address classHierarchyDescriptorAddress = getReferencedAddress(address); - Data classHierarchyStructure = extraUtils.getDataAt(classHierarchyDescriptorAddress); + Data classHierarchyStructure = extendedFlatAPI.getDataAt(classHierarchyDescriptorAddress); if (classHierarchyStructure != null && classHierarchyStructure.getDataType() @@ -601,7 +601,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { classHierarchyDescriptorAddress.add(sizeOfDt)); Data classHierarchyStructure = - extraUtils.createData(classHierarchyDescriptorAddress, classHDatatype); + extendedFlatAPI.createData(classHierarchyDescriptorAddress, classHDatatype); if (classHierarchyStructure == null) { return null; } @@ -634,13 +634,13 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { symbolTable.getPrimarySymbol(classHierarchyDescriptorAddress); Namespace classNamespace = classHierarchyDescriptorSymbol.getParentNamespace(); - int numBaseClasses = extraUtils.getInt(classHierarchyDescriptorAddress.add(8)); + int numBaseClasses = extendedFlatAPI.getInt(classHierarchyDescriptorAddress.add(8)); //TODO: extraUtils.getReferencedAddress(address, getIboIf64bit); Address baseClassArrayAddress = getReferencedAddress(classHierarchyDescriptorAddress.add(12)); - Data baseClassDescArray = extraUtils.getDataAt(baseClassArrayAddress); + Data baseClassDescArray = extendedFlatAPI.getDataAt(baseClassArrayAddress); if (baseClassDescArray != null && baseClassDescArray.isArray()) { baseClassArrayAddresses.add(baseClassArrayAddress); @@ -704,7 +704,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { api.clearListing(baseClassArrayAddress, baseClassArrayAddress.add(numBaseClasses * sizeOfDt)); Data baseClassDescArray = - extraUtils.createData(baseClassArrayAddress, baseClassDescArrayDT); + extendedFlatAPI.createData(baseClassArrayAddress, baseClassDescArrayDT); if (baseClassDescArray == null) { return null; @@ -740,7 +740,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { continue; } - Reference[] referencesTo = extraUtils.getReferencesTo(completeObjectLocatorAddress); + Reference[] referencesTo = extendedFlatAPI.getReferencesTo(completeObjectLocatorAddress); if (referencesTo.length == 0) { //println("no refs to " + completeObjectLocatorAddress.toString()); continue; @@ -824,7 +824,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { // this will work whether there is a created reference or not int addressSize = address.getSize(); if (addressSize == 32) { - long offset = extraUtils.getInt(address); + long offset = extendedFlatAPI.getInt(address); return address.getNewAddress(offset); } @@ -832,7 +832,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { // this currently will workn only if there is a created reference // TODO: get ibo bytes and figure out what the ibo ref address would be if (addressSize == 64) { - Reference refs[] = extraUtils.getReferencesFrom(address); + Reference refs[] = extendedFlatAPI.getReferencesFrom(address); if (refs.length == 0) { return null; } @@ -875,7 +875,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { findVftableReferencesNotInFunction(vftableSymbols); if (unusedVftableReferences.size() > 0) { - extraUtils.createUndefinedFunctions(unusedVftableReferences); + extendedFlatAPI.createUndefinedFunctions(unusedVftableReferences); } // create these automatically if found @@ -937,7 +937,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { // Create Data Type Manager Category for given class // TODO: make this global and check it for null CategoryPath classPath = - extraUtils.createDataTypeCategoryPath(classDataTypesCategoryPath, + extendedFlatAPI.createDataTypeCategoryPath(classDataTypesCategoryPath, classNameWithNamespace); RecoveredClass nonVftableClass = @@ -982,7 +982,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { */ private List getListOfClassHierarchyDescriptors() throws CancelledException { - List classHierarchyDescriptorList = extraUtils.getListOfSymbolsInAddressSet( + List classHierarchyDescriptorList = extendedFlatAPI.getListOfSymbolsInAddressSet( getInitializedMemory(), RTTI_CLASS_HIERARCHY_DESCRIPTOR_LABEL, false); return classHierarchyDescriptorList; @@ -1011,13 +1011,13 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { Address vftableAddress = vftableIterator.next(); Address ptrToColAddress = vftableAddress.subtract(defaultPointerSize); - Data pointerToCompleteObjLocator = extraUtils.getDataAt(vftableAddress); + Data pointerToCompleteObjLocator = extendedFlatAPI.getDataAt(vftableAddress); if (pointerToCompleteObjLocator == null) { pointerToCompleteObjLocator = - extraUtils.createData(ptrToColAddress, pointerDataType); + extendedFlatAPI.createData(ptrToColAddress, pointerDataType); } - Address colAddress = extraUtils.getReferencedAddress(ptrToColAddress, false); + Address colAddress = extendedFlatAPI.getReferencedAddress(ptrToColAddress, false); if (colAddress == null) { // println(recoveredClass.getName() + " couldn't get referenced col from " + @@ -1028,7 +1028,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { try { Address addressOfOffset = colAddress.add(4); - int offset = extraUtils.getInt(addressOfOffset); + int offset = extendedFlatAPI.getInt(addressOfOffset); recoveredClass.addClassOffsetToVftableMapping(offset, vftableAddress); } @@ -1178,7 +1178,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { List classHierarchy = new ArrayList(); - List symbols = extraUtils.getListOfSymbolsByNameInNamespace( + List symbols = extendedFlatAPI.getListOfSymbolsByNameInNamespace( RTTI_BASE_CLASS_ARRAY_LABEL, recoveredClass.getClassNamespace(), false); @@ -1195,7 +1195,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { Address pointerAddress = rttiBaseClassDescriptorArray.getComponent(i).getAddress(); Address baseClassDescriptorAddress = - extraUtils.getSingleReferencedAddress(pointerAddress); + extendedFlatAPI.getSingleReferencedAddress(pointerAddress); if (baseClassDescriptorAddress == null) { return classHierarchy; @@ -1246,13 +1246,13 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { private int getClassInheritanceFlag(Namespace classNamespace) throws CancelledException, MemoryAccessException, AddressOutOfBoundsException { - List symbols = extraUtils.getListOfSymbolsByNameInNamespace( + List symbols = extendedFlatAPI.getListOfSymbolsByNameInNamespace( RTTI_CLASS_HIERARCHY_DESCRIPTOR_LABEL, classNamespace, false); if (symbols.size() >= 1) { try { - return (extraUtils.getInt(symbols.get(0).getAddress().add(4))); + return (extendedFlatAPI.getInt(symbols.get(0).getAddress().add(4))); } catch (MemoryAccessException e) { // println("Could not get class inheritance flag at address " + @@ -1393,7 +1393,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { // iterate over base class array and for each parent class of the given recovered class // get the mdisp, pdisp, vdisp info - List baseClassArray = extraUtils.getListOfSymbolsByNameInNamespace( + List baseClassArray = extendedFlatAPI.getListOfSymbolsByNameInNamespace( RTTI_BASE_CLASS_ARRAY_LABEL, recoveredClass.getClassNamespace(), false); // this should never happen @@ -1425,7 +1425,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { Address pointerAddress = baseClassArrayData.getComponent(i).getAddress(); Address baseClassDescriptorAddress = - extraUtils.getReferencedAddress(pointerAddress, true); + extendedFlatAPI.getReferencedAddress(pointerAddress, true); if (baseClassArrayAddress == null) { continue; } @@ -1630,7 +1630,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { getTargetAddressFromPcodeOp(offsetPcodeOpPair.getPcodeOp()); Address vbtableAddress = - extraUtils.getSingleReferencedAddress(listingAddress); + extendedFlatAPI.getSingleReferencedAddress(listingAddress); if (vbtableAddress == null) { continue; @@ -1989,7 +1989,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { if (possibleVftable == null) { Function referencedFunction = - extraUtils.getReferencedFunction(classReferenceAddress, true); + extendedFlatAPI.getReferencedFunction(classReferenceAddress, true); if (referencedFunction == null) { continue; } @@ -2337,7 +2337,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { Address pointerAddress = baseClassArrayData.getComponent(i).getAddress(); Address baseClassDescriptorAddress = - extraUtils.getReferencedAddress(pointerAddress, true); + extendedFlatAPI.getReferencedAddress(pointerAddress, true); if (baseClassDescriptorAddress == null) { continue; } @@ -2400,7 +2400,8 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { dataLength = baseClassStructure.getLength() - lengthOfVirtualParent; } - if (structUtils.canAdd(classStructureDataType, baseClassOffset, dataLength, + if (EditStructureUtils.canAdd(classStructureDataType, baseClassOffset, + dataLength, monitor)) { classStructureDataType = addIndividualComponentsToStructure(classStructureDataType, @@ -2410,10 +2411,11 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { } // else copy whole baseClass structure to the class Structure - if (structUtils.canAdd(classStructureDataType, baseClassOffset, + if (EditStructureUtils.canAdd(classStructureDataType, baseClassOffset, baseClassStructure.getLength(), monitor)) { classStructureDataType = - structUtils.addDataTypeToStructure(classStructureDataType, baseClassOffset, + EditStructureUtils.addDataTypeToStructure(classStructureDataType, + baseClassOffset, baseClassStructure, baseClassStructure.getName(), monitor); } @@ -2429,11 +2431,12 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { baseClassOffset = api.getInt(recoveredClass.getVbtableAddress().add(vdisp)) + pdisp; - if (structUtils.canAdd(classStructureDataType, baseClassOffset, + if (EditStructureUtils.canAdd(classStructureDataType, baseClassOffset, baseClassStructure.getLength(), monitor)) { classStructureDataType = - structUtils.addDataTypeToStructure(classStructureDataType, baseClassOffset, + EditStructureUtils.addDataTypeToStructure(classStructureDataType, + baseClassOffset, baseClassStructure, baseClassStructure.getName(), monitor); } @@ -2461,9 +2464,10 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { DataType classVftablePointer = vfPointerDataTypes.get(vftableAddress); - if (structUtils.canAdd(classStructureDataType, offset.intValue(), + if (EditStructureUtils.canAdd(classStructureDataType, offset.intValue(), classVftablePointer.getLength(), monitor)) { - classStructureDataType = structUtils.addDataTypeToStructure(classStructureDataType, + classStructureDataType = EditStructureUtils.addDataTypeToStructure( + classStructureDataType, offset.intValue(), classVftablePointer, CLASS_VTABLE_PTR_FIELD_EXT, monitor); } @@ -2479,7 +2483,8 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { int dataOffset = getDataOffset(recoveredClass, classStructureDataType); int dataLen = UNKNOWN; if (dataOffset != NONE) { - dataLen = structUtils.getNumberOfUndefinedsStartingAtOffset(classStructureDataType, + dataLen = + EditStructureUtils.getNumberOfUndefinedsStartingAtOffset(classStructureDataType, dataOffset, monitor); } @@ -2489,7 +2494,8 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { classStructureDataType, dataLen, dataOffset); if (recoveredClassDataStruct != null) { - classStructureDataType = structUtils.addDataTypeToStructure(classStructureDataType, + classStructureDataType = + EditStructureUtils.addDataTypeToStructure(classStructureDataType, dataOffset, recoveredClassDataStruct, classStructureDataType.getName() + "_data", monitor); } @@ -2556,11 +2562,12 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { monitor.checkCanceled(); // if enough empty bytes - add class vftable pointer - if (structUtils.canAdd(classStructureDataType, vftableOffset, + if (EditStructureUtils.canAdd(classStructureDataType, vftableOffset, classVftablePointer.getLength(), monitor)) { classStructureDataType = - structUtils.addDataTypeToStructure(classStructureDataType, vftableOffset, + EditStructureUtils.addDataTypeToStructure(classStructureDataType, + vftableOffset, classVftablePointer, CLASS_VTABLE_PTR_FIELD_EXT, monitor); addedVftablePointer = true; @@ -2677,7 +2684,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { return false; } int numUndefined1s = - structUtils.getNumberOfUndefinedsStartingAtOffset(structure, 0, monitor); + EditStructureUtils.getNumberOfUndefinedsStartingAtOffset(structure, 0, monitor); if (structure.getLength() == numUndefined1s) { return true; } @@ -2722,7 +2729,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { Address pointerAddress = baseClassArrayData.getComponent(i).getAddress(); Address baseClassDescriptorAddress = - extraUtils.getReferencedAddress(pointerAddress, true); + extendedFlatAPI.getReferencedAddress(pointerAddress, true); if (baseClassDescriptorAddress == null) { continue; } @@ -2785,7 +2792,7 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { */ private Data getBaseClassArray(RecoveredClass recoveredClass) throws CancelledException { - List baseClassArray = extraUtils.getListOfSymbolsByNameInNamespace( + List baseClassArray = extendedFlatAPI.getListOfSymbolsByNameInNamespace( RTTI_BASE_CLASS_ARRAY_LABEL, recoveredClass.getClassNamespace(), false); if (baseClassArray.size() != 1) { @@ -2842,9 +2849,11 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer { DataType vbaseStructPointer = dataTypeManager.getPointer(vbtableStructure); int dataLength = vbaseStructPointer.getLength(); - if (structUtils.canAdd(classStructureDataType, vbtableOffset, dataLength, monitor)) { + if (EditStructureUtils.canAdd(classStructureDataType, vbtableOffset, dataLength, + monitor)) { - classStructureDataType = structUtils.addDataTypeToStructure(classStructureDataType, + classStructureDataType = + EditStructureUtils.addDataTypeToStructure(classStructureDataType, vbtableOffset, vbaseStructPointer, "vbtablePtr", monitor); } diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClass.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClass.java index 80b386f1cd..97797660b6 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClass.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClass.java @@ -95,7 +95,6 @@ public class RecoveredClass { private static final int NONE = -1; TaskMonitor monitor = TaskMonitor.DUMMY; - EditStructureUtils structUtils; RecoveredClass(String name, CategoryPath classPath, Namespace classNamespace, @@ -105,7 +104,6 @@ public class RecoveredClass { this.classNamespace = classNamespace; this.dataTypeManager = dataTypeManager; - this.structUtils = new EditStructureUtils(); } public String getName() { @@ -531,11 +529,11 @@ public class RecoveredClass { // if the new component is a non-empty structure, check to see if the current // structure has undefined or equivalent components and replace with new struct if so if (newComponentDataType instanceof Structure) { - if (structUtils.hasReplaceableComponentsAtOffset(computedClassStructure, + if (EditStructureUtils.hasReplaceableComponentsAtOffset(computedClassStructure, offset, (Structure) newComponentDataType, monitor)) { boolean successfulClear = - structUtils.clearLengthAtOffset(computedClassStructure, offset, + EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset, length, monitor); if (successfulClear) { @@ -547,13 +545,14 @@ public class RecoveredClass { } // if current component is undefined size 1 and new component is not undefined size 1 - // then replace it - if (structUtils.isUndefined1(currentComponentDataType) && - !structUtils.isUndefined1(newComponentDataType)) { - if (structUtils.hasEnoughUndefinedsOfAnyLengthAtOffset(computedClassStructure, + // and there are enough undefineds for it to fit, then replace it + if (EditStructureUtils.isUndefined1(currentComponentDataType) && + !EditStructureUtils.isUndefined1(newComponentDataType)) { + if (EditStructureUtils.hasEnoughUndefinedsOfAnyLengthAtOffset( + computedClassStructure, offset, length, monitor)) { boolean successfulClear = - structUtils.clearLengthAtOffset(computedClassStructure, offset, + EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset, length, monitor); if (successfulClear) { @@ -567,13 +566,14 @@ public class RecoveredClass { // if new component is not an undefined data type and the current componenent(s) // that make up new component length are all undefineds then clear and replace // the current component(s) with the new one - if (structUtils.isUndefined(currentComponentDataType) && - !structUtils.isUndefined(newComponentDataType)) { + if (Undefined.isUndefined(currentComponentDataType) && + !Undefined.isUndefined(newComponentDataType)) { - if (structUtils.hasEnoughUndefinedsOfAnyLengthAtOffset(computedClassStructure, + if (EditStructureUtils.hasEnoughUndefinedsOfAnyLengthAtOffset( + computedClassStructure, offset, length, monitor)) { boolean successfulClear = - structUtils.clearLengthAtOffset(computedClassStructure, offset, + EditStructureUtils.clearLengthAtOffset(computedClassStructure, offset, length, monitor); if (successfulClear) { @@ -601,7 +601,7 @@ public class RecoveredClass { continue; } - if (structUtils.isUndefined1(dataType)) { + if (EditStructureUtils.isUndefined1(dataType)) { dataType = new Undefined1DataType(); DataTypeComponent component = computedClassStructure.getComponentAt(offset.intValue()); diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassUtils.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassUtils.java index 175292e794..5dcf062fc0 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassUtils.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassUtils.java @@ -130,8 +130,7 @@ public class RecoveredClassUtils { int defaultPointerSize; SymbolTable symbolTable; - ExtraScriptUtils extraUtils; - EditStructureUtils structUtils; + ExtendedFlatProgramAPI extendedFlatAPI; DecompilerScriptUtils decompilerUtils; CategoryPath classDataTypesCategoryPath; @@ -156,10 +155,10 @@ public class RecoveredClassUtils { this.tool = tool; this.api = api; - extraUtils = new ExtraScriptUtils(program, monitor); + extendedFlatAPI = new ExtendedFlatProgramAPI(program, monitor); this.classDataTypesCategoryPath = - extraUtils.createDataTypeCategoryPath(CategoryPath.ROOT, DTM_CLASS_DATA_FOLDER_NAME); + extendedFlatAPI.createDataTypeCategoryPath(CategoryPath.ROOT, DTM_CLASS_DATA_FOLDER_NAME); this.createBookmarks = createBookmarks; this.useShortTemplates = useShortTemplates; @@ -169,7 +168,6 @@ public class RecoveredClassUtils { globalNamespace = (GlobalNamespace) program.getGlobalNamespace(); decompilerUtils = new DecompilerScriptUtils(program, tool, monitor); - structUtils = new EditStructureUtils(); dataTypeManager = program.getDataTypeManager(); symbolTable = program.getSymbolTable(); @@ -416,7 +414,7 @@ public class RecoveredClassUtils { if (allConstructorsAndDestructors.contains(calledFunction)) { // get list of refs to this function from the calling function List
referencesToFunctionBFromFunctionA = - extraUtils.getReferencesToFunctionBFromFunctionA(function, + extendedFlatAPI.getReferencesToFunctionBFromFunctionA(function, referencedFunction); // add them to list of ref address pairs Iterator
iterator = referencesToFunctionBFromFunctionA.iterator(); @@ -684,7 +682,7 @@ public class RecoveredClassUtils { monitor.checkCanceled(); Address vftableRef = vftableRefIterator.next(); - Address vftableAddress = extraUtils.getSingleReferencedAddress(vftableRef); + Address vftableAddress = extendedFlatAPI.getSingleReferencedAddress(vftableRef); if (vftableAddress == null) { continue; @@ -1264,11 +1262,11 @@ public class RecoveredClassUtils { DataType dataType = function.getParameter(i).getDataType(); - if (!extraUtils.isPointerToEmptyStructure(dataType)) { + if (!extendedFlatAPI.isPointerToEmptyStructure(dataType)) { continue; } - PointerDataType ptrUndefined = extraUtils.createPointerToUndefinedDataType(dataType); + PointerDataType ptrUndefined = extendedFlatAPI.createPointerToUndefinedDataType(dataType); if (ptrUndefined != null) { function.getParameter(i).setDataType(ptrUndefined, SourceType.ANALYSIS); } @@ -1277,9 +1275,9 @@ public class RecoveredClassUtils { // Next check the return type to see if it is the empty structure DataType returnType = function.getReturnType(); - if (extraUtils.isPointerToEmptyStructure(returnType)) { + if (extendedFlatAPI.isPointerToEmptyStructure(returnType)) { PointerDataType ptrUndefined = - extraUtils.createPointerToUndefinedDataType(returnType); + extendedFlatAPI.createPointerToUndefinedDataType(returnType); if (ptrUndefined != null) { function.setReturnType(ptrUndefined, SourceType.ANALYSIS); } @@ -1694,7 +1692,7 @@ public class RecoveredClassUtils { return possibleParentConstructors; } - Address minVftableReference = extraUtils.getMinimumAddressOnList(vftableReferenceList); + Address minVftableReference = extendedFlatAPI.getMinimumAddressOnList(vftableReferenceList); Iterator iterator = refAddrPairList.iterator(); while (iterator.hasNext()) { @@ -1768,7 +1766,7 @@ public class RecoveredClassUtils { return possibleParentDestructors; } - Address maxVftableReference = extraUtils.getMaximumAddressOnList(vftableReferenceList); + Address maxVftableReference = extendedFlatAPI.getMaximumAddressOnList(vftableReferenceList); Iterator iterator = refAddrPairList.iterator(); while (iterator.hasNext()) { @@ -1776,7 +1774,7 @@ public class RecoveredClassUtils { ReferenceAddressPair refAddrPair = iterator.next(); Address sourceAddr = refAddrPair.getSource(); if (sourceAddr.compareTo(maxVftableReference) > 0) { - Function calledFunction = extraUtils.getFunctionAt(refAddrPair.getDestination()); + Function calledFunction = extendedFlatAPI.getFunctionAt(refAddrPair.getDestination()); if (calledFunction != null) { possibleParentDestructors.add(calledFunction); } @@ -1960,7 +1958,7 @@ public class RecoveredClassUtils { } // If not already, make function a thiscall - extraUtils.makeFunctionThiscall(constructorFunction); + extendedFlatAPI.makeFunctionThiscall(constructorFunction); recoveredClass.addConstructor(constructorFunction); addToAllConstructors(constructorFunction); @@ -1978,7 +1976,7 @@ public class RecoveredClassUtils { throws InvalidInputException, DuplicateNameException { //If not already, make function a thiscall - extraUtils.makeFunctionThiscall(inlinedConstructorFunction); + extendedFlatAPI.makeFunctionThiscall(inlinedConstructorFunction); recoveredClass.addInlinedConstructor(inlinedConstructorFunction); addToAllInlinedConstructors(inlinedConstructorFunction); @@ -1995,7 +1993,7 @@ public class RecoveredClassUtils { throws InvalidInputException, DuplicateNameException { //If not already, make function a thiscall - extraUtils.makeFunctionThiscall(destructorFunction); + extendedFlatAPI.makeFunctionThiscall(destructorFunction); recoveredClass.addDestructor(destructorFunction); addToAllDestructors(destructorFunction); @@ -2013,7 +2011,7 @@ public class RecoveredClassUtils { throws InvalidInputException, DuplicateNameException { //If not already, make function a thiscall - extraUtils.makeFunctionThiscall(inlinedDestructorFunction); + extendedFlatAPI.makeFunctionThiscall(inlinedDestructorFunction); recoveredClass.addInlinedDestructor(inlinedDestructorFunction); addToAllInlinedDestructors(inlinedDestructorFunction); @@ -2098,7 +2096,7 @@ public class RecoveredClassUtils { Address constructorReference = constructorIterator.next(); RecoveredClass recoveredClass = referenceToClassMap.get(constructorReference); - Function constructor = extraUtils.getReferencedFunction(constructorReference, true); + Function constructor = extendedFlatAPI.getReferencedFunction(constructorReference, true); if (recoveredClass.getIndeterminateList().contains(constructor)) { addConstructorToClass(recoveredClass, constructor); @@ -2295,7 +2293,7 @@ public class RecoveredClassUtils { ReferenceAddressPair referenceAddressPair = calledFunctionIterator.next(); Address calledFunctionAddress = referenceAddressPair.getDestination(); - Function calledFunction = extraUtils.getFunctionAt(calledFunctionAddress); + Function calledFunction = extendedFlatAPI.getFunctionAt(calledFunctionAddress); if (calledFunction.isThunk()) { calledFunction = calledFunction.getThunkedFunction(true); @@ -2329,7 +2327,7 @@ public class RecoveredClassUtils { ReferenceAddressPair referenceAddressPair = calledFunctionIterator.next(); Address calledFunctionAddress = referenceAddressPair.getDestination(); - Function calledFunction = extraUtils.getFunctionAt(calledFunctionAddress); + Function calledFunction = extendedFlatAPI.getFunctionAt(calledFunctionAddress); if (calledFunction.isThunk()) { calledFunction = calledFunction.getThunkedFunction(true); @@ -2542,7 +2540,7 @@ public class RecoveredClassUtils { Address destructorReference = destructorIterator.next(); RecoveredClass recoveredClass = referenceToClassMap.get(destructorReference); - Function destructor = extraUtils.getReferencedFunction(destructorReference, true); + Function destructor = extendedFlatAPI.getReferencedFunction(destructorReference, true); if (recoveredClass.getIndeterminateList().contains(destructor)) { addDestructorToClass(recoveredClass, destructor); @@ -2668,7 +2666,7 @@ public class RecoveredClassUtils { String className = namespace.getName(); String classNameWithNamespace = namespace.getName(true); - CategoryPath classPath = extraUtils.createDataTypeCategoryPath(classDataTypesCategoryPath, + CategoryPath classPath = extendedFlatAPI.createDataTypeCategoryPath(classDataTypesCategoryPath, classNameWithNamespace); RecoveredClass newClass = @@ -2873,7 +2871,7 @@ public class RecoveredClassUtils { while (referencesIterator.hasNext()) { monitor.checkCanceled(); Address vftableReference = referencesIterator.next(); - Function functionContaining = extraUtils.getFunctionContaining(vftableReference); + Function functionContaining = extendedFlatAPI.getFunctionContaining(vftableReference); if (functionContaining != null) { vftableRefToFunctionMapping.put(vftableReference, functionContaining); } @@ -2923,7 +2921,7 @@ public class RecoveredClassUtils { Data vftableData = program.getListing().getDefinedDataAt(vftableAddress); // now make sure the array or the structure is all pointers - if (!extraUtils.isArrayOrStructureOfAllPointers(vftableData)) { + if (!extendedFlatAPI.isArrayOrStructureOfAllPointers(vftableData)) { // if it isn't an array of pointers then we don't know the size of the vftable // If undefined or pointers not in array or struct then see if what they are // pointing to are in the class already to determine size of array @@ -2957,12 +2955,12 @@ public class RecoveredClassUtils { monitor.checkCanceled(); Address functionPointerAddress = vftableData.getComponent(i).getAddress(); - if (allowNullFunctionPtrs && extraUtils.isNullPointer(functionPointerAddress)) { + if (allowNullFunctionPtrs && extendedFlatAPI.isNullPointer(functionPointerAddress)) { virtualFunctionList.add(null); continue; } - Function function = extraUtils.getPointedToFunction(functionPointerAddress); + Function function = extendedFlatAPI.getPointedToFunction(functionPointerAddress); if (function != null) { virtualFunctionList.add(function); @@ -3009,7 +3007,7 @@ public class RecoveredClassUtils { boolean stillInCurrentTable = true; while (address != null && currentBlock.contains(address) && stillInCurrentTable && - extraUtils.isFunctionPointer(address, allowNullFunctionPtrs)) { + extendedFlatAPI.isFunctionPointer(address, allowNullFunctionPtrs)) { numFunctionPointers++; address = address.add(defaultPointerSize); Symbol symbol = program.getSymbolTable().getPrimarySymbol(address); @@ -3098,7 +3096,7 @@ public class RecoveredClassUtils { program.getListing().getInstructionContaining(vftableReference); if (instructionContaining != null) { boolean functionCreated = - extraUtils.createFunction(program, vftableReference); + extendedFlatAPI.createFunction(program, vftableReference); if (!functionCreated) { notInFunctionVftableRefs.add(vftableReference); @@ -3154,7 +3152,7 @@ public class RecoveredClassUtils { } else { boolean functionCreated = - extraUtils.createFunction(prog, addr); + extendedFlatAPI.createFunction(prog, addr); if (!functionCreated) { notInFunctionVftableRefs.add(addr); } @@ -3819,7 +3817,7 @@ public class RecoveredClassUtils { if (!badFIDNamespaces.contains(symbol.getParentNamespace())) { badFIDNamespaces.add(symbol.getParentNamespace()); } - extraUtils.addUniqueStringToPlateComment(functionAddress, + extendedFlatAPI.addUniqueStringToPlateComment(functionAddress, "***** Removed Bad FID Symbol *****"); if (!badFIDFunctions.contains(function)) { @@ -3827,7 +3825,7 @@ public class RecoveredClassUtils { } findAndRemoveBadStructuresFromFunction(function, namespace); - extraUtils.removeAllSymbolsAtAddress(functionAddress); + extendedFlatAPI.removeAllSymbolsAtAddress(functionAddress); } return; @@ -3838,7 +3836,7 @@ public class RecoveredClassUtils { if (bookmarkComment.contains("Multiple Matches")) { // See if any contain the class name and if so add "resolved" and if not if (doAnySymbolsHaveMatchingName(functionAddress, name)) { - extraUtils.addUniqueStringToPlateComment(functionAddress, + extendedFlatAPI.addUniqueStringToPlateComment(functionAddress, "***** Resolved FID Conflict *****"); if (!resolvedFIDFunctions.contains(function)) { @@ -3848,7 +3846,7 @@ public class RecoveredClassUtils { findAndRemoveBadStructuresFromFunction(function, namespace); } else { - extraUtils.addUniqueStringToPlateComment(functionAddress, + extendedFlatAPI.addUniqueStringToPlateComment(functionAddress, "***** Removed Bad FID Symbol(s) *****"); if (!badFIDFunctions.contains(function)) { @@ -3858,7 +3856,7 @@ public class RecoveredClassUtils { findAndRemoveBadStructuresFromFunction(function, namespace); } - extraUtils.removeAllSymbolsAtAddress(functionAddress); + extendedFlatAPI.removeAllSymbolsAtAddress(functionAddress); return; } } @@ -3971,7 +3969,7 @@ public class RecoveredClassUtils { monitor.checkCanceled(); DataType dataType = function.getParameter(i).getDataType(); if (!dataType.getName().equals(namespace.getName()) && - extraUtils.isPointerToEmptyStructure(dataType)) { + extendedFlatAPI.isPointerToEmptyStructure(dataType)) { Pointer ptr = (Pointer) dataType; Structure structure = (Structure) ptr.getDataType(); @@ -4001,7 +3999,7 @@ public class RecoveredClassUtils { for (int i = 0; i < parameterCount; i++) { monitor.checkCanceled(); DataType paramDataType = function.getParameter(i).getDataType(); - Structure baseDataType = extraUtils.getBaseStructureDataType(paramDataType); + Structure baseDataType = extendedFlatAPI.getBaseStructureDataType(paramDataType); if (baseDataType != null && badStructureDataTypes.contains(baseDataType)) { // To remove from this param we have to remove the function from its namespace @@ -4011,7 +4009,7 @@ public class RecoveredClassUtils { } else { PointerDataType ptrUndefined = - extraUtils.createPointerToUndefinedDataType(paramDataType); + extendedFlatAPI.createPointerToUndefinedDataType(paramDataType); if (ptrUndefined != null) { function.getParameter(i).setDataType(ptrUndefined, SourceType.ANALYSIS); } @@ -4036,7 +4034,7 @@ public class RecoveredClassUtils { DataType returnType = function.getReturnType(); if (!returnType.getName().equals(namespace.getName()) && - extraUtils.isPointerToEmptyStructure(returnType)) { + extendedFlatAPI.isPointerToEmptyStructure(returnType)) { Pointer ptr = (Pointer) returnType; Structure structure = (Structure) ptr.getDataType(); @@ -4058,10 +4056,10 @@ public class RecoveredClassUtils { throws InvalidInputException { DataType returnType = function.getReturnType(); - Structure baseDataType = extraUtils.getBaseStructureDataType(returnType); + Structure baseDataType = extendedFlatAPI.getBaseStructureDataType(returnType); if (baseDataType != null && badStructureDataTypes.contains(baseDataType)) { PointerDataType ptrUndefined = - extraUtils.createPointerToUndefinedDataType(returnType); + extendedFlatAPI.createPointerToUndefinedDataType(returnType); if (ptrUndefined != null) { function.setReturnType(ptrUndefined, SourceType.ANALYSIS); } @@ -4080,13 +4078,13 @@ public class RecoveredClassUtils { private boolean doAnySymbolsHaveMatchingName(Address address, String name) throws CancelledException { - String simpleName = extraUtils.removeTemplate(name); + String simpleName = extendedFlatAPI.removeTemplate(name); SymbolIterator it = symbolTable.getSymbolsAsIterator(address); for (Symbol symbol : it) { monitor.checkCanceled(); - String simpleSymbolName = extraUtils.removeTemplate(symbol.getName()); + String simpleSymbolName = extendedFlatAPI.removeTemplate(symbol.getName()); simpleSymbolName = removeSingleQuotes(simpleSymbolName); simpleSymbolName = removeFIDConflict(simpleSymbolName); simpleSymbolName = removeSingleQuotes(simpleSymbolName); @@ -4178,7 +4176,7 @@ public class RecoveredClassUtils { throws CancelledException { List orderedReferenceAddressPairsFromCallingFunction = - extraUtils.getOrderedReferenceAddressPairsFromCallingFunction(constructor); + extendedFlatAPI.getOrderedReferenceAddressPairsFromCallingFunction(constructor); // if there are no calls from the function then return false if (orderedReferenceAddressPairsFromCallingFunction.size() == 0) { @@ -4252,9 +4250,9 @@ public class RecoveredClassUtils { monitor.checkCanceled(); Function vfunction = vfunctionIterator.next(); - if (extraUtils.doesFunctionACallAnyListedFunction(vfunction, + if (extendedFlatAPI.doesFunctionACallAnyListedFunction(vfunction, recoveredClass.getConstructorList()) && - !extraUtils.doesFunctionACallAnyListedFunction(vfunction, + !extendedFlatAPI.doesFunctionACallAnyListedFunction(vfunction, allOtherConstructors)) { cloneToClassMap.put(vfunction, recoveredClass); } @@ -4297,13 +4295,13 @@ public class RecoveredClassUtils { if (calledFunctions.size() != 2 && calledFunctions.size() != 3) { return false; } - if (!extraUtils.getCalledFunctionByCallOrder(caller, 1).equals(firstCalled)) { + if (!extendedFlatAPI.getCalledFunctionByCallOrder(caller, 1).equals(firstCalled)) { return false; } RecoveredClass recoveredClass = cloneFunctionToClassMap.get(caller); List constructorList = recoveredClass.getConstructorList(); - Function secondFunction = extraUtils.getCalledFunctionByCallOrder(caller, 2); + Function secondFunction = extendedFlatAPI.getCalledFunctionByCallOrder(caller, 2); if (secondFunction.isThunk()) { secondFunction = secondFunction.getThunkedFunction(true); } @@ -4342,7 +4340,7 @@ public class RecoveredClassUtils { // The second call is a class constructor and we know it is called // from the cloneFunction or it wouldn't be a cloneFunction Function firstCalledFunction = - extraUtils.getCalledFunctionByCallOrder(cloneFunction, 1); + extendedFlatAPI.getCalledFunctionByCallOrder(cloneFunction, 1); if (firstCalledFunction == null) { continue; } @@ -4434,7 +4432,7 @@ public class RecoveredClassUtils { Namespace badNamespace = badNamespaceIterator.next(); // delete empty namespace and parent namespaces - if (!extraUtils.hasSymbolsInNamespace(badNamespace)) { + if (!extendedFlatAPI.hasSymbolsInNamespace(badNamespace)) { removeEmptyNamespaces(badNamespace); } } @@ -4455,7 +4453,7 @@ public class RecoveredClassUtils { Namespace parentNamespace = namespace.getParentNamespace(); namespace.getSymbol().delete(); - while (parentNamespace != null && !extraUtils.hasSymbolsInNamespace(parentNamespace)) { + while (parentNamespace != null && !extendedFlatAPI.hasSymbolsInNamespace(parentNamespace)) { monitor.checkCanceled(); namespace = parentNamespace; @@ -4500,7 +4498,7 @@ public class RecoveredClassUtils { throws CancelledException { DataType dataType = dataTypeManager.getDataType(folderPath, structureName); - if (extraUtils.isEmptyStructure(dataType)) { + if (extendedFlatAPI.isEmptyStructure(dataType)) { dataTypeManager.remove(dataType, monitor); Category classCategory = dataTypeManager.getCategory(folderPath); @@ -5335,7 +5333,7 @@ public class RecoveredClassUtils { } // get first called function and verify it is on cd list Function firstCalledFunction = - extraUtils.getCalledFunctionByCallOrder(deletingDestructor, 1); + extendedFlatAPI.getCalledFunctionByCallOrder(deletingDestructor, 1); if (firstCalledFunction == null || !recoveredClass.getConstructorOrDestructorFunctions() .contains( @@ -5345,7 +5343,7 @@ public class RecoveredClassUtils { // get second one and if operator_delete has not been assigned yet, assign it Function secondCalledFunction = - extraUtils.getCalledFunctionByCallOrder(deletingDestructor, 2); + extendedFlatAPI.getCalledFunctionByCallOrder(deletingDestructor, 2); if (secondCalledFunction == null) { return null; } @@ -5392,7 +5390,7 @@ public class RecoveredClassUtils { throws CancelledException, InvalidInputException, DuplicateNameException { // don't continue checking if it doesn't call operator_delete - if (!extraUtils.doesFunctionACallFunctionB(virtualFunction, operatorDeleteFunction)) { + if (!extendedFlatAPI.doesFunctionACallFunctionB(virtualFunction, operatorDeleteFunction)) { return; } @@ -5408,7 +5406,7 @@ public class RecoveredClassUtils { Function function = functionIterator.next(); //Type 4 - class c/d called from other than first vfunction - if (extraUtils.doesFunctionACallFunctionB(virtualFunction, function)) { + if (extendedFlatAPI.doesFunctionACallFunctionB(virtualFunction, function)) { recoveredClass.addDeletingDestructor(virtualFunction); addDestructorToClass(recoveredClass, function); recoveredClass.removeIndeterminateConstructorOrDestructor(function); @@ -5454,7 +5452,7 @@ public class RecoveredClassUtils { continue; } - Function referencedFunction = extraUtils.getReferencedFunction(codeUnitAddress, true); + Function referencedFunction = extendedFlatAPI.getReferencedFunction(codeUnitAddress, true); if (referencedFunction == null) { continue; } @@ -5580,7 +5578,7 @@ public class RecoveredClassUtils { String fieldname = dataTypeComponent.getFieldName(); - structureDataType = structUtils.addDataTypeToStructure(structureDataType, + structureDataType = EditStructureUtils.addDataTypeToStructure(structureDataType, startOffset + dataComponentOffset, dataTypeComponent.getDataType(), fieldname, monitor); } @@ -5609,7 +5607,7 @@ public class RecoveredClassUtils { String fieldname = dataTypeComponent.getFieldName(); - structureDataType = structUtils.addDataTypeToStructure(structureDataType, + structureDataType = EditStructureUtils.addDataTypeToStructure(structureDataType, startOffset + dataComponentOffset, dataTypeComponent.getDataType(), fieldname, monitor); } @@ -5913,9 +5911,9 @@ public class RecoveredClassUtils { // get first called function and verify is not a c/d function in current class or // any class get second called function and verify it is operator delete Function firstCalledFunction = - extraUtils.getCalledFunctionByCallOrder(vFunction, 1); + extendedFlatAPI.getCalledFunctionByCallOrder(vFunction, 1); Function secondCalledFunction = - extraUtils.getCalledFunctionByCallOrder(vFunction, 2); + extendedFlatAPI.getCalledFunctionByCallOrder(vFunction, 2); if (firstCalledFunction != null && secondCalledFunction != null && !recoveredClass.getConstructorOrDestructorFunctions() .contains( @@ -6197,7 +6195,7 @@ public class RecoveredClassUtils { Map referenceToClassMap = getReferenceToClassMap(recoveredClass, inlineFunction); List
referencesToFunctions = - extraUtils.getReferencesToFunctions(referenceToClassMap); + extendedFlatAPI.getReferencesToFunctions(referenceToClassMap); // if some of the references are to functions figure out if they are // constructors destructors or add them to list of indetermined @@ -6212,7 +6210,7 @@ public class RecoveredClassUtils { monitor.checkCanceled(); Address functionReference = functionReferenceIterator.next(); Function function = - extraUtils.getReferencedFunction(functionReference, true); + extendedFlatAPI.getReferencedFunction(functionReference, true); if (function == null) { continue; } @@ -6342,7 +6340,7 @@ public class RecoveredClassUtils { } int dataLength = - structUtils.getNumberOfUndefinedsBeforeOffset(structure, endOfData, monitor); + EditStructureUtils.getNumberOfUndefinedsBeforeOffset(structure, endOfData, monitor); if (dataLength < 0) { return NONE; } @@ -6378,7 +6376,7 @@ public class RecoveredClassUtils { boolean callsKnownConstructor = callsKnownConstructor(indeterminateFunction); boolean callsKnownDestrutor = callsKnownDestructor(indeterminateFunction); boolean callsAtexit = - extraUtils.doesFunctionACallFunctionB(indeterminateFunction, atexit); + extendedFlatAPI.doesFunctionACallFunctionB(indeterminateFunction, atexit); if (callsKnownConstructor && !callsKnownDestrutor) { addConstructorToClass(recoveredClass, indeterminateFunction); @@ -6486,7 +6484,7 @@ public class RecoveredClassUtils { public void findFunctionsUsingAtexit() throws CancelledException, InvalidInputException { Function atexitFunction = null; - List atexitFunctions = extraUtils.getGlobalFunctions("_atexit"); + List atexitFunctions = extendedFlatAPI.getGlobalFunctions("_atexit"); if (atexitFunctions.size() != 1) { return; } @@ -6501,13 +6499,13 @@ public class RecoveredClassUtils { Reference ref = referenceIterator.next(); Address fromAddress = ref.getFromAddress(); - Function function = extraUtils.getFunctionContaining(fromAddress); + Function function = extendedFlatAPI.getFunctionContaining(fromAddress); if (function == null) { AddressSet subroutineAddresses = - extraUtils.getSubroutineAddresses(program, fromAddress); + extendedFlatAPI.getSubroutineAddresses(program, fromAddress); Address minAddress = subroutineAddresses.getMinAddress(); - function = extraUtils.createFunction(minAddress, null); + function = extendedFlatAPI.createFunction(minAddress, null); if (function == null) { continue; } @@ -6542,9 +6540,9 @@ public class RecoveredClassUtils { continue; } - Function calledFunction = extraUtils.getFunctionAt(calledAddress); + Function calledFunction = extendedFlatAPI.getFunctionAt(calledAddress); if (calledFunction == null) { - calledFunction = extraUtils.createFunction(calledAddress, null); + calledFunction = extendedFlatAPI.createFunction(calledAddress, null); if (calledFunction == null) { continue; } @@ -6595,7 +6593,7 @@ public class RecoveredClassUtils { Address vftableAddress = vftableIterator.next(); // this gets the first function pointer in the vftable - Function firstVirtualFunction = extraUtils.getPointedToFunction(vftableAddress); + Function firstVirtualFunction = extendedFlatAPI.getPointedToFunction(vftableAddress); processDeletingDestructor(recoveredClass, firstVirtualFunction); } } @@ -6641,7 +6639,7 @@ public class RecoveredClassUtils { monitor.checkCanceled(); Address vftableAddress = vftableAddressIterator.next(); - Function firstVirtualFunction = extraUtils.getPointedToFunction(vftableAddress); + Function firstVirtualFunction = extendedFlatAPI.getPointedToFunction(vftableAddress); List virtualFunctions = recoveredClass.getVirtualFunctions(vftableAddress); @@ -6748,7 +6746,7 @@ public class RecoveredClassUtils { Function function = functionIterator.next(); - if (extraUtils.doesFunctionACallFunctionB(firstVirtualFunction, function)) { + if (extendedFlatAPI.doesFunctionACallFunctionB(firstVirtualFunction, function)) { recoveredClass.addDeletingDestructor(firstVirtualFunction); addDestructorToClass(recoveredClass, function); recoveredClass.removeIndeterminateConstructorOrDestructor(function); @@ -7113,7 +7111,7 @@ public class RecoveredClassUtils { // if the computed class struct has field name (ie from pdb) use it otherwise create one if (definedComponent.getFieldName() == null) { - fieldName = "offset_" + extraUtils.toHexString(offset, false, true); + fieldName = "offset_" + extendedFlatAPI.toHexString(offset, false, true); } else { fieldName = definedComponent.getFieldName(); @@ -7149,7 +7147,7 @@ public class RecoveredClassUtils { for (DataTypeComponent component : definedComponents) { monitor.checkCanceled(); - classStructureDataType = structUtils.addDataTypeToStructure( + classStructureDataType = EditStructureUtils.addDataTypeToStructure( classStructureDataType, component.getOffset(), component.getDataType(), component.getFieldName(), monitor); } @@ -7302,7 +7300,7 @@ public class RecoveredClassUtils { } String classNameWithNamespace = classNamespace.getName(true); - CategoryPath classPath = extraUtils.createDataTypeCategoryPath( + CategoryPath classPath = extendedFlatAPI.createDataTypeCategoryPath( classDataTypesCategoryPath, classNameWithNamespace); // check that the given vftable data type is in the right ClassDataTypes/