Skip to content

Commit

Permalink
monitor:braces {} are necessary for all arms of this statement
Browse files Browse the repository at this point in the history
Fix the errors by add {}

Signed-off-by: Yutao Ai <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
aiyutao9179 authored and dagrh committed Dec 18, 2020
1 parent d22b854 commit 89854b9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions monitor/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,10 @@ static void hmp_singlestep(Monitor *mon, const QDict *qdict)
static void hmp_gdbserver(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_try_str(qdict, "device");
if (!device)
if (!device) {
device = "tcp::" DEFAULT_GDBSTUB_PORT;
}

if (gdbserver_start(device) < 0) {
monitor_printf(mon, "Could not open gdbserver on device '%s'\n",
device);
Expand Down Expand Up @@ -559,10 +561,11 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
}

len = wsize * count;
if (wsize == 1)
if (wsize == 1) {
line_size = 8;
else
} else {
line_size = 16;
}
max_digits = 0;

switch(format) {
Expand All @@ -583,10 +586,11 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
}

while (len > 0) {
if (is_physical)
if (is_physical) {
monitor_printf(mon, TARGET_FMT_plx ":", addr);
else
} else {
monitor_printf(mon, TARGET_FMT_lx ":", (target_ulong)addr);
}
l = len;
if (l > line_size)
l = line_size;
Expand Down

0 comments on commit 89854b9

Please sign in to comment.