From f8f4d2f3e95155c0f074c6c0b27361ca63705cb3 Mon Sep 17 00:00:00 2001 From: dev747368 <48332326+dev747368@users.noreply.github.com> Date: Thu, 9 May 2024 19:00:20 +0000 Subject: [PATCH 1/3] GP-0 fix color of the horizontal line and text that separates programs --- .../src/main/java/docking/menu/HorizontalRuleAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java b/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java index cec98ab329..1e19dd2d17 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java @@ -27,7 +27,7 @@ import docking.DockingUtils; import docking.action.DockingAction; import docking.action.MenuData; import docking.widgets.label.GDHtmlLabel; -import generic.theme.GThemeDefaults.Colors.Palette; +import generic.theme.GThemeDefaults.Colors; import ghidra.util.HTMLUtilities; /** @@ -57,7 +57,7 @@ public class HorizontalRuleAction extends DockingAction { String bottomHtml = HTMLUtilities.escapeHTML(bottomName); menuData.setMenuItemNamePlain(String.format("""
%s
%s
- """, Palette.SILVER, topHtml, bottomHtml)); + """, Colors.FOREGROUND_DISABLED, topHtml, bottomHtml)); setMenuBarData(menuData); // the description is meant to be used for the tooltip and is larger From fb29ad360f6c91d7d0c23b36a8766aafb6b738aa Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 10 May 2024 00:25:35 +0200 Subject: [PATCH 2/3] Fix warnings that have become errors with GCC 14 --- .../Framework-Debugging/src/expCloneExec/c/expCloneExec.c | 1 + Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c | 1 + Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c | 2 ++ Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c | 6 +++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c b/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c index 23bd76aeac..1f920bd108 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c +++ b/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c @@ -15,6 +15,7 @@ */ #include #include +#include pthread_t thread; diff --git a/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c b/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c index 9a72a46716..edb3fa5a80 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c +++ b/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c @@ -14,6 +14,7 @@ * limitations under the License. */ #include +#include int func(int id) { if (id) { diff --git a/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c b/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c index d7eea169ae..778c310ced 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c +++ b/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c @@ -15,6 +15,8 @@ */ #ifdef WIN32 #include +#else +#include #endif #ifdef WIN32 diff --git a/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c b/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c index 33ee6f38da..19504f60b8 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c +++ b/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c @@ -38,7 +38,7 @@ typedef enum _myenum { typedef void (*myfunc_p)(int arg0, long arg1); typedef void (*myvargfunc_p)(int arg0, long arg1, ...); -typedef myundef; +typedef int myundef; // forbidding to be "undefined" in C99 and later int int_var; void* void_p_var; @@ -86,11 +86,11 @@ int main(int argc, char** argv) { printf("complex: %d\n", sizeof(complex_var)); printf("double complex: %d\n", sizeof(double_complex_var)); - register mycomplex_p cparts = &complex_var; + register mycomplex_p cparts = (mycomplex_p)&complex_var; printf("single real: %f\n", cparts->real); printf("single imag: %f\n", cparts->imag); - mydoublex_p dparts = &double_complex_var; + mydoublex_p dparts = (mydoublex_p)&double_complex_var; printf("double real: %g\n", dparts->real); printf("double imag: %g\n", dparts->imag); From 22991fb092b3c780b875d88de3631efaa0b6eb67 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Fri, 10 May 2024 06:44:11 -0700 Subject: [PATCH 3/3] GP-4588: Delete expTypes.c --- Ghidra/Debug/Framework-Debugging/build.gradle | 12 -- .../src/expTypes/c/expTypes.c | 111 ------------------ 2 files changed, 123 deletions(-) delete mode 100644 Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c diff --git a/Ghidra/Debug/Framework-Debugging/build.gradle b/Ghidra/Debug/Framework-Debugging/build.gradle index 53609125ea..7437fb091d 100644 --- a/Ghidra/Debug/Framework-Debugging/build.gradle +++ b/Ghidra/Debug/Framework-Debugging/build.gradle @@ -55,7 +55,6 @@ task testSpecimenLinux_x86_64 { dependsOn 'expPrintLinux_x86_64Executable' dependsOn 'expReadLinux_x86_64Executable' dependsOn 'expSpinLinux_x86_64Executable' - //dependsOn 'expTypesExecutable'//Linux_x86_64Executable' dependsOn 'expRegistersLinux_x86_64Executable' dependsOn 'expStackLinux_x86_64Executable' dependsOn 'expTraceableSleepExecutable'//Linux_x86_64Executable' @@ -124,17 +123,6 @@ model { targetPlatform "win_x86_64" targetPlatform "win_x86_32" // TODO: Test on these } - expTypes(NativeExecutableSpec) { - targetPlatform "linux_x86_64" - //targetPlatform "linux_x86_32" // TODO: Test on these - binaries { - withType(NativeExecutableBinarySpec) { - if (toolChain in Gcc) { - cCompiler.args("-gdwarf-2") - } - } - } - } expRegisters(NativeExecutableSpec) { targetPlatform "linux_x86_64" //targetPlatform "linux_x86_32" // TODO: Test on these diff --git a/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c b/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c deleted file mode 100644 index 19504f60b8..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c +++ /dev/null @@ -1,111 +0,0 @@ -/* ### - * 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. - */ -#include "stdio.h" -#include "complex.h" - -typedef struct _mystruct { - int f1; - long f2; - short f3:4; - short f4:4; - short f5:4; - short f6:4; -} mystruct, *mystruct_p, mystruct_arr[5]; - -typedef union _myunion { - long as_long; - float as_float; -} myunion, *myunion_p, myunion_arr[6]; - -typedef enum _myenum { - FIRST = 0, - SECOND, -} myenum, *myenum_p, myenum_arr[7]; - -typedef void (*myfunc_p)(int arg0, long arg1); -typedef void (*myvargfunc_p)(int arg0, long arg1, ...); - -typedef int myundef; // forbidding to be "undefined" in C99 and later - -int int_var; -void* void_p_var; - -__attribute__((section ("complex"))) -float complex complex_var = 1 + 2*I; -__attribute__((section ("doublex"))) -double complex double_complex_var = 3 + 4*I; -/*__attribute__((section ("ldoublex"))) -long double complex long_double_complex_var = 5 + 6*I;*/ - -typedef struct _mycomplex { - float real; - float imag; -} mycomplex, *mycomplex_p; - -typedef struct _mydoublex { - double real; - double imag; -} mydoublex, *mydoublex_p; - -typedef struct _myldoublex { - long double real; - long double imag; -} myldoublex, *myldoublex_p; - -typedef struct _mylist { - struct _mylist* next; - void* val; -} mylist, *mylist_p; - -mystruct mystruct_var; -struct _mystruct struct_mystruct_var; -mystruct_p mystruct_p_var; -mystruct_arr mystruct_arr_var; - -myunion myunion_var; -myenum myenum_var; -myfunc_p myfunc_p_var; -myvargfunc_p myvargfunc_p_var; -myundef myundef_var; -mylist_p mylist_p_var; - -int main(int argc, char** argv) { - printf("complex: %d\n", sizeof(complex_var)); - printf("double complex: %d\n", sizeof(double_complex_var)); - - register mycomplex_p cparts = (mycomplex_p)&complex_var; - printf("single real: %f\n", cparts->real); - printf("single imag: %f\n", cparts->imag); - - mydoublex_p dparts = (mydoublex_p)&double_complex_var; - printf("double real: %g\n", dparts->real); - printf("double imag: %g\n", dparts->imag); - - /*myldoublex_p ldparts = &long_double_complex_var; - printf("long double real: %lg\n", ldparts->real); - printf("long double imag: %lg\n", ldparts->imag);*/ -} - -/* -Wrote: -1d000000000000002e0b00000000000000000000000407000000000000005f6d79656e756d -1d000000000000002e0f00000000000000000000000407000000000000005f6d79656e756d -Read: 49000000000000002f0b0000000407000000000000005f6d79656e756d07020000000000000005000000000000004649525354000000000000000006000000000000005345434f4e440100000000000000 - -Wrote: 1d000000000000002e0f00000000000000000000000407000000000000005f6d79656e756d -Read: 49000000000000002f0f0000000407000000000000005f6d79656e756d07020000000000000005000000000000004649525354000000000000000006000000000000005345434f4e440100000000000000 - -*/