]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Adjust types in gdb module to have intended unsigned shifts rather than
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 10 Mar 2013 17:36:39 +0000 (18:36 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 10 Mar 2013 17:36:39 +0000 (18:36 +0100)
signed divisions.

ChangeLog
grub-core/gdb/cstub.c
grub-core/gdb/i386/signal.c
include/grub/gdb.h

index 931ae8e641fbc521cfda6173ef27a44943f9d972..51bc363405f5c713f3969c560851a4d814176719 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Adjust types in gdb module to have intended unsigned shifts rather than
+       signed divisions.
+
 2013-03-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/hfs.c (grub_hfs_read_file): Avoid divmod64 since the
index a5c0c4316545b76ab899a1ef96dfd1fb3299bb6d..3c89c1946fcc90256ea508e4cf466cb0d590dd1f 100644 (file)
@@ -204,7 +204,7 @@ grub_gdb_hex2int (char **ptr, grub_uint64_t *int_value)
 void
 grub_gdb_trap (int trap_no)
 {
-  int sig_no;
+  unsigned int sig_no;
   int stepping;
   grub_uint64_t addr;
   grub_uint64_t length;
@@ -264,7 +264,7 @@ grub_gdb_trap (int trap_no)
        case '?':
          grub_gdb_outbuf[0] = 'S';
          grub_gdb_outbuf[1] = hexchars[sig_no >> 4];
-         grub_gdb_outbuf[2] = hexchars[sig_no % 16];
+         grub_gdb_outbuf[2] = hexchars[sig_no & 0xf];
          grub_gdb_outbuf[3] = 0;
          break;
 
index 23b7c3506096bc2e51c3042cdc0f09972156566b..1ac3bbd183d86cd84430223818a2910b45377645 100644 (file)
@@ -24,7 +24,7 @@
 
 /* Converting CPU trap number to UNIX signal number as
    described in System V ABI i386 Processor Supplement, 3-25.  */
-int
+unsigned int
 grub_gdb_trap2sig (int trap_no)
 {
   const int signals[] = {
index 59fd456f945e654bafd68e1a682a1d2172b49ed4..e73d13584666a55eb4ef8f4c630064fe11ce05f8 100644 (file)
@@ -33,7 +33,7 @@ struct grub_serial_port;
 extern struct grub_serial_port *grub_gdb_port;
 
 void grub_gdb_breakpoint (void);
-int grub_gdb_trap2sig (int);
+unsigned int grub_gdb_trap2sig (int);
 
 #endif /* ! GRUB_GDB_HEADER */