qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 11/21] gdbstub: move chunks of user code into own files


From: Richard Henderson
Subject: Re: [PATCH v2 11/21] gdbstub: move chunks of user code into own files
Date: Fri, 6 Jan 2023 13:56:35 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 1/5/23 08:43, Alex Bennée wrote:
+static int gdb_signal_table[] = {
+    -1,
+    -1,
+    TARGET_SIGINT,
+    -1,
+    -1,
+    TARGET_SIGTRAP
+};
+
+int gdb_signal_to_target (int sig)
+{
+    if (sig < ARRAY_SIZE (gdb_signal_table))
+        return gdb_signal_table[sig];
+    else
+        return -1;
+}

Code movement, but usually we fix the style issues first.
Also, considering the number of array entries, I'd suggest

    switch (sig) {
    case 2:
        return TARGET_SIGINT;
    case 5:
        return TARGET_SIGTRAP;
    default:
        return -1;
    }


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]